Skip to content

Commit

Permalink
[BUGFIX] Revert to previous method return-types in BaseTestClass
Browse files Browse the repository at this point in the history
To increase and maintain code quality has been added using
php-cs-fixer and typo3/coding-standards to this package.
CGL run changed two method return types in a way which leads
to a bunch of fails in core phpstan scans.

This is a already known bug of php-cs-fixer, reported for
version 3.5.0 but also 3.6.0 will change this the same way.

This patch reverts the return-type docblock change for

* 'BaseTestClass::getAccessibleMock()'
* 'BaseTestClass::getAccessibleMockForAbstractClass()'

and additional add following to composer.json conflict section:

    "friendsofphp/php-cs-fixer": "3.5.0 || 3.6.0"

Further reads:

PHP-CS-Fixer/PHP-CS-Fixer#6238
FriendsOfTYPO3/tea#371
FriendsOfTYPO3/tea@a999668

Releases: main, 7, 6
  • Loading branch information
sbuerk committed Mar 4, 2022
1 parent 1eb9c99 commit 22ea058
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Classes/Core/BaseTestCase.php
Expand Up @@ -39,7 +39,7 @@ abstract class BaseTestCase extends TestCase
* @param bool $callOriginalClone whether to call the __clone method
* @param bool $callAutoload whether to call any autoload function
*
* @return MockObject&AccessibleObjectInterface&T
* @return MockObject|AccessibleObjectInterface&T
* a mock of $originalClassName with access methods added
*
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -90,7 +90,7 @@ protected function getAccessibleMock(
* @param bool $callOriginalClone
* @param bool $callAutoload
* @param array $mockedMethods
* @return MockObject&AccessibleObjectInterface&T
* @return MockObject|AccessibleObjectInterface&T
*
* @throws \InvalidArgumentException
*/
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -40,7 +40,8 @@
"guzzlehttp/psr7": "^1.7 || ^2.0"
},
"conflict": {
"doctrine/dbal": "2.13.0 || 2.13.1"
"doctrine/dbal": "2.13.0 || 2.13.1",
"friendsofphp/php-cs-fixer": "3.5.0 || 3.6.0"
},
"config": {
"vendor-dir": ".Build/vendor",
Expand Down

0 comments on commit 22ea058

Please sign in to comment.