for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
namespace Everlution\Navigation\Factory;
use Everlution\Navigation\Factory\Build\PropertyConfig;
use Everlution\Navigation\Factory\Build\UnsupportedItemClassException;
use Everlution\Navigation\Property\Property;
/**
* Class MatchFactory.
* @author Ivan Barlog <[email protected]>
*/
class MatchFactory extends HydratorContainer implements PropertyFactory
{
public function addHydrator(PropertyConfig $config)
return $this->add($config);
}
* @param array $config
* @return Property
public function createProperty(array $config): Property
$instance = null;
/** @var PropertyConfig $hydrator */
foreach ($this->getHydrators() as $hydrator) {
try {
$instance = $hydrator->toObject($config);
} catch (UnsupportedItemClassException $exception) {
continue;
return $instance;
* @param Property $property
* @return array
public function flattenProperty(Property $property): array
$items = [];
$items[] = $hydrator->toArray($property);
return $items;