Skip to content

Add symfony/polyfill-php80 as requirement #36384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

bytehead
Copy link

@bytehead bytehead commented Apr 8, 2020

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets n/a
License MIT
Doc PR n/a

Symfony uses the Stringable interface in the TokenInterface class in Symfony 4.4, however it does not require symfony/polyfill-php80 before Symfony 5.1 (see composer.json@4.4 and composer.json@master), therefore the class is undefined in PHP 7 + Symfony 4.

Thanks to @leofeyer for debugging it (see contao/contao#1647).

@ro0NL
Copy link
Contributor

ro0NL commented Apr 8, 2020

see #36057 (comment) :)

i think your UndefinedDocblockClass fix is rather elegant pre PHP8 👍

i agree shipping unanalyzable code by default is not the best of practices though, so i wouldnt mind core adding it.

@bytehead
Copy link
Author

bytehead commented Apr 8, 2020

Thanks for the link! Makes sense to me 👍

@bytehead bytehead closed this Apr 8, 2020
@nicolas-grekas nicolas-grekas added this to the 4.4 milestone Apr 8, 2020
@nicolas-grekas
Copy link
Member

nicolas-grekas commented Apr 8, 2020

i agree shipping unanalyzable code by default is not the best of practices though, so i wouldnt mind core adding it.

The code is perfectly analyzable as is: the meaning of the interface is defined in https://wiki.php.net/rfc/stringable
It'd be great to make code analyzers aware instead.

@leofeyer
Copy link
Contributor

leofeyer commented Apr 8, 2020

Add the following to your psalm.xml file to suppress the issue:

    <issueHandlers>
        <UndefinedDocblockClass>
            <errorLevel type="suppress">
                <referencedClass name="Stringable"/>
            </errorLevel>
        </UndefinedDocblockClass>
    </issueHandlers>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants