Mercurial > hg > cmmr2012-drupal-site
annotate vendor/phar-io/manifest/src/values/BundledComponentCollection.php @ 2:5311817fb629
Theme updates
author | Chris Cannam |
---|---|
date | Tue, 10 Jul 2018 13:19:18 +0000 |
parents | |
children |
rev | line source |
---|---|
Chris@2 | 1 <?php |
Chris@2 | 2 /* |
Chris@2 | 3 * This file is part of PharIo\Manifest. |
Chris@2 | 4 * |
Chris@2 | 5 * (c) Arne Blankerts <arne@blankerts.de>, Sebastian Heuer <sebastian@phpeople.de>, Sebastian Bergmann <sebastian@phpunit.de> |
Chris@2 | 6 * |
Chris@2 | 7 * For the full copyright and license information, please view the LICENSE |
Chris@2 | 8 * file that was distributed with this source code. |
Chris@2 | 9 */ |
Chris@2 | 10 |
Chris@2 | 11 namespace PharIo\Manifest; |
Chris@2 | 12 |
Chris@2 | 13 class BundledComponentCollection implements \Countable, \IteratorAggregate { |
Chris@2 | 14 /** |
Chris@2 | 15 * @var BundledComponent[] |
Chris@2 | 16 */ |
Chris@2 | 17 private $bundledComponents = []; |
Chris@2 | 18 |
Chris@2 | 19 public function add(BundledComponent $bundledComponent) { |
Chris@2 | 20 $this->bundledComponents[] = $bundledComponent; |
Chris@2 | 21 } |
Chris@2 | 22 |
Chris@2 | 23 /** |
Chris@2 | 24 * @return BundledComponent[] |
Chris@2 | 25 */ |
Chris@2 | 26 public function getBundledComponents() { |
Chris@2 | 27 return $this->bundledComponents; |
Chris@2 | 28 } |
Chris@2 | 29 |
Chris@2 | 30 /** |
Chris@2 | 31 * @return int |
Chris@2 | 32 */ |
Chris@2 | 33 public function count() { |
Chris@2 | 34 return count($this->bundledComponents); |
Chris@2 | 35 } |
Chris@2 | 36 |
Chris@2 | 37 /** |
Chris@2 | 38 * @return BundledComponentCollectionIterator |
Chris@2 | 39 */ |
Chris@2 | 40 public function getIterator() { |
Chris@2 | 41 return new BundledComponentCollectionIterator($this); |
Chris@2 | 42 } |
Chris@2 | 43 } |