Forked DocParser incorrectly parses ::class notations

Created on 11 April 2024, 2 months ago
Updated 3 May 2024, about 1 month ago

Problem/Motivation

... and the upstream already has a fixed for since a couple of years: https://github.com/doctrine/annotations/issues/141.

Steps to reproduce

(see minimal test in the MR)

Proposed resolution

Apply fix from upstream.

Remaining tasks

User interface changes

API changes

None

Data model changes

Release notes snippet

πŸ› Bug report
Status

Fixed

Version

10.2 ✨

Component
PluginΒ  β†’

Last updated about 15 hours ago

Created by

πŸ‡­πŸ‡ΊHungary mxr576 Hungary

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mxr576
  • Status changed to Needs review 2 months ago
  • πŸ‡­πŸ‡ΊHungary mxr576 Hungary
  • Merge request !7446Incorporate changes from upstream β†’ (Closed) created by mxr576
  • Pipeline finished with Success
    2 months ago
    Total: 1141s
    #143862
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Even though this is on the way out, we will need to support it through the 11.x lifecycle, so there's no harm in improving it in my opinion

  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Ran test-only feature

    1) Drupal\Tests\Component\Annotation\Doctrine\DocParserTest::testSupportClassConstants with data set #1 ('@AnnotationWithConstants(\Sim...class)', 'SimpleXMLElement')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -'SimpleXMLElement'
    +'\SimpleXMLElement'
    /builds/issue/drupal-3440170/vendor/phpunit/phpunit/src/Framework/Constraint/Equality/IsEqual.php:94
    /builds/issue/drupal-3440170/core/tests/Drupal/Tests/Component/Annotation/Doctrine/DocParserTest.php:881
    /builds/issue/drupal-3440170/vendor/phpunit/phpunit/src/Framework/TestResult.php:728
    /builds/issue/drupal-3440170/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684
    /builds/issue/drupal-3440170/vendor/phpunit/phpunit/src/Framework/TestSuite.php:684
    /builds/issue/drupal-3440170/vendor/phpunit/phpunit/src/TextUI/TestRunner.php:651
    /builds/issue/drupal-3440170/vendor/phpunit/phpunit/src/TextUI/Command.php:144
    /builds/issue/drupal-3440170/vendor/phpunit/phpunit/src/TextUI/Command.php:97
    FAILURES!
    Tests: 227, Assertions: 481, Failures: 1.
    

    So coverage for change is there.

    Left a comment a comment though, that just may not be me understanding

  • Status changed to RTBC about 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    I see other examples of the space in the file. Don't fully understand but does seem to address the issue.

  • Status changed to Needs work about 2 months ago
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    PHPCS is disabled here because this is a copy of Doctrine code with different standards, but we should still conform to Doctrine formatting by using 4-space indents.

  • First commit to issue fork.
  • Status changed to Needs review about 2 months ago
  • πŸ‡³πŸ‡ΏNew Zealand quietone New Zealand

    I updated the MR to use 4 space indenting on all the changes.

    In the future, I would like to have a situation where we don't spend time on formatting issues on forked code that is on the way out.

  • Pipeline finished with Failed
    about 2 months ago
    #150013
  • Status changed to RTBC about 2 months ago
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Rebased for the failing kernel failures. Believe the javascript to be unrelated.

  • Pipeline finished with Failed
    about 2 months ago
    Total: 1951s
    #150181
  • Status changed to Fixed about 2 months ago
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    Don't particularly like the code... str_starts_with() exists in our minimum PHP but it's a copy of upstream so whatevs... let's march forward to the time we don't have to maintain this.

    Committed and pushed f1f27ff7f3 to 11.x and 3adb7e2297 to 10.3.x. Thanks!
    Committed 5d783fb and pushed to 10.2.x. Thanks!

    • alexpott β†’ committed 5d783fbd on 10.2.x
      Issue #3440170 by mxr576, quietone, smustgrave, longwave, larowlan:...
    • alexpott β†’ committed 3adb7e22 on 10.3.x
      Issue #3440170 by mxr576, quietone, smustgrave, longwave, larowlan:...
    • alexpott β†’ committed f1f27ff7 on 11.x
      Issue #3440170 by mxr576, quietone, smustgrave, longwave, larowlan:...
  • πŸ‡ΊπŸ‡ΈUnited States smustgrave

    Out of my own curiosity does ! having a space mean anything?

  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    No - ! $something and !$something mean the same thing, it's just stylistic preference.

  • πŸ‡­πŸ‡ΊHungary mxr576 Hungary

    Thanks for such a fast resolution of the problem! \o/

    let's march forward to the time we don't have to maintain this.

    +1

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024