diff --git a/CHANGELOG.md b/CHANGELOG.md index 411c7bf..8ea8bc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ features. `FileNotFoundException` in `\ncc\Exceptions` - Added a new interface class `BytecodeObjectInterface` which will be used to implement object types for compiled assets - Added new exception `GitException` in `\ncc\Exceptions` to replace all git related exceptions + - Added new exception `PackageException` in `\ncc\Exceptions` to replace all package related exceptions ### Fixed - Fixed MITM attack vector in `\ncc\Classes > HttpClient > prepareCurl()` @@ -148,6 +149,15 @@ features. - Removed unused exception `UndefinedExecutionPolicyExpection` in `\ncc\Exceptions` in favor of `ConfigurationException` - Removed unused exception `InvalidExecutionPolicyName` in `\ncc\Exceptions` (not used) - Removed unused exception `AccessDeniedException` in `\ncc\Exceptions` in favor of `AuthenticationException` + - Removed unused exception `HttpException` in `\ncc\Exceptions` in favor of `NetworkException` + - Removed unused exception `ComposerDisabledException` in `\ncc\Exceptions` in favor of `ComposerException` + - Removed unused exception `ComposerNotAvailable` in `\ncc\Exceptions` in favor of `ComposerException` + - Removed unused exception `InternalComposerNotAvailable` in `\ncc\Exceptions` in favor of `ComposerException` + - Removed unused exception `PackagePreperationFailedException` in `\ncc\Exceptions` in favor of `PackageException` + - Removed unused exception `PackageParsingException` in `\ncc\Exceptions` in favor of `PackageException` + - Removed unused exception `MissingDependencyException` in `\ncc\Exceptions` (not used) + - Removed unused exception `PackageAlreadyInstalledException` in `\ncc\Exceptions` in favor of `PackageException` + - Removed unused exception `PackageFetchException` in `\ncc\Exceptions` in favor of `PackageException` diff --git a/scratch/exceptions_plan.txt b/scratch/exceptions_plan.txt index 1d7f1c0..3ddd487 100644 --- a/scratch/exceptions_plan.txt +++ b/scratch/exceptions_plan.txt @@ -15,6 +15,7 @@ ConfigurationException * PROJECT_CONFIGURATION_NOT_FOUND * UNDEFINED_EXECUTION_POLICY * INVALID_EXECUTION_POLICY_NAME + * INVALID_PACKAGE AuthenticationException * ACCESS_DENIED @@ -27,29 +28,29 @@ ResourceNotFoundException VERSION_NOT_FOUND NO_AVAILABLE_UNITS -PackageException - UNSUPPORTED_PACKAGE - INVALID_PACKAGE - PACKAGE_PREPARATION_FAILED - PACKAGE_PARSING_EXCEPTION +PackageLockException PACKAGE_LOCK_EXCEPTION + + +PackageException + * PACKAGE_PREPARATION_FAILED + * PACKAGE_PARSING_EXCEPTION PACKAGE_ALREADY_INSTALLED PACKAGE_FETCH_EXCEPTION - MISSING_DEPENDENCY + - MISSING_DEPENDENCY IOException IO_EXCEPTION SYMLINK_EXCEPTION NetworkException - HTTP_EXCEPTION - UNSUPPORTED_REMOTE_SOURCE_TYPE + * HTTP_EXCEPTION ComposerException - COMPOSER_DISABLED_EXCEPTION - INTERNAL_COMPOSER_NOT_AVAILABLE - COMPOSER_NOT_AVAILABLE - COMPOSER_EXCEPTION + * COMPOSER_DISABLED_EXCEPTION + * INTERNAL_COMPOSER_NOT_AVAILABLE + * COMPOSER_NOT_AVAILABLE + * COMPOSER_EXCEPTION GitException * GIT_CLONE_EXCEPTION @@ -69,6 +70,8 @@ NotSupportedException * UNSUPPORTED_COMPONENT_TYPE * NOT_SUPPORTED_EXCEPTION * UNSUPPORTED_PROJECT_TYPE + * UNSUPPORTED_REMOTE_SOURCE_TYPE + * UNSUPPORTED_PACKAGE RuntimeException RUNTIME diff --git a/src/ncc/Classes/ComposerExtension/ComposerSourceBuiltin.php b/src/ncc/Classes/ComposerExtension/ComposerSourceBuiltin.php index 9dc7e60..1dbabd8 100644 --- a/src/ncc/Classes/ComposerExtension/ComposerSourceBuiltin.php +++ b/src/ncc/Classes/ComposerExtension/ComposerSourceBuiltin.php @@ -33,17 +33,14 @@ use ncc\Enums\Scopes; use ncc\CLI\Main; use ncc\Exceptions\BuildException; - use ncc\Exceptions\ComposerDisabledException; use ncc\Exceptions\ComposerException; - use ncc\Exceptions\ComposerNotAvailableException; use ncc\Exceptions\ConfigurationException; use ncc\Exceptions\NotSupportedException; + use ncc\Exceptions\PackageException; use ncc\Exceptions\PathNotFoundException; - use ncc\Exceptions\InternalComposerNotAvailableException; use ncc\Exceptions\IOException; use ncc\Exceptions\MalformedJsonException; use ncc\Exceptions\PackageNotFoundException; - use ncc\Exceptions\PackagePreparationFailedException; use ncc\Exceptions\RuntimeException; use ncc\Exceptions\UserAbortedOperationException; use ncc\Interfaces\ServiceSourceInterface; @@ -79,16 +76,13 @@ * @param RemotePackageInput $packageInput * @return string * @throws BuildException - * @throws ComposerDisabledException * @throws ComposerException - * @throws ComposerNotAvailableException * @throws ConfigurationException * @throws IOException - * @throws InternalComposerNotAvailableException * @throws MalformedJsonException * @throws NotSupportedException + * @throws PackageException * @throws PackageNotFoundException - * @throws PackagePreparationFailedException * @throws PathNotFoundException * @throws RuntimeException * @throws UserAbortedOperationException @@ -118,16 +112,13 @@ * @param string $path * @return string * @throws BuildException - * @throws ComposerDisabledException * @throws ComposerException - * @throws ComposerNotAvailableException * @throws ConfigurationException * @throws IOException - * @throws InternalComposerNotAvailableException * @throws MalformedJsonException * @throws NotSupportedException + * @throws PackageException * @throws PackageNotFoundException - * @throws PackagePreparationFailedException * @throws PathNotFoundException * @throws UserAbortedOperationException */ @@ -196,8 +187,8 @@ * @throws IOException * @throws MalformedJsonException * @throws NotSupportedException + * @throws PackageException * @throws PackageNotFoundException - * @throws PackagePreparationFailedException * @throws PathNotFoundException */ private static function compilePackages(string $composer_lock_path): array @@ -519,11 +510,8 @@ * @param string $package * @param string|null $version * @return string - * @throws ComposerDisabledException * @throws ComposerException - * @throws ComposerNotAvailableException * @throws IOException - * @throws InternalComposerNotAvailableException * @throws PathNotFoundException * @throws UserAbortedOperationException */ @@ -592,9 +580,7 @@ * Attempts to find the composer path to use that is currently configured * * @return string - * @throws ComposerDisabledException - * @throws ComposerNotAvailableException - * @throws InternalComposerNotAvailableException + * @throws ComposerException */ private static function getComposerPath(): string { @@ -604,7 +590,7 @@ $internal_composer_enabled = Functions::getConfigurationProperty('composer.enable_internal_composer'); if ($composer_enabled !== null && $composer_enabled === false) { - throw new ComposerDisabledException('Composer is disabled by the configuration `composer.enabled`'); + throw new ComposerException('Composer is disabled by the configuration `composer.enabled`'); } $config_property = Functions::getConfigurationProperty('composer.executable_path'); @@ -617,7 +603,7 @@ { if (!file_exists(NCC_EXEC_LOCATION . DIRECTORY_SEPARATOR . 'composer.phar')) { - throw new InternalComposerNotAvailableException(NCC_EXEC_LOCATION . DIRECTORY_SEPARATOR . 'composer.phar'); + throw new ComposerException(NCC_EXEC_LOCATION . DIRECTORY_SEPARATOR . 'composer.phar'); } Console::outDebug(sprintf('using composer path from NCC_EXEC_LOCATION: %s', NCC_EXEC_LOCATION . DIRECTORY_SEPARATOR . 'composer.phar')); @@ -637,7 +623,7 @@ } } - throw new ComposerNotAvailableException('No composer executable path is configured'); + throw new ComposerException('No composer executable path is configured'); } /** @@ -683,7 +669,7 @@ * @return ProjectConfiguration * @throws IOException * @throws MalformedJsonException - * @throws PackagePreparationFailedException + * @throws PackageException * @throws PathNotFoundException */ private static function convertProject(string $package_path, array $version_map, ?ComposerJson $composer_package=null): ProjectConfiguration @@ -756,7 +742,7 @@ } catch (Exception $e) { - throw new PackagePreparationFailedException('Cannot unset flag \'FOLLOW_SYMLINKS\' in DirectoryScanner, ' . $e->getMessage(), $e); + throw new PackageException('Cannot unset flag \'FOLLOW_SYMLINKS\' in DirectoryScanner, ' . $e->getMessage(), $e); } // Include file components that can be compiled diff --git a/src/ncc/Classes/GithubExtension/GithubService.php b/src/ncc/Classes/GithubExtension/GithubService.php index 0e01bfe..972e0ba 100644 --- a/src/ncc/Classes/GithubExtension/GithubService.php +++ b/src/ncc/Classes/GithubExtension/GithubService.php @@ -27,8 +27,8 @@ use ncc\Classes\HttpClient; use ncc\Exceptions\AuthenticationException; use ncc\Exceptions\GitException; - use ncc\Exceptions\HttpException; use ncc\Exceptions\MalformedJsonException; + use ncc\Exceptions\NetworkException; use ncc\Exceptions\VersionNotFoundException; use ncc\Interfaces\RepositorySourceInterface; use ncc\Objects\DefinedRemoteSource; @@ -50,8 +50,8 @@ * @return RepositoryQueryResults * @throws AuthenticationException * @throws GitException - * @throws HttpException * @throws MalformedJsonException + * @throws NetworkException */ public static function getGitRepository(RemotePackageInput $packageInput, DefinedRemoteSource $definedRemoteSource, ?Entry $entry = null): RepositoryQueryResults { @@ -82,8 +82,8 @@ * @return RepositoryQueryResults * @throws AuthenticationException * @throws GitException - * @throws HttpException * @throws MalformedJsonException + * @throws NetworkException * @throws VersionNotFoundException */ public static function getRelease(RemotePackageInput $package_input, DefinedRemoteSource $defined_remote_source, ?Entry $entry = null): RepositoryQueryResults @@ -98,8 +98,8 @@ * @return RepositoryQueryResults * @throws AuthenticationException * @throws GitException - * @throws HttpException * @throws MalformedJsonException + * @throws NetworkException * @throws VersionNotFoundException */ public static function getNccPackage(RemotePackageInput $packageInput, DefinedRemoteSource $definedRemoteSource, ?Entry $entry = null): RepositoryQueryResults @@ -116,8 +116,8 @@ * @return array * @throws AuthenticationException * @throws GitException - * @throws HttpException * @throws MalformedJsonException + * @throws NetworkException */ private static function getReleases(RemotePackageInput $packageInput, DefinedRemoteSource $definedRemoteSource, ?Entry $entry = null): array { @@ -188,8 +188,8 @@ * @return array * @throws AuthenticationException * @throws GitException - * @throws HttpException * @throws MalformedJsonException + * @throws NetworkException */ private static function getJsonResponse(HttpRequest $httpRequest, ?Entry $entry): array { @@ -215,8 +215,8 @@ * @return mixed * @throws AuthenticationException * @throws GitException - * @throws HttpException * @throws MalformedJsonException + * @throws NetworkException * @throws VersionNotFoundException */ private static function processReleases(RemotePackageInput $packageInput, DefinedRemoteSource $definedRemoteSource, ?Entry $entry): mixed diff --git a/src/ncc/Classes/GitlabExtension/GitlabService.php b/src/ncc/Classes/GitlabExtension/GitlabService.php index 9aee83d..7f50908 100644 --- a/src/ncc/Classes/GitlabExtension/GitlabService.php +++ b/src/ncc/Classes/GitlabExtension/GitlabService.php @@ -26,8 +26,8 @@ use ncc\Classes\HttpClient; use ncc\Exceptions\AuthenticationException; use ncc\Exceptions\GitException; - use ncc\Exceptions\HttpException; use ncc\Exceptions\MalformedJsonException; + use ncc\Exceptions\NetworkException; use ncc\Exceptions\NotSupportedException; use ncc\Exceptions\ResourceNotFoundException; use ncc\Interfaces\RepositorySourceInterface; @@ -51,8 +51,8 @@ * @return RepositoryQueryResults * @throws AuthenticationException * @throws GitException - * @throws HttpException * @throws MalformedJsonException + * @throws NetworkException */ public static function getGitRepository(RemotePackageInput $packageInput, DefinedRemoteSource $definedRemoteSource, ?Entry $entry=null): RepositoryQueryResults { @@ -93,8 +93,8 @@ * @return RepositoryQueryResults * @throws AuthenticationException * @throws GitException - * @throws HttpException * @throws MalformedJsonException + * @throws NetworkException * @throws ResourceNotFoundException */ public static function getRelease(RemotePackageInput $package_input, DefinedRemoteSource $defined_remote_source, ?Entry $entry = null): RepositoryQueryResults @@ -186,8 +186,8 @@ * @return array * @throws AuthenticationException * @throws GitException - * @throws HttpException * @throws MalformedJsonException + * @throws NetworkException */ private static function getReleases(string $owner, string $repository, DefinedRemoteSource $definedRemoteSource, ?Entry $entry): array { diff --git a/src/ncc/Classes/HttpClient.php b/src/ncc/Classes/HttpClient.php index bffef0a..9f33de1 100644 --- a/src/ncc/Classes/HttpClient.php +++ b/src/ncc/Classes/HttpClient.php @@ -26,7 +26,7 @@ namespace ncc\Classes; use ncc\Enums\HttpRequestType; use ncc\Enums\LogLevel; use ncc\CLI\Main; - use ncc\Exceptions\HttpException; + use ncc\Exceptions\NetworkException; use ncc\Objects\HttpRequest; use ncc\Objects\HttpResponse; use ncc\Objects\HttpResponseCache; @@ -123,7 +123,7 @@ namespace ncc\Classes; * @param HttpRequest $httpRequest * @param bool $cache * @return HttpResponse - * @throws HttpException + * @throws NetworkException */ public static function request(HttpRequest $httpRequest, bool $cache=false): HttpResponse { @@ -158,7 +158,7 @@ namespace ncc\Classes; { $error = curl_error($curl); curl_close($curl); - throw new HttpException($error); + throw new NetworkException($error); } $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); @@ -193,7 +193,7 @@ namespace ncc\Classes; * @param HttpRequest $httpRequest * @param string $path * @return void - * @throws HttpException + * @throws NetworkException */ public static function download(HttpRequest $httpRequest, string $path): void { @@ -208,7 +208,7 @@ namespace ncc\Classes; { $error = curl_error($curl); curl_close($curl); - throw new HttpException($error); + throw new NetworkException($error); } curl_close($curl); diff --git a/src/ncc/Classes/PhpExtension/PhpCompiler.php b/src/ncc/Classes/PhpExtension/PhpCompiler.php index 5e6a0da..a735979 100644 --- a/src/ncc/Classes/PhpExtension/PhpCompiler.php +++ b/src/ncc/Classes/PhpExtension/PhpCompiler.php @@ -35,8 +35,8 @@ use ncc\Exceptions\BuildException; use ncc\Exceptions\ConfigurationException; use ncc\Exceptions\IOException; + use ncc\Exceptions\PackageException; use ncc\Exceptions\PackageLockException; - use ncc\Exceptions\PackagePreparationFailedException; use ncc\Exceptions\PathNotFoundException; use ncc\Exceptions\RunnerExecutionException; use ncc\Exceptions\VersionNotFoundException; @@ -86,8 +86,8 @@ * * @param string $build_configuration * @return void - * @throws PackagePreparationFailedException * @throws ConfigurationException + * @throws PackageException */ public function prepare(string $build_configuration=BuildConfigurationValues::DEFAULT): void { @@ -98,7 +98,7 @@ } catch (Exception $e) { - throw new PackagePreparationFailedException($e->getMessage(), $e); + throw new PackageException($e->getMessage(), $e); } // Select the build configuration @@ -146,7 +146,7 @@ } catch (Exception $e) { - throw new PackagePreparationFailedException('Cannot unset flag \'FOLLOW_SYMLINKS\' in DirectoryScanner, ' . $e->getMessage(), $e); + throw new PackageException('Cannot unset flag \'FOLLOW_SYMLINKS\' in DirectoryScanner, ' . $e->getMessage(), $e); } // Include file components that can be compiled @@ -190,7 +190,7 @@ Console::outVerbose('No components found'); } - // Clear previous excludes and includes + // Clear previously excludes and includes $DirectoryScanner->setExcludes(); $DirectoryScanner->setIncludes(); @@ -296,11 +296,11 @@ } catch (VersionNotFoundException $e) { - throw new PackagePreparationFailedException('Static linking not possible, cannot find version ' . $dependency->Version . ' for dependency ' . $dependency->Name, $e); + throw new PackageException('Static linking not possible, cannot find version ' . $dependency->Version . ' for dependency ' . $dependency->Name, $e); } catch (PackageLockException $e) { - throw new PackagePreparationFailedException('Static linking not possible, cannot find package lock for dependency ' . $dependency->Name, $e); + throw new PackageException('Static linking not possible, cannot find package lock for dependency ' . $dependency->Name, $e); } break; diff --git a/src/ncc/Enums/ExceptionCodes.php b/src/ncc/Enums/ExceptionCodes.php index 6a792cd..f7d1b45 100644 --- a/src/ncc/Enums/ExceptionCodes.php +++ b/src/ncc/Enums/ExceptionCodes.php @@ -63,21 +63,11 @@ */ public const INVALID_CONSTANT_NAME = -1719; - /** - * @see PackagePreparationFailedException - */ - public const PACKAGE_PREPARATION_FAILED = -1720; - /** * @see BuildException */ public const BUILD_EXCEPTION = -1727; - /** - * @see PackageParsingException - */ - public const PACKAGE_PARSING_EXCEPTION = -1728; - /** * @see PackageLockException */ @@ -113,31 +103,11 @@ */ public const NO_AVAILABLE_UNITS = -1742; - /** - * @see PackageAlreadyInstalledException - */ - public const PACKAGE_ALREADY_INSTALLED = -1744; - /** * @see PackageNotFoundException */ public const PACKAGE_NOT_FOUND = -1745; - /** - * @see ComposerDisabledException - */ - public const COMPOSER_DISABLED_EXCEPTION = -1746; - - /** - * @see InternalComposerNotAvailableException - */ - public const INTERNAL_COMPOSER_NOT_AVAILABLE = -1747; - - /** - * @see ComposerNotAvailableException - */ - public const COMPOSER_NOT_AVAILABLE = -1748; - /** * @see ComposerException */ @@ -148,16 +118,6 @@ */ public const USER_ABORTED_OPERATION = -1750; - /** - * @see MissingDependencyException - */ - public const MISSING_DEPENDENCY = -1751; - - /** - * @see HttpException - */ - public const HTTP_EXCEPTION = -1752; - /** * @see ImportException */ @@ -178,11 +138,6 @@ */ public const ARCHIVE_EXCEPTION = -1764; - /** - * @see PackageFetchException - */ - public const PACKAGE_FETCH_EXCEPTION = -1765; - /** * @see SymlinkException */ @@ -203,6 +158,16 @@ */ public const CONFIGURATION_EXCEPTION = -1772; + /** + * @see PackageException + */ + public const PACKAGE_EXCEPTION = -1773; + + /** + * @see NetworkException + */ + public const NETWORK_EXCEPTION = -1774; + /** * All the exception codes from NCC */ @@ -214,9 +179,7 @@ self::AUTOLOAD_GENERATOR, self::NO_UNITS_FOUND, self::INVALID_CONSTANT_NAME, - self::PACKAGE_PREPARATION_FAILED, self::BUILD_EXCEPTION, - self::PACKAGE_PARSING_EXCEPTION, self::PACKAGE_LOCK_EXCEPTION, self::INSTALLATION_EXCEPTION, self::COMPONENT_DECODE_EXCEPTION, @@ -224,22 +187,17 @@ self::VERSION_NOT_FOUND, self::RUNNER_EXECUTION_EXCEPTION, self::NO_AVAILABLE_UNITS, - self::PACKAGE_ALREADY_INSTALLED, self::PACKAGE_NOT_FOUND, - self::COMPOSER_DISABLED_EXCEPTION, - self::INTERNAL_COMPOSER_NOT_AVAILABLE, - self::COMPOSER_NOT_AVAILABLE, self::COMPOSER_EXCEPTION, self::USER_ABORTED_OPERATION, - self::MISSING_DEPENDENCY, - self::HTTP_EXCEPTION, self::AUTHENTICATION_EXCEPTION, self::NOT_SUPPORTED_EXCEPTION, self::ARCHIVE_EXCEPTION, - self::PACKAGE_FETCH_EXCEPTION, self::SYMLINK_EXCEPTION, self::PATH_NOT_FOUND, self::GIT_EXCEPTION, - self::CONFIGURATION_EXCEPTION + self::CONFIGURATION_EXCEPTION, + self::PACKAGE_EXCEPTION, + self::NETWORK_EXCEPTION ]; } \ No newline at end of file diff --git a/src/ncc/Exceptions/ComposerDisabledException.php b/src/ncc/Exceptions/ComposerDisabledException.php deleted file mode 100644 index 38ca7d7..0000000 --- a/src/ncc/Exceptions/ComposerDisabledException.php +++ /dev/null @@ -1,39 +0,0 @@ -assembly->package . '=' . $package->assembly->version . ' is already installed'); + throw new PackageException('The package ' . $package->assembly->package . '=' . $package->assembly->version . ' is already installed'); } } @@ -458,7 +454,7 @@ * @return string * @throws InstallationException * @throws NotSupportedException - * @throws PackageFetchException + * @throws PackageException */ public function fetchFromSource(string $source, ?Entry $entry=null): string { @@ -466,12 +462,12 @@ if($input->source === null) { - throw new PackageFetchException('No source specified'); + throw new PackageException('No source specified'); } if($input->package === null) { - throw new PackageFetchException('No package specified'); + throw new PackageException('No package specified'); } if($input->version === null) @@ -494,7 +490,7 @@ } catch (Exception $e) { - throw new PackageFetchException('Cannot fetch package from composer source, ' . $e->getMessage(), $e); + throw new PackageException('Cannot fetch package from composer source, ' . $e->getMessage(), $e); } } @@ -592,7 +588,7 @@ { if($exception === null) { - $exception = new PackageFetchException($e->getMessage(), $e); + $exception = new PackageException($e->getMessage(), $e); } else { @@ -601,19 +597,19 @@ continue; } - $exception = new PackageFetchException($e->getMessage(), $exception); + $exception = new PackageException($e->getMessage(), $exception); } } } else { - $exception = new PackageFetchException('Cannot fetch package from remote source, no assets found'); + $exception = new PackageException('Cannot fetch package from remote source, no assets found'); } throw $exception; } - throw new PackageFetchException(sprintf('Unknown remote source type %s', $remote_source_type)); + throw new PackageException(sprintf('Unknown remote source type %s', $remote_source_type)); } /** @@ -647,14 +643,13 @@ * @param Entry|null $entry * @param array $options * @return void + * @throws AuthenticationException * @throws IOException * @throws InstallationException - * @throws MissingDependencyException * @throws NotSupportedException - * @throws PackageAlreadyInstalledException + * @throws PackageException * @throws PackageLockException * @throws PackageNotFoundException - * @throws PackageParsingException * @throws PathNotFoundException * @throws RunnerExecutionException * @throws SymlinkException @@ -887,6 +882,7 @@ * @param string $package * @param string $version * @return void + * @throws AuthenticationException * @throws IOException * @throws PackageLockException * @throws PackageNotFoundException @@ -966,6 +962,7 @@ * * @param string $package * @return void + * @throws AuthenticationException * @throws PackageLockException * @throws PackageNotFoundException * @throws VersionNotFoundException diff --git a/src/ncc/Objects/Package.php b/src/ncc/Objects/Package.php index 9985ce5..df7fb07 100644 --- a/src/ncc/Objects/Package.php +++ b/src/ncc/Objects/Package.php @@ -1,24 +1,24 @@ getMessage(), $e); + throw new PackageException(sprintf("The package '%s' does not appear to be a valid NCC Package (Invalid Package Contents)", $path), $e); } $package->magic_bytes = $magic_bytes; diff --git a/src/ncc/Utilities/Functions.php b/src/ncc/Utilities/Functions.php index 808f07a..5f65a65 100644 --- a/src/ncc/Utilities/Functions.php +++ b/src/ncc/Utilities/Functions.php @@ -41,9 +41,9 @@ use ncc\Classes\PythonExtension\PythonRunner; use ncc\Exceptions\ArchiveException; use ncc\Exceptions\AuthenticationException; - use ncc\Exceptions\HttpException; use ncc\Exceptions\IOException; use ncc\Exceptions\MalformedJsonException; + use ncc\Exceptions\NetworkException; use ncc\Exceptions\PathNotFoundException; use ncc\Exceptions\RunnerExecutionException; use ncc\Managers\ConfigurationManager; @@ -352,7 +352,7 @@ * Initializes NCC files * * @return void - * @noinspection PhpRedundantOptionalArgumentInspection + * @throws AuthenticationException */ public static function initializeFiles(): void { @@ -599,7 +599,7 @@ * @param Entry|null $entry * @return string * @throws AuthenticationException - * @throws HttpException + * @throws NetworkException */ public static function downloadGitServiceFile(string $url, ?Entry $entry=null): string {