Doctrine Common
  1. Doctrine Common
  2. DCOM-46

Make annotation index configurable

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1
    • Fix Version/s: 2.1
    • Component/s: Annotations
    • Labels:
      None

      Description

      So, this is another improvement that I'd like to make. Right now all annotations are indexed by their name which has the limitation that on the top level annotations with the same name are only gathered once.

      /**
       * @param mixed $a
       * @param mixed $a
       * @param mixed $a
       */
      function ($a, $b, $c) { }
      

      In the above case the annotation parser would only pick up one "param" annotation. My guess is that this was done for fast lookups, but I think we need to make this configurable (I know you hate this word ) as the workaround here is needlessly bloated.

      /**
       * @params({@param, @param, @param})
       */
      function($a, $b, $c) {}
      

      This only requires two lines to be changed/made conditional, see
      https://github.com/schmittjoh/SecurityExtraBundle/blob/master/Mapping/Driver/AnnotationParser.php#L63
      https://github.com/schmittjoh/SecurityExtraBundle/blob/master/Mapping/Driver/AnnotationParser.php#L72

      p.s. If you want me to provide a patch for this, just tell me.

        Activity

        Johannes Schmitt created issue -
        Johannes Schmitt made changes -
        Field Original Value New Value
        Description So, this is another improvement that I'd like make. Right now all annotations are indexed by their name which has the limitation that on the top level annotations with the same name are only gathered once.

        {code}
        /**
         * @param mixed $a
         * @param mixed $a
         * @param mixed $a
         */
        function ($a, $b, $c) { }
        {code}

        In the above case the annotation parser would only pick up one "param" annotation. My guess is that this was done for fast lookups, but I think we need to make this configurable (I know you hate this word :)) as the workaround here is needlessly bloated.

        {code}
        /**
         * @params({@param, @param, @param})
         */
        function($a, $b, $c) {}
        {code}

        This only requires two lines to be changed/made conditional, see
        https://github.com/schmittjoh/SecurityExtraBundle/blob/master/Mapping/Driver/AnnotationParser.php#L63
        https://github.com/schmittjoh/SecurityExtraBundle/blob/master/Mapping/Driver/AnnotationParser.php#L72

        p.s. If you want me to provide a patch for this, just tell me.
        So, this is another improvement that I'd like to make. Right now all annotations are indexed by their name which has the limitation that on the top level annotations with the same name are only gathered once.

        {code}
        /**
         * @param mixed $a
         * @param mixed $a
         * @param mixed $a
         */
        function ($a, $b, $c) { }
        {code}

        In the above case the annotation parser would only pick up one "param" annotation. My guess is that this was done for fast lookups, but I think we need to make this configurable (I know you hate this word :)) as the workaround here is needlessly bloated.

        {code}
        /**
         * @params({@param, @param, @param})
         */
        function($a, $b, $c) {}
        {code}

        This only requires two lines to be changed/made conditional, see
        https://github.com/schmittjoh/SecurityExtraBundle/blob/master/Mapping/Driver/AnnotationParser.php#L63
        https://github.com/schmittjoh/SecurityExtraBundle/blob/master/Mapping/Driver/AnnotationParser.php#L72

        p.s. If you want me to provide a patch for this, just tell me.
        Show
        Guilherme Blanco added a comment - Implemented on master. https://github.com/doctrine/common/commit/59910f53fad7ce08a1ec840d9874a74cefcf32b8
        Guilherme Blanco made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Assignee Benjamin Eberlei [ beberlei ] Guilherme Blanco [ guilhermeblanco ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12542 ] jira-feedback2 [ 17892 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 17892 ] jira-feedback3 [ 19855 ]

        This list may be incomplete, as errors occurred whilst retrieving source from linked applications:

        • Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DCOM-46, expand=changesets[0:20].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)

          People

          • Assignee:
            Guilherme Blanco
            Reporter:
            Johannes Schmitt
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: