mamuz / PhpDependencyAnalysis

Static code analysis to find violations in a dependency graph
http://mamuz.github.io/PhpDependencyAnalysis/
MIT License
561 stars 45 forks source link

PHP 7.1 Support #39

Closed SerafimArts closed 5 years ago

SerafimArts commented 6 years ago

Environment:

Actual:

Done

Logs:
Error   Syntax error, unexpected '?' on line 35 ./src/Contracts/Definition/Behaviour/ProvidesArguments.php
Error   Syntax error, unexpected '?' on line 35 ./src/Contracts/Definition/Behaviour/ProvidesFields.php
Error   Syntax error, unexpected '?' on line 36 ./src/Contracts/Definition/Behaviour/ProvidesInputFields.php
Error   Syntax error, unexpected '?' on line 34 ./src/Contracts/Definition/Behaviour/ProvidesInterfaces.php
Error   Syntax error, unexpected '?' on line 28 ./src/Contracts/Definition/Behaviour/ProvidesLocations.php
Error   Syntax error, unexpected '?' on line 25 ./src/Contracts/Definition/Behaviour/ProvidesSchema.php
Error   Syntax error, unexpected T_CONST, expecting T_FUNCTION on line 22 ./src/Contracts/Definition/Dependent/DirectiveLocation.php
Error   Syntax error, unexpected '?' on line 34 ./src/Contracts/Definition/EnumDefinition.php
Error   Syntax error, unexpected T_CONST, expecting T_FUNCTION on line 20 ./src/Contracts/Definition/SchemaDefinition.php
Error   Syntax error, unexpected '?' on line 34 ./src/Contracts/Invocation/Behaviour/ProvidesPassedArguments.php
Error   Syntax error, unexpected T_CONST, expecting T_FUNCTION on line 20 ./src/Contracts/Type.php

Files example:

    public function getArgumentDefinition(string $name): ?ArgumentDefinition; // Error on this line (return typehint)

Expected:

OK
Pierstoval commented 5 years ago

Is there any move on this? For documentation/educational purposes, I would definitely need a tool like this, but without PHP 7.1+ support it becomes tedious to generate a dependency graph for classes, since there's not many tools for this purpose...

@mamuz If you ever need help, can you give hints on where to start for people that never contributed to this project? 😉

mamuz commented 5 years ago

will be fixed with next major