Deprecating all ::fromArray() methods in in the package#153
Conversation
These methods are brittle, badly documented, and very much type-unsafe. The `src/Generator` API is mostly composed of builder objects, and `::fromArray()` is not necessary in it. Please also do not use arbitrary user input, deserialized as array, to generate code: it's a recipe for disaster. Signed-off-by: Marco Pivetta <ocramius@gmail.com>
The `::fromArray()` API is now deprecated, and we should encourage the usage of a safer API from now on. Signed-off-by: Marco Pivetta <ocramius@gmail.com>
froschdesign
left a comment
There was a problem hiding this comment.
Good decision. The configuration arrays are ugly to use and difficult to document.
Only one small suggestion.
Co-authored-by: Frank Brückner <info@froschdesignstudio.de> Signed-off-by: Marco Pivetta <ocramius@gmail.com>
Signed-off-by: Marco Pivetta <ocramius@gmail.com>
|
Hi, will https://docs.laminas.dev/laminas-code/generator/examples/ be updated? |
|
@tyteen4a03 by someone, yes: are you volunteering? 😁 |
|
@Ocramius I'm not sure what is needed from me because it looks like the docs in the repo are updated but the website doesn't render the latest version of the docs. |
|
@tyteen4a03 aha! Thanks for checking: that's indeed for us to find out then /cc @froschdesign |
|
The problem is the build process for the documentation: https://github.com/laminas/laminas-code/actions/workflows/docs-build.yml - but the logs are gone. |
|
@tyteen4a03 Thanks to @Xerkus |
Description
Deprecating all
::fromArray()methods in in the packageThese methods are brittle, badly documented, and very much
type-unsafe.
The
src/GeneratorAPI is mostly composed of builder objects,and
::fromArray()is not necessary in it.Please also do not use arbitrary user input, deserialized as
array, to generate code: it's a recipe for disaster.