Skip to content

Commit

Permalink
(#302) added collector collection...
Browse files Browse the repository at this point in the history
  • Loading branch information
carbontwelve committed Feb 28, 2018
1 parent e82e13c commit 0de5a64
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/Modules/Collectors/CollectorCollection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

namespace Tapestry\Modules\Collectors;

class CollectorCollection
{
/**
* @var array|CollectorInterface[]
*/
private $items = [];

/**
* @param CollectorInterface $class
* @throws \ReflectionException
*/
public function add(CollectorInterface $class)
{
$reflection = new \ReflectionClass($class);
$this->items[$reflection->getShortName()] = $class;
}

public function collect()
{
foreach($this->items as $collector) {
$collector->collect(); // @todo finish
}
}
}

0 comments on commit 0de5a64

Please sign in to comment.