Added FileNotFoundException
This commit is contained in:
parent
954cf0fd11
commit
91eb808664
6 changed files with 31 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
namespace ncc\Abstracts;
|
namespace ncc\Abstracts;
|
||||||
|
|
||||||
|
use ncc\Exceptions\FileNotFoundException;
|
||||||
use ncc\Exceptions\InvalidProjectConfigurationException;
|
use ncc\Exceptions\InvalidProjectConfigurationException;
|
||||||
|
|
||||||
abstract class ExceptionCodes
|
abstract class ExceptionCodes
|
||||||
|
@ -10,4 +11,9 @@
|
||||||
* @see InvalidProjectConfigurationException
|
* @see InvalidProjectConfigurationException
|
||||||
*/
|
*/
|
||||||
const InvalidProjectConfigurationException = -1700;
|
const InvalidProjectConfigurationException = -1700;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see FileNotFoundException;
|
||||||
|
*/
|
||||||
|
const FileNotFoundException = -1701;
|
||||||
}
|
}
|
20
src/ncc/Exceptions/FileNotFoundException.php
Normal file
20
src/ncc/Exceptions/FileNotFoundException.php
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace ncc\Exceptions;
|
||||||
|
|
||||||
|
use Exception;
|
||||||
|
use ncc\Abstracts\ExceptionCodes;
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
|
class FileNotFoundException extends Exception
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param string $path
|
||||||
|
* @param Throwable|null $previous
|
||||||
|
*/
|
||||||
|
public function __construct(string $path = "", ?Throwable $previous = null)
|
||||||
|
{
|
||||||
|
parent::__construct('The file \'' . realpath($path) . '\' was not found', ExceptionCodes::FileNotFoundException, $previous);
|
||||||
|
$this->code = ExceptionCodes::FileNotFoundException;
|
||||||
|
}
|
||||||
|
}
|
|
@ -81,7 +81,9 @@
|
||||||
{
|
{
|
||||||
$ProjectConfigurationObject = new ProjectConfiguration();
|
$ProjectConfigurationObject = new ProjectConfiguration();
|
||||||
|
|
||||||
$ProjectConfigurationObject->Assembly = Assembly::fromArray((Functions::array_bc($data, 'assembly') ?? []));
|
$ProjectConfigurationObject->Project = Functions::array_bc($data, 'project');
|
||||||
|
$ProjectConfigurationObject->Assembly = Functions::array_bc($data, 'assembly');
|
||||||
|
$ProjectConfigurationObject->Build = Functions::array_bc($data, 'build');
|
||||||
|
|
||||||
return $ProjectConfigurationObject;
|
return $ProjectConfigurationObject;
|
||||||
}
|
}
|
||||||
|
|
1
tests/autoload.php
Normal file
1
tests/autoload.php
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<?php
|
1
tests/project_configuration/load_configuration.php
Normal file
1
tests/project_configuration/load_configuration.php
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<?php
|
Loading…
Add table
Reference in a new issue