diff --git a/src/ncc/Objects/ProjectConfiguration/Dependency.php b/src/ncc/Objects/ProjectConfiguration/Dependency.php index bc41fee..20c80fb 100644 --- a/src/ncc/Objects/ProjectConfiguration/Dependency.php +++ b/src/ncc/Objects/ProjectConfiguration/Dependency.php @@ -1,8 +1,68 @@ Name; + + if($this->Source !== null && strlen($this->Source) > 0) + { + $ReturnResults[($bytecode ? \ncc\Utilities\Functions::cbc('source') : 'source')] = $this->Source; + } + + if($this->Version !== null && strlen($this->Version) > 0) + { + $ReturnResults[($bytecode ? \ncc\Utilities\Functions::cbc('version') : 'version')] = $this->Version; + } + + return $ReturnResults; + } + + /** + * Constructs the object from an array representation + * + * @param array $data + * @return Dependency + */ + public static function fromArray(array $data): Dependency + { + $DependencyObject = new Dependency(); + + $DependencyObject->Name = \ncc\Utilities\Functions::array_bc($data, 'name'); + $DependencyObject->Source = \ncc\Utilities\Functions::array_bc($data, 'source'); + $DependencyObject->Version = \ncc\Utilities\Functions::array_bc($data, 'version'); + + return $DependencyObject; + } + } \ No newline at end of file