Bug #28327

Argument mapping falsely detects tags from method description - ReflectionService RegExp issue

Added by Robert Lemke over 8 years ago. Updated about 8 years ago.

Status:
Resolved
Priority:
Should have
Category:
Reflection
Start date:
2011-07-20
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

Description

Consider the following doc comment and method signature of a CommandController:

    /**
     * An example command
     *
     * The comment of this command method is also used for FLOW3's help screens. The first line should give a very short
     * summary about what the command does. Then, after an empty line, you should explain in more detail what the command
     * does. You might also give some usage example.
     *
     * It is important to document the parameters with @param tags, because that information will also appear in the help
     * screen.
     *
     * @param string $requiredArgument This argument is required
     * @param string $optionalArgument This argument is optional
     * @return void
     */
    public function exampleCommand($requiredArgument, $optionalArgument = NULL) {
        $this->view->appendContent('You called the example command.');
    }

The property mapper will fail on this command because the "@param tags," is detected as an argument definition and then the property mapper tries to convert the first argument into "tags," ... which it can't'.

Associated revisions

Revision 04186814 (diff)
Added by Sebastian Kurfuerst over 8 years ago

[+BUGFIX] (Reflection): Only detect tags when they are at the beginning of a line

We should not detect tags like param foo when they are at the beginning of a line,
and not inside freeform text.
We still use a heuristic, by searching for '*
' now, as using a RegExp here could
have severe performance penalties.

Functional test adjusted.

Change-Id: Ic8440a8d95c8444573d49a0cbce684b1f7dbad48
Fixes: #28327

History

#1 Updated by Sebastian Kurfuerst over 8 years ago

  • Subject changed from Argument mapping falsely detects tags from method description to Argument mapping falsely detects tags from method description - ReflectionService RegExp issue

#2 Updated by Sebastian Kurfuerst over 8 years ago

  • Status changed from New to Accepted
  • Assignee set to Sebastian Kurfuerst

#3 Updated by Sebastian Kurfuerst over 8 years ago

  • Category changed from MVC to Reflection
  • Status changed from Accepted to Under Review
  • % Done changed from 0 to 100

#4 Updated by Mr. Hudson over 8 years ago

Patch set 1 of change Ic8440a8d95c8444573d49a0cbce684b1f7dbad48 has been pushed to the review server.
It is available at http://review.typo3.org/3431

#5 Updated by Sebastian Kurfuerst over 8 years ago

  • Status changed from Under Review to Resolved

#6 Updated by Karsten Dambekalns about 8 years ago

  • Target version changed from 1230 to 1.0.0

Also available in: Atom PDF