From 1263a0bcabd285283f2fb6275fade90b733db79b Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 18 Feb 2016 17:09:27 +0200 Subject: [PATCH] Always use the same Blueprint class --- system/src/Grav/Common/Config/CompiledBase.php | 7 ++++++- system/src/Grav/Common/Config/CompiledBlueprints.php | 9 +++++++-- system/src/Grav/Common/Data/Blueprint.php | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/system/src/Grav/Common/Config/CompiledBase.php b/system/src/Grav/Common/Config/CompiledBase.php index 9f51d7d26..833b4da7a 100644 --- a/system/src/Grav/Common/Config/CompiledBase.php +++ b/system/src/Grav/Common/Config/CompiledBase.php @@ -226,7 +226,7 @@ abstract class CompiledBase 'timestamp' => time(), 'checksum' => $this->checksum(), 'files' => $this->files, - 'data' => $this->object->toArray() + 'data' => $this->getState() ]; $file->save($cache); @@ -235,4 +235,9 @@ abstract class CompiledBase $this->modified(); } + + protected function getState() + { + return $this->object->toArray(); + } } diff --git a/system/src/Grav/Common/Config/CompiledBlueprints.php b/system/src/Grav/Common/Config/CompiledBlueprints.php index 9eac0fb68..ab176ac56 100644 --- a/system/src/Grav/Common/Config/CompiledBlueprints.php +++ b/system/src/Grav/Common/Config/CompiledBlueprints.php @@ -1,9 +1,9 @@ object = (new Blueprints($data))->setTypes($this->getTypes()); + $this->object = (new Blueprint($data))->setTypes($this->getTypes()); } /** @@ -183,4 +183,9 @@ class CompiledBlueprints extends CompiledBase return true; } + + protected function getState() + { + return $this->object->getState(); + } } diff --git a/system/src/Grav/Common/Data/Blueprint.php b/system/src/Grav/Common/Data/Blueprint.php index 74075743c..3766644e2 100644 --- a/system/src/Grav/Common/Data/Blueprint.php +++ b/system/src/Grav/Common/Data/Blueprint.php @@ -26,7 +26,7 @@ class Blueprint extends BaseBlueprints implements ExportInterface * @param array $data * @param Blueprints $context */ - public function __construct($name = null, array $data = [], Blueprints $context = null) + public function __construct($name = null, array $data = null, Blueprints $context = null) { parent::__construct(is_array($name) ? $name : null);