for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Lichtenwallner (https://lichtenwallner.at)
*
* @see https://github.com/jolicht/markdown-cms for the canonical source repository
* @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
* @copyright Copyright (c) Johannes Lichtenwallner
*/
declare(strict_types = 1);
namespace Jolicht\MarkdownCms\Parser\Observer;
use Zend\Config\Writer\PhpArray;
class SaveContentConfigObserver implements ParsedContentObserverInterface
{
* Config writer
* @var PhpArray
private $configWriter;
* Target path
* @var string
private $targetPath;
public function __construct(PhpArray $configWriter,string $targetPath)
$this->configWriter = $configWriter;
$this->targetPath = $targetPath;
}
* Save Content
* {@inheritDoc}
* @see \Jolicht\MarkdownCms\Parser\Observer\ParsedContentObserverInterface::__invoke()
public function __invoke(array $config)
$this->getConfigWriter()->toFile($this->getTargetPath(), $config);
* Get config writer
* @return PhpArray
public function getConfigWriter() : PhpArray
return $this->configWriter;
* Get target path
* @return string
public function getTargetPath() : string
return $this->targetPath;