Skip to content

Commit

Permalink
Replaces SplObjectStore with array in Steps
Browse files Browse the repository at this point in the history
  • Loading branch information
sagikazarmark committed May 26, 2015
1 parent 981f20c commit f028439
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 2 additions & 4 deletions src/Step/ConverterStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class ConverterStep implements Step
{
/**
* @var \SplObjectStorage
* @var callable[]
*/
private $converters;

Expand All @@ -20,8 +20,6 @@ class ConverterStep implements Step
*/
public function __construct(array $converters = [])
{
$this->converters = new \SplObjectStorage();

foreach ($converters as $converter) {
$this->add($converter);
}
Expand All @@ -32,7 +30,7 @@ public function __construct(array $converters = [])
*/
public function add(callable $converter)
{
$this->converters->attach($converter);
$this->converters[] = $converter;

return $this;
}
Expand Down
6 changes: 1 addition & 5 deletions src/Step/ValueConverterStep.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ class ValueConverterStep implements Step
*/
public function add($property, callable $converter)
{
if (!isset($this->converters[$property])) {
$this->converters[$property] = new \SplObjectStorage();
}

$this->converters[$property]->attach($converter);
$this->converters[$property][] = $converter;

return $this;
}
Expand Down

0 comments on commit f028439

Please sign in to comment.