Bug #29791

When kickstarting models with collections, invalid code is generated

Added by Karsten Dambekalns over 1 year ago. Updated 5 months ago.

Status:Resolved Start date:2011-09-14
Priority:Must have Due date:
Assignee:Bastian Waidelich % Done:

100%

Category:-
Target version:-
FLOW3 version affected:FLOW3 1.0.0
Votes: 0

Description

Not in all cases, but when using collections with element type hints, the generated code is wrong:

./flow3 kickstart:model TYPO3.Blog Blog 'posts:\Doctrine\Common\Collections\Collection<\TYPO3\Blog\Domain\Model\Post>'

results in setter code like

    /**
     * Sets this Blog's posts
     *
     * @param \Doctrine\Common\Collections\Collection<\TYPO3\Blog\Domain\Model\Post> $posts The Blog's posts
     * @return void
     */
    public function setPosts(\Doctrine\Common\Collections\Collection<\TYPO3\Blog\Domain\Model\Post> $posts) {
        $this->posts = $posts;
    }

which results in a nasty error like

PHP Parse error:  syntax error, unexpected '<', expecting '&' or T_VARIABLE in .../Model/Blog.php on line xx

Associated revisions

Revision 3060ff79
Added by Bastian Waidelich 6 months ago

[BUGFIX] Fix type hint of collections in generated model classes

This makes sure that, when using collections with element type hints,
only the collection class name ends up in the type hint of the generated setter.

Change-Id: I268a14049aa43e430462b8c1a5d325252eb18295
Fixes: #29791
Releases: 1.1, 1.2

Revision 0f1b8b25
Added by Bastian Waidelich 5 months ago

[BUGFIX] Fix type hint of collections in generated model classes

This makes sure that, when using collections with element type hints,
only the collection class name ends up in the type hint of the generated setter.

Change-Id: I268a14049aa43e430462b8c1a5d325252eb18295
Fixes: #29791
Releases: 1.1, 1.2

History

Updated by Karsten Dambekalns over 1 year ago

  • Target version deleted (1230)

Updated by Karsten Dambekalns over 1 year ago

  • FLOW3 version affected set to FLOW3 1.0.0

Updated by Michel Albers 12 months ago

This is still the case in FLOW3 Beta 1.1

Updated by Bastian Waidelich 6 months ago

Is that still the case today? brr

Updated by Bastian Waidelich 6 months ago

Is that still the case today? brr

Updated by Bastian Waidelich 6 months ago

  • Status changed from New to Accepted
  • Assignee set to Bastian Waidelich

Updated by Gerrit Code Review 6 months ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16663

Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch master has been pushed to the review server.
It is available at http://review.typo3.org/16663

Updated by Bastian Waidelich 6 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Updated by Gerrit Code Review 5 months ago

  • Status changed from Resolved to Under Review

Patch set 1 for branch FLOW3-1.1 has been pushed to the review server.
It is available at https://review.typo3.org/17076

Updated by Gerrit Code Review 5 months ago

Patch set 2 for branch FLOW3-1.1 has been pushed to the review server.
It is available at https://review.typo3.org/17076

Updated by Bastian Waidelich 5 months ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF