Skip to content

Stray ? character in NullableConstructorArgumentDummy.php in symfony/serializer #27864

Closed
@razzed

Description

@razzed

Symfony version(s) affected: Symfony/Serializer v4.1.1

Description
Stray character in symfony/serializer/Tests/Fixtures/NullableConstructorArgumentDummy.php

How to reproduce
From the command line:

mkdir symfony-broken
cd symfony-broken
composer require symfony/serializer
php -l vendor/symfony/serializer/Tests/Fixtures/NullableConstructorArgumentDummy.php
PHP Parse error:  syntax error, unexpected '?', expecting variable (T_VARIABLE) in vendor/symfony/serializer/Tests/Fixtures/NullableConstructorArgumentDummy.php on line 18

Parse error: syntax error, unexpected '?', expecting variable (T_VARIABLE) in vendor/symfony/serializer/Tests/Fixtures/NullableConstructorArgumentDummy.php on line 18
Errors parsing vendor/symfony/serializer/Tests/Fixtures/NullableConstructorArgumentDummy.php

Possible Solution
Remove the stray ? character in the __construct(?\stdClass $foo) on line 18

Additional context
Not sure where this is included but I have a linter which runs across all files across my entire project and that's how this was picked up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions