for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types = 1);
/*
* This file is part of the FiveLab Resource package
*
* (c) FiveLab
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code
*/
namespace FiveLab\Component\Resource\Resource\Relation;
/**
* The collection for store relations.
* @author Vitaliy Zhuk <[email protected]>
class RelationCollection implements \IteratorAggregate, \Countable
{
* @var array|RelationInterface[]
private $relations;
* Constructor.
* @param RelationInterface ...$relations
public function __construct(RelationInterface ...$relations)
$relations
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
$this->relations = func_get_args();
}
* {@inheritdoc}
* @return \ArrayIterator|RelationInterface[]
public function getIterator(): \ArrayIterator
return new \ArrayIterator($this->relations);
public function count(): int
return \count($this->relations);
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.