-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PHP Parse error @PHPUnit60Migration #4417
Labels
Comments
ktomk
added a commit
to ktomk/PHP-CS-Fixer
that referenced
this issue
May 21, 2019
When cs-fix the name-space of the class PHPUnit_Framework_MockObject_Stub_Return it results in a new class name which causes a PHP parse error b/c of the reserved word "return" as the new class-name. Phpunit has renamed that class to ...\ReturnStub (5 -> 6). Fix is to translate it to the "new" name so that it transposes correctly. Issue: PHP-CS-Fixer#4417 Fixer: PhpUnitNamespacedFixer
ktomk
added a commit
to ktomk/PHP-CS-Fixer
that referenced
this issue
May 21, 2019
When cs-fix the name-space of the class PHPUnit_Framework_MockObject_Stub_Return it results in a new class name which causes a PHP parse error b/c of the reserved word "return" as the new class-name. Phpunit has renamed that class to ...\ReturnStub (5 -> 6). Fix is to translate it to the "new" name so that it transposes correctly. Issue: PHP-CS-Fixer#4417 Fixer: PhpUnitNamespacedFixer
ktomk
added a commit
to ktomk/PHP-CS-Fixer
that referenced
this issue
May 21, 2019
When cs-fix the name-space of the class PHPUnit_Framework_MockObject_Stub_Return it results in a new class name which causes a PHP parse error b/c of the reserved word "return" as the new class-name. Phpunit has renamed that class to ...\ReturnStub (5 -> 6). Fix is to translate it to the "new" name so that it transposes correctly. Similar but w/o parse error is PHPUnit_Framework_Error which now is PHPUnit\Framework\Error\Error. Issue: PHP-CS-Fixer#4417 Fixer: PhpUnitNamespacedFixer
ktomk
added a commit
to ktomk/PHP-CS-Fixer
that referenced
this issue
May 22, 2019
When cs-fix the name-space of the class PHPUnit_Framework_MockObject_Stub_Return it resulted in a new class name which causes a PHP parse error b/c of the reserved word "return" as the new class-name. Phpunit has renamed that class to ...\ReturnStub (5 -> 6). Fix is to translate it to the "new" name so that it transposes correctly. Similar but w/o parse error is PHPUnit_Framework_Error which now is PHPUnit\Framework\Error\Error. Comparing all Phpunit 5 classes against Phpunit 6 classes results in the full translation table leaving nine classes unresolved: * PHPUnit_Extensions_TicketListener * PHPUnit_Extensions_PhptTestSuite * PHPUnit_Extensions_TestDecorator * PHPUnit_Extensions_RepeatedTest * PHPUnit_Extensions_GroupTestSuite * PHPUnit_Util_Log_JSON * PHPUnit_Util_Log_TAP * PHPUnit_Util_String * PHPUnit_Util_PHPTest Issue: PHP-CS-Fixer#4417 Fixer: PhpUnitNamespacedFixer
Checked against all Phpunit 5 and 6 class names to make the change more complete. |
ktomk
added a commit
to ktomk/PHP-CS-Fixer
that referenced
this issue
May 22, 2019
When cs-fix the name-space of the class PHPUnit_Framework_MockObject_Stub_Return it resulted in a new class name which causes a PHP parse error b/c of the reserved word "return" as the new class-name. Phpunit has renamed that class to ...\ReturnStub (5 -> 6). Fix is to translate it to the "new" name so that it transposes correctly. Similar but w/o parse error is PHPUnit_Framework_Error which now is PHPUnit\Framework\Error\Error. Comparing all Phpunit 5 classes against Phpunit 6 classes results in the full translation table leaving nine classes unresolved: * PHPUnit_Extensions_TicketListener * PHPUnit_Extensions_PhptTestSuite * PHPUnit_Extensions_TestDecorator * PHPUnit_Extensions_RepeatedTest * PHPUnit_Extensions_GroupTestSuite * PHPUnit_Util_Log_JSON * PHPUnit_Util_Log_TAP * PHPUnit_Util_String * PHPUnit_Util_PHPTest Issue: PHP-CS-Fixer#4417 Fixer: PhpUnitNamespacedFixer
ktomk
added a commit
to ktomk/PHP-CS-Fixer
that referenced
this issue
May 22, 2019
When cs-fix the name-space of the class PHPUnit_Framework_MockObject_Stub_Return it resulted in a new class name which causes a PHP parse error b/c of the reserved word "return" as the new class-name. Phpunit has renamed that class to ...\ReturnStub (5 -> 6). Fix is to translate it to the "new" name so that it transposes correctly. Similar but w/o parse error is PHPUnit_Framework_Error which now is PHPUnit\Framework\Error\Error. Comparing all Phpunit 5 classes against Phpunit 6 classes results in the full translation table leaving nine classes unresolved: * PHPUnit_Extensions_TicketListener * PHPUnit_Extensions_PhptTestSuite * PHPUnit_Extensions_TestDecorator * PHPUnit_Extensions_RepeatedTest * PHPUnit_Extensions_GroupTestSuite * PHPUnit_Util_Log_JSON * PHPUnit_Util_Log_TAP * PHPUnit_Util_String * PHPUnit_Util_PHPTest Issue: PHP-CS-Fixer#4417 Fixer: PhpUnitNamespacedFixer
ktomk
added a commit
to ktomk/PHP-CS-Fixer
that referenced
this issue
May 22, 2019
When cs-fix the name-space of the class PHPUnit_Framework_MockObject_Stub_Return it resulted in a new class name which causes a PHP parse error b/c of the reserved word "return" as the new class-name. Phpunit has renamed that class to ...\ReturnStub (5 -> 6). Fix is to translate it to the "new" name so that it transposes correctly. Similar but w/o parse error is PHPUnit_Framework_Error which now is PHPUnit\Framework\Error\Error. Comparing all Phpunit 5 classes against Phpunit 6 classes results in the full translation table leaving nine classes unresolved: * PHPUnit_Extensions_TicketListener * PHPUnit_Extensions_PhptTestSuite * PHPUnit_Extensions_TestDecorator * PHPUnit_Extensions_RepeatedTest * PHPUnit_Extensions_GroupTestSuite * PHPUnit_Util_Log_JSON * PHPUnit_Util_Log_TAP * PHPUnit_Util_String * PHPUnit_Util_PHPTest Issue: PHP-CS-Fixer#4417 Fixer: PhpUnitNamespacedFixer
ktomk
added a commit
to ktomk/PHP-CS-Fixer
that referenced
this issue
May 22, 2019
When cs-fix the name-space of the class PHPUnit_Framework_MockObject_Stub_Return it resulted in a new class name which causes a PHP parse error b/c of the reserved word "return" as the new class-name. Phpunit has renamed that class to ...\ReturnStub (5 -> 6). Fix is to translate it to the "new" name so that it transposes correctly. Similar but w/o parse error is PHPUnit_Framework_Error which now is PHPUnit\Framework\Error\Error. Comparing all Phpunit 5 classes against Phpunit 6 classes results in the full translation table leaving nine classes unresolved: * PHPUnit_Extensions_TicketListener * PHPUnit_Extensions_PhptTestSuite * PHPUnit_Extensions_TestDecorator * PHPUnit_Extensions_RepeatedTest * PHPUnit_Extensions_GroupTestSuite * PHPUnit_Util_Log_JSON * PHPUnit_Util_Log_TAP * PHPUnit_Util_String * PHPUnit_Util_PHPTest Issue: PHP-CS-Fixer#4417 Fixer: PhpUnitNamespacedFixer
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using the @PHPUnit60Migration:riky ruleset (effectively the PhpUnitNamespacedFixer) PHP-CS-Fixer was not able to fix files due to resulting the fixes into a PHP Parse error:
This is when changing the class PHPUnit_Framework_MockObject_Stub_Return into the new namespaced class PHPUnit\Framework\MockObject\Stub\Return.
Changing the class-name string
PHPUnit_Framework_MockObject_Stub_Return
toPHPUnit_Framework_MockObject_Stub_ReturnStub
results in the correct new typePHPUnit\Framework\MockObject\Stub\ReturnStub
.The PHP version you are using (
$ php -v
):PHP CS Fixer version you are using (
$ php-cs-fixer -V
):The command you use to run PHP CS Fixer:
The text was updated successfully, but these errors were encountered: