Skip to content

Parsing the file [...StateProvider.tpl.php] resulted in an error: Syntax error, unexpected T_NAMESPACE on line 5 #6826

@kochen

Description

@kochen

API Platform version(s) affected: since 4.0.4 (4.0.10 still affected)

Description

$ vendor/bin/composer-require-checker
ComposerRequireChecker 4.14.0@b6d5acd89d0de1727c1188157fa99552c39d1dfb
In LocateASTFromFiles.php line 41:
                                                                               
  Parsing the file [.../vendor/api-platform/core/src/Laravel/Console/Maker/Resources/skeleton/StateProvider.tpl.php] resulted in   
  an error: Syntax error, unexpected T_NAMESPACE on line 5                     
                                                                               
In ParserAbstract.php line 321:
                                                  
  Syntax error, unexpected T_NAMESPACE on line 5  
                                                  
check [--config-file CONFIG-FILE] [--ignore-parse-errors] [--output OUTPUT] [--] [<composer-json>]

How to reproduce

Here is a composer.json to reproduce the issue:

{
    "name": "api-platform/issue-2805",
    "type": "project",
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "require-dev": {
        "maglnet/composer-require-checker": "^4.14"
    },
    "require": {
        "api-platform/core": "4.0.10"
    }
}

Possible Solution
Prior to v4.0.4, this would result in a successful check:

$ vendor/bin/composer-require-checker
ComposerRequireChecker 4.14.0@b6d5acd89d0de1727c1188157fa99552c39d1dfb
There were no unknown symbols found.

Additional Context
This is a Symfony project, and not Laravel.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions