for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace SymfonyBundles\Pattern\ArrayConditions;
class Conditions implements ConditionsInterface
{
/**
* @var array
*/
protected $elements;
* @param array $elements
public function __construct(array $elements = [])
$this->setElements($elements);
}
* {@inheritdoc}
public function setElements(array $elements): void
$this->elements = $elements;
public function getElements(): array
return $this->elements;
public function find(string $path, $default = null)
$element = $this->elements;
foreach (\explode('.', $path) as $node) {
if (isset($element[$node])) {
$element = $element[$node];
} else {
return $default;
return $element;
public function offsetExists($offset)
return \array_key_exists($offset, $this->elements);
public function offsetGet($offset)
return $this->elements[$offset];
public function offsetSet($offset, $value)
$this->elements[$offset] = $value;
public function offsetUnset($offset)
unset($this->elements[$offset]);