mirror of
https://github.com/getgrav/grav.git
synced 2025-02-20 19:56:53 +01:00
Always use the same Blueprint class
This commit is contained in:
parent
931d08b46d
commit
1263a0bcab
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user