mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-04 07:15:38 +08:00
Fix error handling in loadFromFile methods and update exception types in tests
This commit is contained in:
@@ -31,7 +31,7 @@ class ArtifactConfig
|
||||
*/
|
||||
public static function loadFromFile(string $file): void
|
||||
{
|
||||
$content = file_get_contents($file);
|
||||
$content = @file_get_contents($file);
|
||||
if ($content === false) {
|
||||
throw new WrongUsageException("Failed to read artifact config file: {$file}");
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ class PackageConfig
|
||||
*/
|
||||
public static function loadFromFile(string $file): void
|
||||
{
|
||||
$content = file_get_contents($file);
|
||||
$content = @file_get_contents($file);
|
||||
if ($content === false) {
|
||||
throw new WrongUsageException("Failed to read package config file: {$file}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user