1 | <?php |
||
30 | class ProjectDescriptorBuilder |
||
31 | { |
||
32 | /** @var string */ |
||
33 | const DEFAULT_PROJECT_NAME = 'Untitled project'; |
||
34 | |||
35 | /** @var AssemblerFactory $assemblerFactory */ |
||
36 | protected $assemblerFactory; |
||
37 | |||
38 | /** @var Filter $filter */ |
||
39 | protected $filter; |
||
40 | |||
41 | /** @var ProjectDescriptor $project */ |
||
42 | protected $project; |
||
43 | |||
44 | private $defaultPackage; |
||
45 | |||
46 | public function __construct(AssemblerFactory $assemblerFactory, Filter $filterManager) |
||
51 | 1 | ||
52 | public function createProjectDescriptor() |
||
56 | 1 | ||
57 | public function setProjectDescriptor(ProjectDescriptor $projectDescriptor) |
||
61 | |||
62 | /** |
||
63 | * Returns the project descriptor that is being built. |
||
64 | * |
||
65 | * @return ProjectDescriptor |
||
66 | 2 | */ |
|
67 | public function getProjectDescriptor() |
||
71 | |||
72 | /** |
||
73 | * Verifies whether the given visibility is allowed to be included in the Descriptors. |
||
74 | * |
||
75 | * This method is used anytime a Descriptor is added to a collection (for example, when adding a Method to a Class) |
||
76 | * to determine whether the visibility of that element is matches what the user has specified when it ran |
||
77 | * phpDocumentor. |
||
78 | * |
||
79 | * @param string|integer $visibility One of the visibility constants of the ProjectDescriptor class or the words |
||
80 | * 'public', 'protected', 'private' or 'internal'. |
||
81 | * |
||
82 | * @see ProjectDescriptor where the visibility is stored and that declares the constants to use. |
||
83 | * |
||
84 | * @return boolean |
||
85 | 1 | */ |
|
86 | public function isVisibilityAllowed($visibility) |
||
105 | |||
106 | /** |
||
107 | * Takes the given data and attempts to build a Descriptor from it. |
||
108 | * |
||
109 | * @param mixed $data |
||
110 | * |
||
111 | * @throws \InvalidArgumentException if no Assembler could be found that matches the given data. |
||
112 | * |
||
113 | * @return DescriptorAbstract|Collection|null |
||
114 | */ |
||
115 | public function buildDescriptor($data) |
||
138 | |||
139 | /** |
||
140 | * Attempts to find an assembler matching the given data. |
||
141 | * |
||
142 | * @param mixed $data |
||
143 | * |
||
144 | * @return AssemblerInterface|null |
||
145 | */ |
||
146 | public function getAssembler($data) |
||
150 | |||
151 | /** |
||
152 | * Analyzes a Descriptor and alters its state based on its state or even removes the descriptor. |
||
153 | * |
||
154 | * @return Filterable |
||
155 | */ |
||
156 | public function filter(Filterable $descriptor) |
||
160 | |||
161 | /** |
||
162 | * Filters each descriptor, validates them, stores the validation results and returns a collection of transmuted |
||
163 | * objects. |
||
164 | * |
||
165 | * @param DescriptorAbstract[] $descriptor |
||
166 | * |
||
167 | * @return Collection |
||
168 | */ |
||
169 | private function filterEachDescriptor($descriptor) |
||
183 | |||
184 | /** |
||
185 | * Filters a descriptor, validates it, stores the validation results and returns the transmuted object or null |
||
186 | * if it is supposed to be removed. |
||
187 | * |
||
188 | * @param Descriptor $descriptor |
||
189 | * |
||
190 | * @return Descriptor|null |
||
191 | */ |
||
192 | protected function filterDescriptor(Descriptor $descriptor) |
||
206 | |||
207 | /** |
||
208 | * Map error code to severity. |
||
209 | * |
||
210 | * @param int $code |
||
211 | * |
||
212 | * @return string |
||
213 | */ |
||
214 | protected function mapCodeToSeverity($code) |
||
218 | |||
219 | public function build(Project $project) |
||
245 | |||
246 | public function getDefaultPackage() |
||
250 | } |
||
251 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: