From 91eb808664acee4adb7b10301b411cbc6048ec51 Mon Sep 17 00:00:00 2001 From: Zi Xing Date: Sat, 16 Apr 2022 18:07:58 -0400 Subject: [PATCH] Added FileNotFoundException --- src/ncc/Abstracts/ExceptionCodes.php | 6 ++++++ src/ncc/Exceptions/FileNotFoundException.php | 20 +++++++++++++++++++ src/ncc/Objects/ProjectConfiguration.php | 4 +++- tests/autoload.php | 1 + .../load_configuration.php | 1 + .../project_configuration}/project.json | 0 6 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/ncc/Exceptions/FileNotFoundException.php create mode 100644 tests/autoload.php create mode 100644 tests/project_configuration/load_configuration.php rename {templates => tests/project_configuration}/project.json (100%) diff --git a/src/ncc/Abstracts/ExceptionCodes.php b/src/ncc/Abstracts/ExceptionCodes.php index 4cff00c..11af090 100644 --- a/src/ncc/Abstracts/ExceptionCodes.php +++ b/src/ncc/Abstracts/ExceptionCodes.php @@ -2,6 +2,7 @@ namespace ncc\Abstracts; + use ncc\Exceptions\FileNotFoundException; use ncc\Exceptions\InvalidProjectConfigurationException; abstract class ExceptionCodes @@ -10,4 +11,9 @@ * @see InvalidProjectConfigurationException */ const InvalidProjectConfigurationException = -1700; + + /** + * @see FileNotFoundException; + */ + const FileNotFoundException = -1701; } \ No newline at end of file diff --git a/src/ncc/Exceptions/FileNotFoundException.php b/src/ncc/Exceptions/FileNotFoundException.php new file mode 100644 index 0000000..167d5d0 --- /dev/null +++ b/src/ncc/Exceptions/FileNotFoundException.php @@ -0,0 +1,20 @@ +code = ExceptionCodes::FileNotFoundException; + } + } \ No newline at end of file diff --git a/src/ncc/Objects/ProjectConfiguration.php b/src/ncc/Objects/ProjectConfiguration.php index 3f80114..23dcfb8 100644 --- a/src/ncc/Objects/ProjectConfiguration.php +++ b/src/ncc/Objects/ProjectConfiguration.php @@ -81,7 +81,9 @@ { $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; } diff --git a/tests/autoload.php b/tests/autoload.php new file mode 100644 index 0000000..b3d9bbc --- /dev/null +++ b/tests/autoload.php @@ -0,0 +1 @@ +