diff --git a/src/Step/ConverterStep.php b/src/Step/ConverterStep.php index c324f29d..9e469f86 100644 --- a/src/Step/ConverterStep.php +++ b/src/Step/ConverterStep.php @@ -11,7 +11,7 @@ class ConverterStep implements Step { /** - * @var \SplObjectStorage + * @var callable[] */ private $converters; @@ -20,8 +20,6 @@ class ConverterStep implements Step */ public function __construct(array $converters = []) { - $this->converters = new \SplObjectStorage(); - foreach ($converters as $converter) { $this->add($converter); } @@ -32,7 +30,7 @@ public function __construct(array $converters = []) */ public function add(callable $converter) { - $this->converters->attach($converter); + $this->converters[] = $converter; return $this; } diff --git a/src/Step/ValueConverterStep.php b/src/Step/ValueConverterStep.php index 06937cd4..50fc4053 100644 --- a/src/Step/ValueConverterStep.php +++ b/src/Step/ValueConverterStep.php @@ -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; }