Skip to content

Commit

Permalink
separate processing from instantiation
Browse files Browse the repository at this point in the history
  • Loading branch information
wyrfel committed Feb 17, 2017
1 parent d76b9a6 commit 8d08d7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
10 changes: 0 additions & 10 deletions src/AbstractSynopsis.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,6 @@ abstract class AbstractSynopsis
*/
protected $factory;

/**
* constructor, triggers processing of the passed value to properties
* @param $value
* @param $depth
*/
public function __construct($value, $depth)
{
$this->process($value, $depth);
}

/**
* processes passed values to properties
*
Expand Down
7 changes: 6 additions & 1 deletion src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ public function synopsize($value, $depth)
$depth = false;
}

return new $className($value, $depth);
/** @var AbstractSynopsis $synopsis */
$synopsis = new $className();
$synopsis->setFactory($this);
$synopsis->process($value, $depth);

return $synopsis;
}

/**
Expand Down

0 comments on commit 8d08d7c

Please sign in to comment.