Added optional UpdateSource to \ncc\Objects\Package > Header

https://git.n64.cc/nosial/ncc/-/issues/34
This commit is contained in:
Netkas 2022-12-15 15:23:06 -05:00
parent 57cf2dbca3
commit 8e8c1dca58

View file

@ -5,6 +5,7 @@
namespace ncc\Objects\Package;
use ncc\Objects\ProjectConfiguration\Compiler;
use ncc\Objects\ProjectConfiguration\UpdateSource;
use ncc\Utilities\Functions;
class Header
@ -37,6 +38,13 @@
*/
public $Options;
/**
* The optional update source to where the package can be updated from
*
* @var $UpdateSource|null
*/
public $UpdateSource;
/**
* Public Constructor
*/
@ -59,6 +67,7 @@
($bytecode ? Functions::cbc('compiler_extension') : 'compiler_extension') => $this->CompilerExtension->toArray($bytecode),
($bytecode ? Functions::cbc('runtime_constants') : 'runtime_constants') => $this->RuntimeConstants,
($bytecode ? Functions::cbc('compiler_version') : 'compiler_version') => $this->CompilerVersion,
($bytecode ? Functions::cbc('update_source') : 'update_source') => $this->UpdateSource->toArray($bytecode),
($bytecode ? Functions::cbc('options') : 'options') => $this->Options,
];
}
@ -76,10 +85,13 @@
$object->CompilerExtension = Functions::array_bc($data, 'compiler_extension');
$object->RuntimeConstants = Functions::array_bc($data, 'runtime_constants');
$object->CompilerVersion = Functions::array_bc($data, 'compiler_version');
$object->UpdateSource = Functions::array_bc($data, 'update_source');
$object->Options = Functions::array_bc($data, 'options');
if($object->CompilerExtension !== null)
$object->CompilerExtension = Compiler::fromArray($object->CompilerExtension);
if($object->UpdateSource !== null)
$object->UpdateSource = UpdateSource::fromArray($object->UpdateSource);
return $object;
}