for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace graphp\edge;
use ArrayObject;
/**
* Class EdgeSet
*
* @package graphp\edge
*/
class EdgeSet extends ArrayObject
{
* Construct a set of edges
* @param array $input - array of edges
public function __construct(array $input = [])
parent::__construct($input, ArrayObject::ARRAY_AS_PROPS);
}
* Check if the set contains the edge
* @param EdgeInterface $edge - niddle
public function contains(EdgeInterface $edge): bool
return in_array($edge, $this->getArrayCopy());
* Remove the edge from the set
public function remove(EdgeInterface $edge): void
if (($id = array_search($edge, $this->getArrayCopy())) !== false) {
unset($this[$id]);