Commit 9834707
committed
minor symfony#16421 Add return types in docs to avoid generating more legacy code (Seldaek)
This PR was merged into the 4.4 branch.
Discussion
----------
Add return types in docs to avoid generating more legacy code
I am not entirely sure if this goes against a policy or not, but I wanted to fix this and also use it to raise the point in case it wasn't raised yet.
While copy-pasting this code from the docs to get started on an arg value resolver, I then instantly got `Method "Symfony\Component\HttpKernel\Controller\ArgumentValueResolverInterface::supports()" might add "bool" as a native return type declaration in the future. Do the same in implementation "App\ArgumentResolver\PackageResolver" now to avoid errors or add an explicit `@return` annotation to suppress this message.` in my deprecation log.
This feature was added in Symfony 5.x IIRC which means PHP 7.2+ support, so return types including iterable are fully supported, no reason to advise anyone to not use them as far as I can tell :)
Commits
-------
c666459 Add return types in docs to avoid generating more legacy code1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
179 | 179 | | |
180 | 180 | | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
0 commit comments