Chris@2: , Sebastian Heuer , Sebastian Bergmann Chris@2: * Chris@2: * For the full copyright and license information, please view the LICENSE Chris@2: * file that was distributed with this source code. Chris@2: */ Chris@2: Chris@2: namespace PharIo\Manifest; Chris@2: Chris@2: class BundledComponentCollection implements \Countable, \IteratorAggregate { Chris@2: /** Chris@2: * @var BundledComponent[] Chris@2: */ Chris@2: private $bundledComponents = []; Chris@2: Chris@2: public function add(BundledComponent $bundledComponent) { Chris@2: $this->bundledComponents[] = $bundledComponent; Chris@2: } Chris@2: Chris@2: /** Chris@2: * @return BundledComponent[] Chris@2: */ Chris@2: public function getBundledComponents() { Chris@2: return $this->bundledComponents; Chris@2: } Chris@2: Chris@2: /** Chris@2: * @return int Chris@2: */ Chris@2: public function count() { Chris@2: return count($this->bundledComponents); Chris@2: } Chris@2: Chris@2: /** Chris@2: * @return BundledComponentCollectionIterator Chris@2: */ Chris@2: public function getIterator() { Chris@2: return new BundledComponentCollectionIterator($this); Chris@2: } Chris@2: }