- Removed unused exception UnsupportedComponentTypeException in \ncc\Exceptions in favor of NotSupportedException

- Removed unused exception `UnsupportedPackageException` in `\ncc\Exceptions` (not used)
 - Removed unused exception `UnsupportedRemoteTypeSource` in `\ncc\Exceptions` (not used)
 - Removed unused exception `UnsupportedProjectTypeException` in `\ncc\Exceptions` (not used)
This commit is contained in:
Netkas 2023-08-20 21:20:13 -04:00
parent 14541123c0
commit c151d29b46
No known key found for this signature in database
GPG key ID: 5DAF58535614062B
11 changed files with 11 additions and 225 deletions

View file

@ -126,6 +126,10 @@ features.
- Removed unused exception `NotImplementedException` in `\ncc\Exceptions` in favor of `NotSupportedException`
- Removed unused exception `UnsupportedCompilerExtensionException` in `\ncc\Exceptions` in favor of `NotSupportedException`
- Removed unused exception `UnsupportedExtensionVersionException` in `\ncc\Exceptions` (not used)
- Removed unused exception `UnsupportedComponentTypeException` in `\ncc\Exceptions` in favor of `NotSupportedException`
- Removed unused exception `UnsupportedPackageException` in `\ncc\Exceptions` (not used)
- Removed unused exception `UnsupportedRemoteTypeSource` in `\ncc\Exceptions` (not used)
- Removed unused exception `UnsupportedProjectTypeException` in `\ncc\Exceptions` (not used)

View file

@ -66,9 +66,9 @@ NotSupportedException
* NOT_IMPLEMENTED
* UNSUPPORTED_COMPILER_EXTENSION
* UNSUPPORTED_EXTENSION_VERSION
UNSUPPORTED_COMPONENT_TYPE
NOT_SUPPORTED_EXCEPTION
UNSUPPORTED_PROJECT_TYPE
* UNSUPPORTED_COMPONENT_TYPE
* NOT_SUPPORTED_EXCEPTION
* UNSUPPORTED_PROJECT_TYPE
RuntimeException
RUNTIME

View file

@ -40,7 +40,6 @@
use ncc\Exceptions\PathNotFoundException;
use ncc\Exceptions\ProjectConfigurationNotFoundException;
use ncc\Exceptions\RunnerExecutionException;
use ncc\Exceptions\UnsupportedProjectTypeException;
use ncc\Interfaces\CompilerInterface;
use ncc\Managers\ProjectManager;
use ncc\ncc;
@ -133,7 +132,7 @@
}
else
{
throw new UnsupportedProjectTypeException('The project type \'' . $project_type->ProjectType . '\' is not supported');
throw new NotSupportedException(sprintf('Failed to compile %s, project type %s is not supported', $project_type->ProjectPath, $project_type->ProjectType));
}
if($version !== null)

View file

@ -33,9 +33,9 @@
use ncc\Exceptions\ComponentChecksumException;
use ncc\Exceptions\ComponentDecodeException;
use ncc\Exceptions\IOException;
use ncc\Exceptions\NotSupportedException;
use ncc\Exceptions\PathNotFoundException;
use ncc\Exceptions\ResourceChecksumException;
use ncc\Exceptions\UnsupportedComponentTypeException;
use ncc\Interfaces\InstallerInterface;
use ncc\Objects\InstallationPaths;
use ncc\Objects\Package;
@ -78,7 +78,7 @@
* @return string|null
* @throws ComponentChecksumException
* @throws ComponentDecodeException
* @throws UnsupportedComponentTypeException
* @throws NotSupportedException
*/
public function processComponent(Package\Component $component): ?string
{
@ -113,7 +113,7 @@
return $component->data;
default:
throw new UnsupportedComponentTypeException('Unsupported component type \'' . $component->data_types . '\'');
throw new NotSupportedException(sprintf('Component data type %s is not supported.', $component->data_types));
}
}
@ -294,7 +294,6 @@
* @param string $src
* @param string $output
* @return string
* @throws AccessDeniedException
* @throws CollectorException
* @throws IOException
* @throws PathNotFoundException

View file

@ -153,11 +153,6 @@
*/
public const INSTALLATION_EXCEPTION = -1730;
/**
* @see UnsupportedComponentTypeException
*/
public const UNSUPPORTED_COMPONENT_TYPE = -1731;
/**
* @see ComponentDecodeException
*/
@ -253,11 +248,6 @@
*/
public const HTTP_EXCEPTION = -1752;
/**
* @see UnsupportedRemoteSourceTypeException
*/
public const UNSUPPORTED_REMOTE_SOURCE_TYPE = -1753;
/**
* @see ImportException
*/
@ -273,11 +263,6 @@
*/
public const NOT_SUPPORTED_EXCEPTION = -1761;
/**
* @see UnsupportedProjectTypeException
*/
public const UNSUPPORTED_PROJECT_TYPE = -1762;
/**
* @see ArchiveException
*/
@ -347,7 +332,6 @@
self::PACKAGE_PARSING_EXCEPTION,
self::PACKAGE_LOCK_EXCEPTION,
self::INSTALLATION_EXCEPTION,
self::UNSUPPORTED_COMPONENT_TYPE,
self::COMPONENT_DECODE_EXCEPTION,
self::RESOURCE_CHECKSUM_EXCEPTION,
self::IO_EXCEPTION,
@ -366,10 +350,8 @@
self::USER_ABORTED_OPERATION,
self::MISSING_DEPENDENCY,
self::HTTP_EXCEPTION,
self::UNSUPPORTED_REMOTE_SOURCE_TYPE,
self::AUTHENTICATION_EXCEPTION,
self::NOT_SUPPORTED_EXCEPTION,
self::UNSUPPORTED_PROJECT_TYPE,
self::ARCHIVE_EXCEPTION,
self::PACKAGE_FETCH_EXCEPTION,
self::INVALID_BUILD_CONFIGURATION,

View file

@ -1,39 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Exceptions;
use Exception;
use ncc\Enums\ExceptionCodes;
use Throwable;
class UnsupportedComponentTypeException extends Exception
{
/**
* @param string $message
* @param Throwable|null $previous
*/
public function __construct(string $message = "", ?Throwable $previous = null)
{
parent::__construct($message, ExceptionCodes::UNSUPPORTED_COMPONENT_TYPE, $previous);
}
}

View file

@ -1,39 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Exceptions;
use Exception;
use ncc\Enums\ExceptionCodes;
use Throwable;
class UnsupportedExtensionVersionException extends Exception
{
/**
* @param string $message
* @param Throwable|null $previous
*/
public function __construct(string $message = "", ?Throwable $previous = null)
{
parent::__construct($message, ExceptionCodes::UNSUPPORTED_EXTENSION_VERSION, $previous);
}
}

View file

@ -1,39 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Exceptions;
use Exception;
use ncc\Enums\ExceptionCodes;
use Throwable;
class UnsupportedPackageException extends Exception
{
/**
* @param string $message
* @param Throwable|null $previous
*/
public function __construct(string $message = "", ?Throwable $previous = null)
{
parent::__construct($message, ExceptionCodes::UNSUPPORTED_PACKAGE, $previous);
}
}

View file

@ -1,40 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Exceptions;
use Exception;
use ncc\Enums\ExceptionCodes;
use Throwable;
class UnsupportedProjectTypeException extends Exception
{
/**
* @param string $message
* @param Throwable|null $previous
*/
public function __construct(string $message = "", ?Throwable $previous = null)
{
parent::__construct($message, ExceptionCodes::UNSUPPORTED_PROJECT_TYPE, $previous);
}
}

View file

@ -1,39 +0,0 @@
<?php
/*
* Copyright (c) Nosial 2022-2023, all rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
* associated documentation files (the "Software"), to deal in the Software without restriction, including without
* limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so, subject to the following
* conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions
* of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*
*/
namespace ncc\Exceptions;
use Exception;
use ncc\Enums\ExceptionCodes;
use Throwable;
class UnsupportedRemoteSourceTypeException extends Exception
{
/**
* @param string $message
* @param Throwable|null $previous
*/
public function __construct(string $message = "", ?Throwable $previous = null)
{
parent::__construct($message, ExceptionCodes::UNSUPPORTED_REMOTE_SOURCE_TYPE, $previous);
}
}

View file

@ -25,7 +25,6 @@ namespace ncc\Interfaces;
use Exception;
use ncc\Exceptions\ComponentChecksumException;
use ncc\Exceptions\ComponentDecodeException;
use ncc\Exceptions\UnsupportedComponentTypeException;
use ncc\Objects\InstallationPaths;
use ncc\Objects\Package;
use ncc\Objects\Package\Component;
@ -46,7 +45,6 @@ namespace ncc\Interfaces;
* @return string|null
* @throws ComponentChecksumException
* @throws ComponentDecodeException
* @throws UnsupportedComponentTypeException
*/
public function processComponent(Package\Component $component): ?string;