1 | <?php |
||
30 | final class Argument extends AbstractFactory implements ProjectFactoryStrategy |
||
31 | { |
||
32 | /** |
||
33 | * @var PrettyPrinter |
||
34 | */ |
||
35 | private $valueConverter; |
||
36 | |||
37 | /** |
||
38 | * Initializes the object. |
||
39 | * |
||
40 | * @param PrettyPrinter $prettyPrinter |
||
41 | */ |
||
42 | 3 | public function __construct(PrettyPrinter $prettyPrinter) |
|
43 | { |
||
44 | 3 | $this->valueConverter = $prettyPrinter; |
|
45 | 3 | } |
|
46 | |||
47 | /** |
||
48 | * Returns true when the strategy is able to handle the object. |
||
49 | * |
||
50 | * @param Param $object object to check. |
||
51 | * @return boolean |
||
52 | */ |
||
53 | 1 | public function matches($object) |
|
57 | |||
58 | /** |
||
59 | * Creates an ArgumentDescriptor out of the given object. |
||
60 | * Since an object might contain other objects that need to be converted the $factory is passed so it can be |
||
61 | * used to create nested Elements. |
||
62 | * |
||
63 | * @param Param $object object to convert to an Element |
||
64 | * @param StrategyContainer $strategies used to convert nested objects. |
||
65 | * @param Context $context of the created object |
||
66 | * @return ArgumentDescriptor |
||
67 | */ |
||
68 | 1 | protected function doCreate($object, StrategyContainer $strategies, Context $context = null) |
|
77 | } |
||
78 |