1 | <?php |
||
15 | class SpecificationMethodGenerator implements Generator |
||
16 | { |
||
17 | /** |
||
18 | * @var \PhpSpec\Console\IO |
||
19 | */ |
||
20 | private $io; |
||
21 | |||
22 | /** |
||
23 | * @var \PhpSpec\CodeGenerator\TemplateRenderer |
||
24 | */ |
||
25 | private $templates; |
||
26 | |||
27 | /** |
||
28 | * @var \PhpSpec\Util\Filesystem |
||
29 | */ |
||
30 | private $filesystem; |
||
31 | |||
32 | /** |
||
33 | * @param ConsoleIO $io |
||
34 | * @param TemplateRenderer $templates |
||
35 | * @param Filesystem $filesystem |
||
36 | */ |
||
37 | public function __construct(ConsoleIO $io, TemplateRenderer $templates, Filesystem $filesystem = null) |
||
43 | |||
44 | /** |
||
45 | * @param Resource $resource |
||
46 | * @param string $generation |
||
47 | * @param array $data |
||
48 | * |
||
49 | * @return bool |
||
50 | */ |
||
51 | public function supports(Resource $resource, $generation, array $data) |
||
55 | |||
56 | /** |
||
57 | * @param Resource $resource |
||
58 | * @param array $data |
||
59 | */ |
||
60 | public function generate(Resource $resource, array $data = []) |
||
73 | |||
74 | /** |
||
75 | * @return int |
||
76 | */ |
||
77 | public function getPriority() |
||
81 | |||
82 | /** |
||
83 | * @param $type |
||
84 | * @return string |
||
85 | */ |
||
86 | protected function getTemplate($type) |
||
90 | |||
91 | /** |
||
92 | * @param string $spec |
||
93 | * @param \RMiller\Caser\Cased $method |
||
94 | * @return bool |
||
95 | */ |
||
96 | private function exampleAlreadyExists($spec, Cased $method) |
||
114 | |||
115 | /** |
||
116 | * @param \RMiller\Caser\Cased $method |
||
117 | * @param $type |
||
118 | * @return string |
||
119 | */ |
||
120 | private function renderContent(Cased $method, $type) |
||
128 | |||
129 | /** |
||
130 | * @param \PhpSpec\Locator\Resource $resource |
||
131 | * @param string $spec |
||
132 | * @param \RMiller\Caser\Cased $method |
||
133 | * @param $type |
||
134 | */ |
||
135 | private function addExampleToSpec(Resource $resource, $spec, Cased $method, $type) |
||
141 | |||
142 | /** |
||
143 | * @param Resource $resource |
||
144 | * @param $method |
||
145 | */ |
||
146 | private function informExampleAdded(Resource $resource, Cased $method) |
||
153 | |||
154 | /** |
||
155 | * @param Resource $resource |
||
156 | * @param $method |
||
157 | */ |
||
158 | private function informExampleAlreadyExists(Resource $resource, Cased $method) |
||
165 | } |
||
166 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..