[Flow] [RFC] CGL: Allow "ArrayElementType[]" syntax
Carsten Bleicker
carsten at bleicker.de
Thu Feb 5 17:22:44 CET 2015
ArrayObject<Foo>
Collection<Foo>
Stack<Foo>
Foo[] losing all this informations.
In Java it is exactly as above "List<Foo>"
But php ... ^^
I think because of php its okay staing on inline annotation
/** @var Foo foo **/
Mit sonnigem Gruß
Carsten Bleicker
----------------------
Carsten Bleicker
Wülfingstraße 1
42477 Radevormwald
E-Mail: carsten at bleicker.de
Web: www.bleicker.de
Twitter: @carstenbleicker
Jabber: cbleicker at jabber.ccc.de
Telefon: +49 (0)171-2690845
> Am 05.02.2015 um 17:14 schrieb Adrian Föder <adrian at foeder.de>:
>
> I would also second that; but that might lead into "usability" trouble with the property mapper. Developers would need a rather good Flow knowledge of when the property mapper is used, hence which "annotation style" has to be done.
>
> Currently, the property mapper checks for an annotation style like
>
> ```
> @var \Doctrine\Common\Collections\Collection<\Acme\Shop\Domain\Model\Category>
> ```
>
> The IDE friendly variant would be
>
> ```
> @var \Doctrine\Common\Collections\Collection|\Acme\Shop\Domain\Model\Category[]
> ```
>
> (note the OR-pipe between the two hints and the array brackets at the end) At least that's the way how PhpStorm would work.
>
> IF we allow that in the CGL we almost *must* adjust the property mapper to support that format, too. Should be not that hard, though. If there's only one annotation, ending with the brackets, an array is expected as top-level type, and if there's a hint with a bracket in OR-conjunction with a collection, that collection is used as top level type.
>
> WDYT?
>
> -Adrian
>
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
More information about the Flow
mailing list