diff --git a/Build/phpstan/phpstan-baseline.neon b/Build/phpstan/phpstan-baseline.neon index 0ac47d74f80386a2b983cc3aa4ccdadd0b3e5692..96c77d1ce926e30bf66e1b4c357f4983868f47c5 100644 --- a/Build/phpstan/phpstan-baseline.neon +++ b/Build/phpstan/phpstan-baseline.neon @@ -1420,11 +1420,6 @@ parameters: count: 1 path: ../../typo3/sysext/core/Tests/Unit/Mail/TransportFactoryTest.php - - - message: "#^Property TYPO3\\\\CMS\\\\Core\\\\Tests\\\\Unit\\\\Messaging\\\\FlashMessageServiceTest\\:\\:\\$flashMessageService \\(PHPUnit\\\\Framework\\\\MockObject\\\\MockObject&TYPO3\\\\CMS\\\\Core\\\\Messaging\\\\FlashMessageService&TYPO3\\\\TestingFramework\\\\Core\\\\AccessibleObjectInterface\\) does not accept TYPO3\\\\CMS\\\\Core\\\\Messaging\\\\FlashMessageService\\.$#" - count: 1 - path: ../../typo3/sysext/core/Tests/Unit/Messaging/FlashMessageServiceTest.php - - message: "#^Method TYPO3\\\\CMS\\\\Core\\\\Tests\\\\Unit\\\\Migrations\\\\TcaMigrationTest\\:\\:evalEmailMigratedToTypeDataProvider\\(\\) is unused\\.$#" count: 1 @@ -1805,11 +1800,6 @@ parameters: count: 1 path: ../../typo3/sysext/extbase/Tests/Functional/Property/TypeConverter/PersistentObjectConverterTest.php - - - message: "#^Property TYPO3\\\\CMS\\\\Extbase\\\\Tests\\\\Unit\\\\Configuration\\\\FrontendConfigurationManagerTest\\:\\:\\$mockTypoScriptService \\(PHPUnit\\\\Framework\\\\MockObject\\\\MockObject&TYPO3\\\\CMS\\\\Core\\\\TypoScript\\\\TypoScriptService&TYPO3\\\\TestingFramework\\\\Core\\\\AccessibleObjectInterface\\) does not accept PHPUnit\\\\Framework\\\\MockObject\\\\MockObject&TYPO3\\\\CMS\\\\Core\\\\TypoScript\\\\TypoScriptService\\.$#" - count: 1 - path: ../../typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php - - message: "#^Parameter \\#1 \\$error of method TYPO3\\\\CMS\\\\Extbase\\\\Error\\\\Result\\:\\:addError\\(\\) expects TYPO3\\\\CMS\\\\Extbase\\\\Error\\\\Error, PHPUnit\\\\Framework\\\\MockObject\\\\MockObject given\\.$#" count: 3 diff --git a/typo3/sysext/adminpanel/Tests/Unit/Middleware/AdminPanelInitiatorTest.php b/typo3/sysext/adminpanel/Tests/Unit/Middleware/AdminPanelInitiatorTest.php index 168f989b9cc3f9861376869b16bcbfa26bf40bac..d84a1f710e31cd8739a76e1f012fd73707f0f306 100644 --- a/typo3/sysext/adminpanel/Tests/Unit/Middleware/AdminPanelInitiatorTest.php +++ b/typo3/sysext/adminpanel/Tests/Unit/Middleware/AdminPanelInitiatorTest.php @@ -114,8 +114,7 @@ class AdminPanelInitiatorTest extends UnitTestCase $adminPanelInitiator = new AdminPanelInitiator(); $adminPanelInitiator->process($request, $handler); - /** @var MainController&MockObject $controller */ - $controller = GeneralUtility::makeInstance(MainController::class); + GeneralUtility::makeInstance(MainController::class); } protected function getHandlerMock(): RequestHandlerInterface&MockObject diff --git a/typo3/sysext/backend/Tests/Functional/Controller/Page/LocalizationControllerTest.php b/typo3/sysext/backend/Tests/Functional/Controller/Page/LocalizationControllerTest.php index 9126187e176ee3dd613164657dfc94cb03639ec2..8f5d94b3efaaad66f21386993e8d006ab1748ddc 100644 --- a/typo3/sysext/backend/Tests/Functional/Controller/Page/LocalizationControllerTest.php +++ b/typo3/sysext/backend/Tests/Functional/Controller/Page/LocalizationControllerTest.php @@ -27,10 +27,7 @@ use TYPO3\TestingFramework\Core\AccessibleObjectInterface; class LocalizationControllerTest extends AbstractDataHandlerActionTestCase { - /** - * @var LocalizationController|MockObject|AccessibleObjectInterface - */ - protected $subject; + protected LocalizationController&MockObject&AccessibleObjectInterface $subject; protected BackendUserAuthentication $backendUser; diff --git a/typo3/sysext/backend/Tests/Functional/Controller/Page/TreeControllerTest.php b/typo3/sysext/backend/Tests/Functional/Controller/Page/TreeControllerTest.php index 975f7ef07e97d20760b5da83c22712ea1d14e0aa..d51488fb51b34d969309de06c9b81ad5536391f7 100644 --- a/typo3/sysext/backend/Tests/Functional/Controller/Page/TreeControllerTest.php +++ b/typo3/sysext/backend/Tests/Functional/Controller/Page/TreeControllerTest.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Backend\Tests\Functional\Controller\Page; +use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\DependencyInjection\Container; use TYPO3\CMS\Backend\Controller\Event\AfterPageTreeItemsPreparedEvent; use TYPO3\CMS\Backend\Controller\Page\TreeController; @@ -44,10 +45,7 @@ class TreeControllerTest extends FunctionalTestCase protected array $coreExtensionsToLoad = ['workspaces']; - /** - * @var TreeController|AccessibleObjectInterface - */ - private $subject; + private TreeController&MockObject&AccessibleObjectInterface $subject; private BackendUserAuthentication $backendUser; diff --git a/typo3/sysext/backend/Tests/Functional/View/Drawing/BackendLayoutRendererTest.php b/typo3/sysext/backend/Tests/Functional/View/Drawing/BackendLayoutRendererTest.php index d296a2854c2ca01242b2c3076aa2fced130a2347..c85c37417d8085788c023e6467a8eb332fd05856 100644 --- a/typo3/sysext/backend/Tests/Functional/View/Drawing/BackendLayoutRendererTest.php +++ b/typo3/sysext/backend/Tests/Functional/View/Drawing/BackendLayoutRendererTest.php @@ -67,7 +67,7 @@ class BackendLayoutRendererTest extends FunctionalTestCase parent::tearDown(); } - protected function getPageLayoutContext(int $pageId, array $configuration): PageLayoutContext|MockObject + protected function getPageLayoutContext(int $pageId, array $configuration): PageLayoutContext&MockObject { $backendLayout = new BackendLayout('layout1', 'Layout 1', $configuration); return $this->createConfiguredMock( diff --git a/typo3/sysext/backend/Tests/Unit/Controller/File/ThumbnailControllerTest.php b/typo3/sysext/backend/Tests/Unit/Controller/File/ThumbnailControllerTest.php index c7041d9b13e58d429fc65286aaf80e10edd2119c..107c027925bde869a140fc0966e572c979d2ebd4 100644 --- a/typo3/sysext/backend/Tests/Unit/Controller/File/ThumbnailControllerTest.php +++ b/typo3/sysext/backend/Tests/Unit/Controller/File/ThumbnailControllerTest.php @@ -29,10 +29,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; */ class ThumbnailControllerTest extends UnitTestCase { - /** - * @var ThumbnailController|MockObject - */ - protected MockObject $subject; + protected ThumbnailController&MockObject $subject; protected static array $parameters = [ 'fileId' => 123, diff --git a/typo3/sysext/backend/Tests/Unit/Controller/SwitchUserControllerTest.php b/typo3/sysext/backend/Tests/Unit/Controller/SwitchUserControllerTest.php index e386af1e1b18229af57ddcc2459add5b04012b93..3baef9f62f96ab6ae7ed77f70d09e5f95f365353 100644 --- a/typo3/sysext/backend/Tests/Unit/Controller/SwitchUserControllerTest.php +++ b/typo3/sysext/backend/Tests/Unit/Controller/SwitchUserControllerTest.php @@ -30,10 +30,7 @@ class SwitchUserControllerTest extends UnitTestCase */ protected const RECENT_USERS_LIMIT = 3; - /** - * @var SwitchUserController|MockObject|AccessibleObjectInterface - */ - protected $subject; + protected SwitchUserController&MockObject&AccessibleObjectInterface $subject; protected function setUp(): void { diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseDefaultLanguagePageRowTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseDefaultLanguagePageRowTest.php index c37b2e8b93c271aa34d10a871e97405dfcbc45a6..af12ed27dd725e07852db33a97a42f50eac08ab5 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseDefaultLanguagePageRowTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseDefaultLanguagePageRowTest.php @@ -27,10 +27,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class DatabaseDefaultLanguagePageRowTest extends UnitTestCase { - /** - * @var DatabaseDefaultLanguagePageRow|MockObject - */ - protected MockObject $subject; + protected DatabaseDefaultLanguagePageRow&MockObject $subject; protected function setUp(): void { diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseEditRowTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseEditRowTest.php index 6658b7144d1e413516b2a92e492214f8aa2f1fc8..f23ab7573f05364a12bd9bb9943b15e84e56e128 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseEditRowTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseEditRowTest.php @@ -29,10 +29,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class DatabaseEditRowTest extends UnitTestCase { - /** - * @var DatabaseEditRow|MockObject - */ - protected MockObject $subject; + protected DatabaseEditRow&MockObject $subject; protected function setUp(): void { diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabasePageLanguageOverlayRowsTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabasePageLanguageOverlayRowsTest.php index 31f8d09d07678b19fee084bd0d9335c3a56bd5a4..41678bfbea2891eb0e08ad63a927932e080c7001 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabasePageLanguageOverlayRowsTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabasePageLanguageOverlayRowsTest.php @@ -23,10 +23,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class DatabasePageLanguageOverlayRowsTest extends UnitTestCase { - /** - * @var DatabasePageLanguageOverlayRows|MockObject - */ - protected MockObject $subject; + protected DatabasePageLanguageOverlayRows&MockObject $subject; protected function setUp(): void { diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseParentPageRowTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseParentPageRowTest.php index 1a23a1ed3f6ae3798457fd9d31ab65c22d446e54..79ed8e4be2ab1c1563dd410beb423cc8f53f7579 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseParentPageRowTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseParentPageRowTest.php @@ -23,10 +23,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class DatabaseParentPageRowTest extends UnitTestCase { - /** - * @var DatabaseParentPageRow|MockObject - */ - protected MockObject $subject; + protected DatabaseParentPageRow&MockObject $subject; protected function setUp(): void { diff --git a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRecordTypeValueTest.php b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRecordTypeValueTest.php index 438267957849e629aef84795eb608cbc4bcb3093..dc5ec39791700217f7665b574d34d2ea11d1621f 100644 --- a/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRecordTypeValueTest.php +++ b/typo3/sysext/backend/Tests/Unit/Form/FormDataProvider/DatabaseRecordTypeValueTest.php @@ -23,10 +23,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class DatabaseRecordTypeValueTest extends UnitTestCase { - /** - * @var DatabaseRecordTypeValue|MockObject - */ - protected MockObject $subject; + protected DatabaseRecordTypeValue&MockObject $subject; protected function setUp(): void { diff --git a/typo3/sysext/backend/Tests/Unit/View/BackendLayoutViewTest.php b/typo3/sysext/backend/Tests/Unit/View/BackendLayoutViewTest.php index 3a44cf1c5245b1e4f505e6b587636b2bc08d790a..6b2fee6ce72fa55ab12eb0bef1d173c4c7f00bb8 100644 --- a/typo3/sysext/backend/Tests/Unit/View/BackendLayoutViewTest.php +++ b/typo3/sysext/backend/Tests/Unit/View/BackendLayoutViewTest.php @@ -24,10 +24,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class BackendLayoutViewTest extends UnitTestCase { - /** - * @var BackendLayoutView|MockObject|AccessibleObjectInterface - */ - protected $backendLayoutView; + protected BackendLayoutView&MockObject&AccessibleObjectInterface $backendLayoutView; /** * Sets up this test case. diff --git a/typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php b/typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php index 79d5262c030d3ba6e91748b35d5946fff2f4046f..7a6e8a7680fbe9a8d44baf5df0162464464d1ddb 100644 --- a/typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php +++ b/typo3/sysext/core/Tests/Unit/Configuration/ConfigurationManagerTest.php @@ -26,10 +26,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class ConfigurationManagerTest extends UnitTestCase { - /** - * @var ConfigurationManager|MockObject - */ - protected $subject; + protected ConfigurationManager&MockObject $subject; protected function setUp(): void { diff --git a/typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php b/typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php index 806e48135d8b9a92d642ae0c1ea5fa32dbbc884b..c3d96f5c11bd87e5a9d71d2db591609740fd89b4 100644 --- a/typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php +++ b/typo3/sysext/core/Tests/Unit/Core/SystemEnvironmentBuilderTest.php @@ -17,8 +17,10 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\Unit\Core; +use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Utility\StringUtility; +use TYPO3\TestingFramework\Core\AccessibleObjectInterface; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; /** @@ -26,10 +28,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; */ class SystemEnvironmentBuilderTest extends UnitTestCase { - /** - * @var \TYPO3\CMS\Core\Core\SystemEnvironmentBuilder|\TYPO3\TestingFramework\Core\AccessibleObjectInterface - */ - protected $subject; + protected SystemEnvironmentBuilder&MockObject&AccessibleObjectInterface $subject; protected function setUp(): void { diff --git a/typo3/sysext/core/Tests/Unit/Database/ConnectionTest.php b/typo3/sysext/core/Tests/Unit/Database/ConnectionTest.php index 8776aafe27b6651c851cc485ebd0bf1cb82b0453..f1f79c78defe65f1461432351abb66abdf76edd6 100644 --- a/typo3/sysext/core/Tests/Unit/Database/ConnectionTest.php +++ b/typo3/sysext/core/Tests/Unit/Database/ConnectionTest.php @@ -22,6 +22,7 @@ use Doctrine\DBAL\Driver\AbstractMySQLDriver; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Result; +use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Database\Query\Expression\ExpressionBuilder; use TYPO3\CMS\Core\Database\Query\QueryBuilder; @@ -31,10 +32,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class ConnectionTest extends UnitTestCase { - /** - * @var Connection|\PHPUnit\Framework\MockObject\MockObject - */ - protected $connection; + protected Connection&MockObject $connection; protected ?AbstractPlatform $platform; protected string $testTable = 'testTable'; diff --git a/typo3/sysext/core/Tests/Unit/Error/DebugExceptionHandlerTest.php b/typo3/sysext/core/Tests/Unit/Error/DebugExceptionHandlerTest.php index 992815e8b253d307e29fe5027d57e805d647e174..279be65257c704108cccfc0b03a1975a8b362ffb 100644 --- a/typo3/sysext/core/Tests/Unit/Error/DebugExceptionHandlerTest.php +++ b/typo3/sysext/core/Tests/Unit/Error/DebugExceptionHandlerTest.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\Unit\Error; +use PHPUnit\Framework\MockObject\MockObject; use Psr\Log\LoggerInterface; use Psr\Log\LoggerTrait; use TYPO3\CMS\Core\Error\DebugExceptionHandler; @@ -28,10 +29,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; */ class DebugExceptionHandlerTest extends UnitTestCase { - /** - * @var \TYPO3\CMS\Core\Error\DebugExceptionHandler|\PHPUnit\Framework\MockObject\MockObject - */ - protected $subject; + protected DebugExceptionHandler&MockObject $subject; /** * Sets up this test case. diff --git a/typo3/sysext/core/Tests/Unit/FormProtection/InstallToolFormProtectionTest.php b/typo3/sysext/core/Tests/Unit/FormProtection/InstallToolFormProtectionTest.php index 90bcb6cd7aa2c88ad8182feb258490537f7642f4..22ac69ebbb8408b3d057b8c1352aab6da9386520 100644 --- a/typo3/sysext/core/Tests/Unit/FormProtection/InstallToolFormProtectionTest.php +++ b/typo3/sysext/core/Tests/Unit/FormProtection/InstallToolFormProtectionTest.php @@ -17,8 +17,10 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\Unit\FormProtection; +use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Core\FormProtection\InstallToolFormProtection; use TYPO3\CMS\Core\Utility\GeneralUtility; +use TYPO3\TestingFramework\Core\AccessibleObjectInterface; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; /** @@ -26,10 +28,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; */ class InstallToolFormProtectionTest extends UnitTestCase { - /** - * @var \TYPO3\CMS\Core\FormProtection\InstallToolFormProtection|\PHPUnit\Framework\MockObject\MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface - */ - protected $subject; + protected InstallToolFormProtection&MockObject&AccessibleObjectInterface $subject; protected function setUp(): void { diff --git a/typo3/sysext/core/Tests/Unit/Locking/LockFactoryTest.php b/typo3/sysext/core/Tests/Unit/Locking/LockFactoryTest.php index d9065779f388e34a5707e63fa350b37d7ad84d85..ab922106405f6e7699e5fd7682a1cf5e501c4fc0 100644 --- a/typo3/sysext/core/Tests/Unit/Locking/LockFactoryTest.php +++ b/typo3/sysext/core/Tests/Unit/Locking/LockFactoryTest.php @@ -33,10 +33,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; */ class LockFactoryTest extends UnitTestCase { - /** - * @var LockFactory|MockObject|AccessibleObjectInterface - */ - protected $mockFactory; + protected LockFactory&MockObject&AccessibleObjectInterface $mockFactory; /** * @var array diff --git a/typo3/sysext/core/Tests/Unit/Log/Processor/IntrospectionProcessorTest.php b/typo3/sysext/core/Tests/Unit/Log/Processor/IntrospectionProcessorTest.php index ce7c61fa9a565a050ba72933d8bd8620e4a5819c..772c8ddd27730c545b240fd5cd0e75fabe7a5ab0 100644 --- a/typo3/sysext/core/Tests/Unit/Log/Processor/IntrospectionProcessorTest.php +++ b/typo3/sysext/core/Tests/Unit/Log/Processor/IntrospectionProcessorTest.php @@ -25,10 +25,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class IntrospectionProcessorTest extends UnitTestCase { - /** - * @var MockObject|IntrospectionProcessor - */ - protected $processor; + protected IntrospectionProcessor&MockObject $processor; /** * A dummy result for the debug_backtrace function diff --git a/typo3/sysext/core/Tests/Unit/Messaging/FlashMessageServiceTest.php b/typo3/sysext/core/Tests/Unit/Messaging/FlashMessageServiceTest.php index 1e3f8fd0a9618de989be7db6feafe2b548d0fe23..70a209fe6f2e2e3dafd39aaed2e9866ca386694e 100644 --- a/typo3/sysext/core/Tests/Unit/Messaging/FlashMessageServiceTest.php +++ b/typo3/sysext/core/Tests/Unit/Messaging/FlashMessageServiceTest.php @@ -17,17 +17,12 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\Unit\Messaging; -use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Core\Messaging\FlashMessageService; -use TYPO3\TestingFramework\Core\AccessibleObjectInterface; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class FlashMessageServiceTest extends UnitTestCase { - /** - * @var FlashMessageService|MockObject|AccessibleObjectInterface - */ - protected $flashMessageService; + protected FlashMessageService $flashMessageService; protected function setUp(): void { diff --git a/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php b/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php index 92c59f536abf6bc4af757c0ceef4074bdefb6de3..fcc4e54687d8a8d9ace06a759ed6d076ba34d010 100644 --- a/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php +++ b/typo3/sysext/core/Tests/Unit/Package/PackageManagerTest.php @@ -40,10 +40,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; */ class PackageManagerTest extends UnitTestCase { - /** - * @var PackageManager|MockObject|AccessibleObjectInterface $packageManager - */ - protected $packageManager; + protected PackageManager&MockObject&AccessibleObjectInterface $packageManager; protected string $testRoot; diff --git a/typo3/sysext/core/Tests/Unit/Resource/Index/ExtractorRegistryTest.php b/typo3/sysext/core/Tests/Unit/Resource/Index/ExtractorRegistryTest.php index 3ed57339f5af48aa55c7bacb3eafa06a1b2b5cb7..c052f711e43a9ddc70e45a0f67cb286936281281 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/Index/ExtractorRegistryTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/Index/ExtractorRegistryTest.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\Unit\Resource\Index; +use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Core\Resource\Index\ExtractorInterface; use TYPO3\CMS\Core\Resource\Index\ExtractorRegistry; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; @@ -205,10 +206,8 @@ class ExtractorRegistryTest extends UnitTestCase /** * Initialize an ExtractorRegistry and mock createExtractorInstance() - * - * @return \PHPUnit\Framework\MockObject\MockObject|\TYPO3\CMS\Core\Resource\Index\ExtractorRegistry */ - protected function getMockExtractorRegistry(array $createsExtractorInstances = []) + protected function getMockExtractorRegistry(array $createsExtractorInstances = []): ExtractorRegistry&MockObject { $extractorRegistry = $this->getMockBuilder(ExtractorRegistry::class) ->onlyMethods(['createExtractorInstance']) diff --git a/typo3/sysext/core/Tests/Unit/Resource/OnlineMedia/Helpers/VimeoHelperTest.php b/typo3/sysext/core/Tests/Unit/Resource/OnlineMedia/Helpers/VimeoHelperTest.php index 56b8c5980217ac5169cc43f50ed074df4980f692..6972bf2e2ca57e90c6510541dcff470270f0e77f 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/OnlineMedia/Helpers/VimeoHelperTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/OnlineMedia/Helpers/VimeoHelperTest.php @@ -28,10 +28,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; */ class VimeoHelperTest extends UnitTestCase { - /** - * @var VimeoHelper|MockObject - */ - protected $subject; + protected VimeoHelper&MockObject $subject; protected ?string $extension; diff --git a/typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php b/typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php index 4f756dafa04278fa4a4f00be86136b9ea701f961..497d3468e515c556ce07d9431f3a04d8ac8f4818 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/ProcessedFileTest.php @@ -33,15 +33,9 @@ class ProcessedFileTest extends UnitTestCase { protected bool $resetSingletonInstances = true; - /** - * @var MockObject|Folder - */ - protected $folderMock; + protected Folder&MockObject $folderMock; - /** - * @var MockObject|ResourceStorage - */ - protected $storageMock; + protected ResourceStorage&MockObject $storageMock; protected array $databaseRow = []; diff --git a/typo3/sysext/core/Tests/Unit/Resource/Rendering/RendererRegistryTest.php b/typo3/sysext/core/Tests/Unit/Resource/Rendering/RendererRegistryTest.php index cb3f9f004ef22df78270cf7f0b1a508639da749b..7ae57028506be5293df8baa52aa89fe99a461630 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/Rendering/RendererRegistryTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/Rendering/RendererRegistryTest.php @@ -30,10 +30,8 @@ class RendererRegistryTest extends UnitTestCase { /** * Initialize a RendererRegistry and mock createRendererInstance() - * - * @return MockObject|RendererRegistry */ - protected function getTestRendererRegistry(array $createsRendererInstances = []) + protected function getTestRendererRegistry(array $createsRendererInstances = []): RendererRegistry&MockObject { $rendererRegistry = $this->getMockBuilder(RendererRegistry::class) ->onlyMethods(['createRendererInstance']) diff --git a/typo3/sysext/core/Tests/Unit/Resource/Rendering/VimeoRendererTest.php b/typo3/sysext/core/Tests/Unit/Resource/Rendering/VimeoRendererTest.php index d57bf0645ef0fae67e32e0e3cbf8d318bec15745..6d335f454233d204523223479d6abc86644ad68e 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/Rendering/VimeoRendererTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/Rendering/VimeoRendererTest.php @@ -29,10 +29,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; */ class VimeoRendererTest extends UnitTestCase { - /** - * @var VimeoRenderer|MockObject - */ - protected $subject; + protected VimeoRenderer&MockObject $subject; protected function setUp(): void { diff --git a/typo3/sysext/core/Tests/Unit/Resource/Rendering/YouTubeRendererTest.php b/typo3/sysext/core/Tests/Unit/Resource/Rendering/YouTubeRendererTest.php index d37ca2f289a2d94d24280caa1995e5b9905af3d8..7c22f493c1f2d0646860fee4d62698eb3e6f1122 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/Rendering/YouTubeRendererTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/Rendering/YouTubeRendererTest.php @@ -29,10 +29,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; */ class YouTubeRendererTest extends UnitTestCase { - /** - * @var YouTubeRenderer|MockObject - */ - protected $subject; + protected YouTubeRenderer&MockObject $subject; protected function setUp(): void { diff --git a/typo3/sysext/core/Tests/Unit/Resource/Service/ExtractorServiceTest.php b/typo3/sysext/core/Tests/Unit/Resource/Service/ExtractorServiceTest.php index 5954c1aac1df84c70efc8d46aecd795f2c6e2471..34fa1cbd938db5a632435eb9e07ff64289fc5c24 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/Service/ExtractorServiceTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/Service/ExtractorServiceTest.php @@ -227,7 +227,6 @@ class ExtractorServiceTest extends UnitTestCase $storageMock = $this->createMock(ResourceStorage::class); $storageMock->method('getDriverType')->willReturn('Local'); - /** @var ExtractorService|\PHPUnit\Framework\MockObject\MockObject $subject */ $subject = $this->getMockBuilder(ExtractorService::class) ->setMethods(['getExtractorRegistry']) ->getMock() @@ -268,7 +267,6 @@ class ExtractorServiceTest extends UnitTestCase 'baz' => 'second', ]); - /** @var ExtractorRegistry|\PHPUnit\Framework\MockObject\MockObject $extractorRegistryMock */ $extractorRegistryMock = $this->getMockBuilder(ExtractorRegistry::class) ->setMethods(['createExtractorInstance']) ->getMock(); diff --git a/typo3/sysext/core/Tests/Unit/Resource/TextExtraction/TextExtractorRegistryTest.php b/typo3/sysext/core/Tests/Unit/Resource/TextExtraction/TextExtractorRegistryTest.php index 2023cd8168d08831017f5e15cf9eb2a58c73e5a0..b73eb3ee2daaa8c9a961aea19ecb2101ad00c59a 100644 --- a/typo3/sysext/core/Tests/Unit/Resource/TextExtraction/TextExtractorRegistryTest.php +++ b/typo3/sysext/core/Tests/Unit/Resource/TextExtraction/TextExtractorRegistryTest.php @@ -30,10 +30,8 @@ class TextExtractorRegistryTest extends UnitTestCase { /** * Initialize a TextExtractorRegistry and mock createTextExtractorInstance() - * - * @return MockObject|TextExtractorRegistry */ - protected function getTextExtractorRegistry(array $createsTextExtractorInstances = []) + protected function getTextExtractorRegistry(array $createsTextExtractorInstances = []): TextExtractorRegistry&MockObject { $textExtractorRegistry = $this->getMockBuilder(TextExtractorRegistry::class) ->onlyMethods(['createTextExtractorInstance']) diff --git a/typo3/sysext/core/Tests/UnitDeprecated/Domain/Repository/PageRepositoryTest.php b/typo3/sysext/core/Tests/UnitDeprecated/Domain/Repository/PageRepositoryTest.php index 6bd687593d6adc40b6d508d0679676e3bb0ad612..488f90f4c956488c1472d2f6c060b53a28407589 100644 --- a/typo3/sysext/core/Tests/UnitDeprecated/Domain/Repository/PageRepositoryTest.php +++ b/typo3/sysext/core/Tests/UnitDeprecated/Domain/Repository/PageRepositoryTest.php @@ -17,19 +17,18 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\UnitDeprecated\Domain\Repository; +use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Core\Context\Context; use TYPO3\CMS\Core\Core\SystemEnvironmentBuilder; use TYPO3\CMS\Core\Domain\Repository\PageRepository; use TYPO3\CMS\Core\Http\NormalizedParams; use TYPO3\CMS\Core\Http\ServerRequest; +use TYPO3\TestingFramework\Core\AccessibleObjectInterface; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class PageRepositoryTest extends UnitTestCase { - /** - * @var PageRepository|\TYPO3\TestingFramework\Core\AccessibleObjectInterface - */ - protected $pageSelectObject; + protected PageRepository&MockObject&AccessibleObjectInterface $pageSelectObject; protected array $defaultTcaForPages = [ 'ctrl' => [ diff --git a/typo3/sysext/core/Tests/UnitDeprecated/TypoScript/Parser/TypoScriptParserTest.php b/typo3/sysext/core/Tests/UnitDeprecated/TypoScript/Parser/TypoScriptParserTest.php index 7d1f1e3424c4192147f115a2963c72d547021d37..fb69ea7779d9811299ca66019fe07589bea3461b 100644 --- a/typo3/sysext/core/Tests/UnitDeprecated/TypoScript/Parser/TypoScriptParserTest.php +++ b/typo3/sysext/core/Tests/UnitDeprecated/TypoScript/Parser/TypoScriptParserTest.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Core\Tests\UnitDeprecated\TypoScript\Parser; +use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Backend\Configuration\TypoScript\ConditionMatching\ConditionMatcher; use TYPO3\CMS\Core\Cache\CacheManager; use TYPO3\CMS\Core\Cache\Frontend\NullFrontend; @@ -28,10 +29,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class TypoScriptParserTest extends UnitTestCase { - /** - * @var TypoScriptParser|AccessibleObjectInterface - */ - protected $typoScriptParser; + protected TypoScriptParser&MockObject&AccessibleObjectInterface $typoScriptParser; protected function setUp(): void { diff --git a/typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php b/typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php index 7f667498c15b434c1d0f81f2463dc9bc200bdffa..2b1d305767931cdadc1cec3271e0a8c1a660d218 100644 --- a/typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Configuration/FrontendConfigurationManagerTest.php @@ -33,20 +33,11 @@ class FrontendConfigurationManagerTest extends UnitTestCase { protected bool $resetSingletonInstances = true; - /** - * @var ContentObjectRenderer|MockObject - */ - protected $mockContentObject; + protected ContentObjectRenderer&MockObject $mockContentObject; - /** - * @var FrontendConfigurationManager|MockObject|AccessibleObjectInterface - */ - protected $frontendConfigurationManager; + protected FrontendConfigurationManager&MockObject&AccessibleObjectInterface $frontendConfigurationManager; - /** - * @var TypoScriptService|MockObject|AccessibleObjectInterface - */ - protected $mockTypoScriptService; + protected TypoScriptService&MockObject $mockTypoScriptService; protected array $testTypoScriptSetup = [ 'foo.' => [ diff --git a/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php b/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php index c1f8888098363c550c5c21d6eb521348c1a76be0..b9815c3dee68a4ee79de3d9bbf89edfde47d01a9 100644 --- a/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Mvc/Web/Routing/UriBuilderTest.php @@ -58,25 +58,13 @@ class UriBuilderTest extends UnitTestCase */ protected $mockConfigurationManager; - /** - * @var ContentObjectRenderer|MockObject - */ - protected $mockContentObject; + protected ContentObjectRenderer&MockObject $mockContentObject; - /** - * @var Request|MockObject - */ - protected $mockRequest; + protected Request&MockObject $mockRequest; - /** - * @var ExtensionService|MockObject - */ - protected $mockExtensionService; + protected ExtensionService&MockObject $mockExtensionService; - /** - * @var UriBuilder|MockObject|AccessibleObjectInterface - */ - protected $uriBuilder; + protected UriBuilder&MockObject&AccessibleObjectInterface $uriBuilder; /** * @throws \InvalidArgumentException diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/BackendTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/BackendTest.php index d8a0c74c1d01f5f5f21c4f3d052f914e246d46fa..85a3cf0ec4c5899fc1547f454c9e8bb3bf172da6 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/BackendTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/BackendTest.php @@ -41,17 +41,11 @@ class BackendTest extends UnitTestCase */ public function insertRelationInRelationtableSetsMmMatchFieldsInRow(): void { - /* \TYPO3\CMS\Extbase\Persistence\Generic\Backend|\PHPUnit\Framework\MockObject\MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface */ $fixture = $this->getAccessibleMock(Backend::class, null, [], '', false); - /* \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper|\PHPUnit\Framework\MockObject\MockObject */ $dataMapFactory = $this->createMock(DataMapFactory::class); - /* \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap|\PHPUnit\Framework\MockObject\MockObject */ $dataMap = $this->createMock(DataMap::class); - /* \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap|\PHPUnit\Framework\MockObject\MockObject */ $columnMap = $this->createMock(ColumnMap::class); - /* \TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface|\PHPUnit\Framework\MockObject\MockObject */ $storageBackend = $this->createMock(BackendInterface::class); - /* \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface|\PHPUnit\Framework\MockObject\MockObject */ $domainObject = $this->createMock(DomainObjectInterface::class); $mmMatchFields = [ diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php index dfec862b45d5730e6b6f8dba1b7008694091c6d5..4ae2ca33bfabd5f2c9633d7ea50385df27d14d9f 100644 --- a/typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php +++ b/typo3/sysext/extbase/Tests/Unit/Persistence/RepositoryTest.php @@ -40,10 +40,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class RepositoryTest extends UnitTestCase { - /** - * @var Repository|MockObject|AccessibleObjectInterface - */ - protected $repository; + protected Repository&MockObject&AccessibleObjectInterface $repository; /** * @var QueryFactory diff --git a/typo3/sysext/extbase/Tests/UnitDeprecated/Persistence/RepositoryTest.php b/typo3/sysext/extbase/Tests/UnitDeprecated/Persistence/RepositoryTest.php index 5382adbb2aa43f1ea53a4bfb2f24c4f6e4f8d231..d9b94ad3224a5aa593e7b4de1edd8c76022d00c4 100644 --- a/typo3/sysext/extbase/Tests/UnitDeprecated/Persistence/RepositoryTest.php +++ b/typo3/sysext/extbase/Tests/UnitDeprecated/Persistence/RepositoryTest.php @@ -34,10 +34,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class RepositoryTest extends UnitTestCase { - /** - * @var Repository|MockObject|AccessibleObjectInterface - */ - protected $repository; + protected Repository&MockObject&AccessibleObjectInterface $repository; /** * @var QueryFactory diff --git a/typo3/sysext/fluid/Tests/Unit/View/AbstractTemplateViewTest.php b/typo3/sysext/fluid/Tests/Unit/View/AbstractTemplateViewTest.php index 4a8371774114a936054cb046eef6673f3c8adb7f..cee6f9e1395e11516aea3924bbe7e135acab9191 100644 --- a/typo3/sysext/fluid/Tests/Unit/View/AbstractTemplateViewTest.php +++ b/typo3/sysext/fluid/Tests/Unit/View/AbstractTemplateViewTest.php @@ -17,6 +17,7 @@ declare(strict_types=1); namespace TYPO3\CMS\Fluid\Tests\Unit\View; +use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Fluid\Core\Rendering\RenderingContext; use TYPO3\CMS\Fluid\View\AbstractTemplateView; use TYPO3\TestingFramework\Core\AccessibleObjectInterface; @@ -25,20 +26,11 @@ use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer; class AbstractTemplateViewTest extends UnitTestCase { - /** - * @var AbstractTemplateView|AccessibleObjectInterface - */ - protected $view; + protected AbstractTemplateView&MockObject&AccessibleObjectInterface $view; - /** - * @var RenderingContext|\PHPUnit\Framework\MockObject\MockObject - */ - protected $renderingContext; + protected RenderingContext&MockObject $renderingContext; - /** - * @var ViewHelperVariableContainer|\PHPUnit\Framework\MockObject\MockObject - */ - protected $viewHelperVariableContainer; + protected ViewHelperVariableContainer&MockObject $viewHelperVariableContainer; /** * Sets up this test case diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php index e90beb9b34f94f5b0ead2ecff3c5acff002cbe97..68315697e6d1e4ae756c2455d16931cec2ea5186 100644 --- a/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php +++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php @@ -103,15 +103,9 @@ class ContentObjectRendererTest extends UnitTestCase protected bool $resetSingletonInstances = true; - /** - * @var MockObject|AccessibleObjectInterface|ContentObjectRenderer - */ - protected MockObject $subject; + protected ContentObjectRenderer&MockObject&AccessibleObjectInterface $subject; - /** - * @var MockObject|TypoScriptFrontendController|AccessibleObjectInterface - */ - protected MockObject $frontendControllerMock; + protected TypoScriptFrontendController&MockObject&AccessibleObjectInterface $frontendControllerMock; /** * Default content object name -> class name map, shipped with TYPO3 CMS @@ -1828,10 +1822,7 @@ class ContentObjectRendererTest extends UnitTestCase $this->subject->render($contentObjectFixture, $configuration); } - /** - * @return MockObject|AbstractContentObject - */ - protected function createContentObjectThrowingExceptionFixture(bool $addProductionExceptionHandlerInstance = true) + protected function createContentObjectThrowingExceptionFixture(bool $addProductionExceptionHandlerInstance = true): AbstractContentObject&MockObject { $contentObjectFixture = $this->getMockBuilder(AbstractContentObject::class) ->getMock(); diff --git a/typo3/sysext/frontend/Tests/Unit/ContentObject/ImageContentObjectTest.php b/typo3/sysext/frontend/Tests/Unit/ContentObject/ImageContentObjectTest.php index 841e14b4d0817e9a49053f05d1f9e1929ed0af3a..87be6255d4f8a39493914b7382b894c68dd88d4b 100644 --- a/typo3/sysext/frontend/Tests/Unit/ContentObject/ImageContentObjectTest.php +++ b/typo3/sysext/frontend/Tests/Unit/ContentObject/ImageContentObjectTest.php @@ -36,7 +36,7 @@ class ImageContentObjectTest extends UnitTestCase { protected bool $resetSingletonInstances = true; - protected ImageContentObject|MockObject|AccessibleObjectInterface $subject; + protected ImageContentObject&MockObject&AccessibleObjectInterface $subject; protected function setUp(): void { diff --git a/typo3/sysext/frontend/Tests/Unit/Typolink/AbstractTypolinkBuilderTest.php b/typo3/sysext/frontend/Tests/Unit/Typolink/AbstractTypolinkBuilderTest.php index 0410d64aebb6c7e45e4df6fbe66472917ccf2ea8..1b428992095882b344807547625be71b32d4b35a 100644 --- a/typo3/sysext/frontend/Tests/Unit/Typolink/AbstractTypolinkBuilderTest.php +++ b/typo3/sysext/frontend/Tests/Unit/Typolink/AbstractTypolinkBuilderTest.php @@ -28,7 +28,6 @@ use TYPO3\CMS\Core\Utility\StringUtility; use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer; use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController; use TYPO3\CMS\Frontend\Typolink\AbstractTypolinkBuilder; -use TYPO3\TestingFramework\Core\AccessibleObjectInterface; use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class AbstractTypolinkBuilderTest extends UnitTestCase @@ -37,7 +36,7 @@ class AbstractTypolinkBuilderTest extends UnitTestCase protected bool $backupEnvironment = true; - protected MockObject|TypoScriptFrontendController|AccessibleObjectInterface $frontendControllerMock; + protected TypoScriptFrontendController&MockObject $frontendControllerMock; protected function setUp(): void { diff --git a/typo3/sysext/impexp/Tests/Functional/ExportTest.php b/typo3/sysext/impexp/Tests/Functional/ExportTest.php index ee54bc9879da11c2683cdb032f050592d15e155d..c87ee0e98b3d3d6fa320b3ba19a18fe53adefcbb 100644 --- a/typo3/sysext/impexp/Tests/Functional/ExportTest.php +++ b/typo3/sysext/impexp/Tests/Functional/ExportTest.php @@ -31,10 +31,7 @@ class ExportTest extends AbstractImportExportTestCase 'typo3/sysext/impexp/Tests/Functional/Fixtures/Extensions/template_extension', ]; - /** - * @var Export|MockObject|AccessibleObjectInterface - */ - protected $exportMock; + protected Export&MockObject&AccessibleObjectInterface $exportMock; protected array $recordTypesIncludeFields = [ diff --git a/typo3/sysext/impexp/Tests/Functional/ImportExportTest.php b/typo3/sysext/impexp/Tests/Functional/ImportExportTest.php index b6acec8b8555ca3a9d64e0c91425c0d441704751..368cc270dfa48e667b5fdb09cf9b487330ece3bb 100644 --- a/typo3/sysext/impexp/Tests/Functional/ImportExportTest.php +++ b/typo3/sysext/impexp/Tests/Functional/ImportExportTest.php @@ -32,10 +32,7 @@ class ImportExportTest extends AbstractImportExportTestCase 'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_mnattributesimple', ]; - /** - * @var Export|MockObject|AccessibleObjectInterface - */ - protected $exportMock; + protected Export&MockObject&AccessibleObjectInterface $exportMock; protected function setUp(): void { diff --git a/typo3/sysext/impexp/Tests/Unit/ExportTest.php b/typo3/sysext/impexp/Tests/Unit/ExportTest.php index d7ea3c641a63577818ff7ae77712033494cc4e59..63bc4ec0945fdc8a1a5ceb416df636d2a7cc8fb5 100644 --- a/typo3/sysext/impexp/Tests/Unit/ExportTest.php +++ b/typo3/sysext/impexp/Tests/Unit/ExportTest.php @@ -28,10 +28,7 @@ class ExportTest extends UnitTestCase { protected bool $resetSingletonInstances = true; - /** - * @var Export|MockObject|AccessibleObjectInterface - */ - protected $exportMock; + protected Export&MockObject&AccessibleObjectInterface $exportMock; protected function setUp(): void { diff --git a/typo3/sysext/install/Tests/Functional/Updates/BackendGroupsExplicitAllowDenyMigrationTest.php b/typo3/sysext/install/Tests/Functional/Updates/BackendGroupsExplicitAllowDenyMigrationTest.php index f9fba922e3a6afe5c07321cec276b936696cfb28..775ac70ab7f2e6be6b3e951c6bca8622145d7808 100644 --- a/typo3/sysext/install/Tests/Functional/Updates/BackendGroupsExplicitAllowDenyMigrationTest.php +++ b/typo3/sysext/install/Tests/Functional/Updates/BackendGroupsExplicitAllowDenyMigrationTest.php @@ -17,7 +17,6 @@ declare(strict_types=1); namespace TYPO3\CMS\Install\Tests\Functional\Updates; -use PHPUnit\Framework\MockObject\MockObject; use Symfony\Component\Console\Output\OutputInterface; use TYPO3\CMS\Install\Updates\BackendGroupsExplicitAllowDenyMigration; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -29,7 +28,6 @@ class BackendGroupsExplicitAllowDenyMigrationTest extends FunctionalTestCase */ public function backendGroupsRowsAreUpdated(): void { - /** @var MockObject&OutputInterface $outputMock */ $outputMock = $this->getMockBuilder(OutputInterface::class)->getMock(); $outputMock->expects(self::atLeastOnce())->method('writeln'); $subject = new BackendGroupsExplicitAllowDenyMigration(); diff --git a/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/SysRedirectRootPageMoveMigrationTest.php b/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/SysRedirectRootPageMoveMigrationTest.php index 92aacc42ceb5a56ea5dfe80e7023bb375e9dacee..3e1c9a68b35950c2945f8eb1437d64a5d670ef5c 100644 --- a/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/SysRedirectRootPageMoveMigrationTest.php +++ b/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/SysRedirectRootPageMoveMigrationTest.php @@ -22,6 +22,7 @@ use TYPO3\CMS\Core\Tests\Functional\SiteHandling\SiteBasedTestTrait; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Install\Updates\DatabaseRowsUpdateWizard; use TYPO3\CMS\Install\Updates\RowUpdater\SysRedirectRootPageMoveMigration; +use TYPO3\TestingFramework\Core\AccessibleObjectInterface; use TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\ActionService; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -33,10 +34,7 @@ class SysRedirectRootPageMoveMigrationTest extends FunctionalTestCase protected array $coreExtensionsToLoad = ['redirects']; - /** - * @var MockObject|DatabaseRowsUpdateWizard|\TYPO3\TestingFramework\Core\AccessibleObjectInterface - */ - protected $subject; + protected DatabaseRowsUpdateWizard&MockObject&AccessibleObjectInterface $subject; protected ActionService $actionService; diff --git a/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/WorkspaceNewPlaceholderRemovalTest.php b/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/WorkspaceNewPlaceholderRemovalTest.php index b5ecf9ceb7b6af4cab5d78cc7e1c284c6f30a4d4..5fa4f4ca24ef97fa49756500fdb7ce85d364263f 100644 --- a/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/WorkspaceNewPlaceholderRemovalTest.php +++ b/typo3/sysext/install/Tests/Functional/Updates/RowUpdater/WorkspaceNewPlaceholderRemovalTest.php @@ -21,6 +21,7 @@ use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Core\Utility\GeneralUtility; use TYPO3\CMS\Install\Updates\DatabaseRowsUpdateWizard; use TYPO3\CMS\Install\Updates\RowUpdater\WorkspaceNewPlaceholderRemovalMigration; +use TYPO3\TestingFramework\Core\AccessibleObjectInterface; use TYPO3\TestingFramework\Core\Functional\Framework\DataHandling\ActionService; use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase; @@ -33,10 +34,7 @@ class WorkspaceNewPlaceholderRemovalTest extends FunctionalTestCase 'typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_irre_csv', ]; - /** - * @var MockObject|DatabaseRowsUpdateWizard|\TYPO3\TestingFramework\Core\AccessibleObjectInterface - */ - protected $subject; + protected DatabaseRowsUpdateWizard&MockObject&AccessibleObjectInterface $subject; protected ActionService $actionService; diff --git a/typo3/sysext/install/Tests/Unit/Service/SilentConfigurationUpgradeServiceTest.php b/typo3/sysext/install/Tests/Unit/Service/SilentConfigurationUpgradeServiceTest.php index 5b64c507e76a870cea3bb7cdd50e4a6167bd1343..3940d320954bc251cac82438a7424a39d587d597 100644 --- a/typo3/sysext/install/Tests/Unit/Service/SilentConfigurationUpgradeServiceTest.php +++ b/typo3/sysext/install/Tests/Unit/Service/SilentConfigurationUpgradeServiceTest.php @@ -36,10 +36,7 @@ use TYPO3\TestingFramework\Core\Unit\UnitTestCase; class SilentConfigurationUpgradeServiceTest extends UnitTestCase { - /** - * @var ConfigurationManager|MockObject - */ - protected $configurationManager; + protected ConfigurationManager&MockObject $configurationManager; /** * @var UnitTestPackageManager A backup of unit test package manager diff --git a/typo3/sysext/install/Tests/Unit/SystemEnvironment/DatabaseCheck/Platform/MySqlTest.php b/typo3/sysext/install/Tests/Unit/SystemEnvironment/DatabaseCheck/Platform/MySqlTest.php index 42bde9e597c7d09e9ecffd8b6af8929d40ea4db5..fc7ae28206bfdabbdced1ab3dce11837cb0679df 100644 --- a/typo3/sysext/install/Tests/Unit/SystemEnvironment/DatabaseCheck/Platform/MySqlTest.php +++ b/typo3/sysext/install/Tests/Unit/SystemEnvironment/DatabaseCheck/Platform/MySqlTest.php @@ -20,7 +20,6 @@ namespace TYPO3\CMS\Install\Tests\Unit\SystemEnvironment\DatabaseCheck\Platform; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\MariaDBPlatform; use Doctrine\DBAL\Platforms\MySQLPlatform; -use PHPUnit\Framework\MockObject\MockObject; use TYPO3\CMS\Core\Database\Connection; use TYPO3\CMS\Core\Messaging\FlashMessage; use TYPO3\CMS\Core\Type\ContextualFeedbackSeverity; @@ -90,7 +89,6 @@ class MySqlTest extends UnitTestCase ContextualFeedbackSeverity $expectedSeverity, string $expectedTitle ): void { - /** @var Connection&MockObject $connectionMock */ $connectionMock = $this->getMockBuilder(Connection::class)->disableOriginalConstructor()->getMock(); $connectionMock->method('getServerVersion')->willReturn($serverVersionString); $connectionMock->method('getDatabasePlatform')->willReturn($platform); diff --git a/typo3/sysext/recycler/Tests/Unit/Task/CleanerFieldProviderTest.php b/typo3/sysext/recycler/Tests/Unit/Task/CleanerFieldProviderTest.php index 63e4196fb1cfae8f3c3cfe3abd3c3b8910b15425..104f91d18a316d7a96e8b1f6a3c33dfc53f049c0 100644 --- a/typo3/sysext/recycler/Tests/Unit/Task/CleanerFieldProviderTest.php +++ b/typo3/sysext/recycler/Tests/Unit/Task/CleanerFieldProviderTest.php @@ -52,10 +52,7 @@ class CleanerFieldProviderTest extends UnitTestCase $this->subject->method('getLanguageService')->willReturn($languageServiceMock); } - /** - * @return MockObject|SchedulerModuleController - */ - protected function getScheduleModuleControllerMock(array $mockedMethods = []) + protected function getScheduleModuleControllerMock(array $mockedMethods = []): SchedulerModuleController&MockObject { $languageServiceMock = $this->getMockBuilder(LanguageService::class) ->onlyMethods(['sL']) diff --git a/typo3/sysext/workspaces/Tests/Unit/Controller/Remote/RemoteServerTest.php b/typo3/sysext/workspaces/Tests/Unit/Controller/Remote/RemoteServerTest.php index 53c5da136b9c2d07246743e480bd631c88d98a17..cb23791fcb25c6db404da8a4b22d49bb6f29038b 100644 --- a/typo3/sysext/workspaces/Tests/Unit/Controller/Remote/RemoteServerTest.php +++ b/typo3/sysext/workspaces/Tests/Unit/Controller/Remote/RemoteServerTest.php @@ -31,7 +31,7 @@ class RemoteServerTest extends UnitTestCase protected bool $resetSingletonInstances = true; /** - * @var array<string, MockObject&FileReference> + * @var array<non-empty-string, FileReference&MockObject> */ protected array $fileReferenceMocks; @@ -120,7 +120,7 @@ class RemoteServerTest extends UnitTestCase /** * @param string $idList List of ids - * @return array<string, MockObject&FileReference> + * @return array<non-empty-string, FileReference&MockObject> */ protected function getFileReferenceMocks(string $idList): array { @@ -134,7 +134,10 @@ class RemoteServerTest extends UnitTestCase return $fileReferenceMocks; } - protected function getFileReferenceMock(string $id): MockObject&FileReference + /** + * @param non-empty-string $id + */ + protected function getFileReferenceMock(string $id): FileReference&MockObject { if (isset($this->fileReferenceMocks[$id])) { return $this->fileReferenceMocks[$id];