Always use the same Blueprint class

This commit is contained in:
Matias Griese 2016-02-18 17:09:27 +02:00
parent 931d08b46d
commit 1263a0bcab
3 changed files with 14 additions and 4 deletions

View File

@ -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();
}
}

View File

@ -1,9 +1,9 @@
<?php
namespace Grav\Common\Config;
use Grav\Common\Data\Blueprint;
use Grav\Common\File\CompiledYamlFile;
use Grav\Common\Grav;
use RocketTheme\Toolbox\Blueprints\Blueprints;
use RocketTheme\Toolbox\ResourceLocator\UniformResourceLocator;
/**
@ -44,7 +44,7 @@ class CompiledBlueprints extends CompiledBase
*/
protected function createObject(array $data = [])
{
$this->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();
}
}

View File

@ -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);