diff --git a/src/Command/Utils/CheckDependencies.php b/src/Command/Utils/CheckDependencies.php index f8b78b6b8..634261abf 100644 --- a/src/Command/Utils/CheckDependencies.php +++ b/src/Command/Utils/CheckDependencies.php @@ -139,7 +139,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int private function getNamespaceDirectories(): array { // Find all main namespace directories under 'tools' directory - $finder = (new Finder()) + $finder = new Finder() ->depth(1) ->ignoreDotFiles(true) ->directories() diff --git a/src/EventSubscriber/JWTCreatedSubscriber.php b/src/EventSubscriber/JWTCreatedSubscriber.php index 7fbe5f970..a6adb5068 100644 --- a/src/EventSubscriber/JWTCreatedSubscriber.php +++ b/src/EventSubscriber/JWTCreatedSubscriber.php @@ -100,7 +100,7 @@ private function setLocalizationData(array &$payload, UserInterface $user): void private function setExpiration(array &$payload): void { // Set new exp value for JWT - $payload['exp'] = (new DateTime('+1 day', new DateTimeZone('UTC')))->getTimestamp(); + $payload['exp'] = new DateTime('+1 day', new DateTimeZone('UTC'))->getTimestamp(); } /** diff --git a/src/Repository/HealthzRepository.php b/src/Repository/HealthzRepository.php index effa60052..b841849c8 100644 --- a/src/Repository/HealthzRepository.php +++ b/src/Repository/HealthzRepository.php @@ -87,7 +87,7 @@ public function create(): Entity public function cleanup(): int { // Determine date - $date = (new DateTimeImmutable(timezone: new DateTimeZone('UTC'))) + $date = new DateTimeImmutable(timezone: new DateTimeZone('UTC')) ->sub(new DateInterval('P7D')); // Create query builder diff --git a/src/Repository/LogRequestRepository.php b/src/Repository/LogRequestRepository.php index 53f07352c..b44f2ee65 100644 --- a/src/Repository/LogRequestRepository.php +++ b/src/Repository/LogRequestRepository.php @@ -51,7 +51,7 @@ public function __construct( public function cleanHistory(): int { // Determine date - $date = (new DateTimeImmutable(timezone: new DateTimeZone('UTC'))) + $date = new DateTimeImmutable(timezone: new DateTimeZone('UTC')) ->sub(new DateInterval('P3Y')); // Create query builder and define delete query diff --git a/src/Repository/Traits/RepositoryMethodsTrait.php b/src/Repository/Traits/RepositoryMethodsTrait.php index 8a142c221..3a78dfa95 100644 --- a/src/Repository/Traits/RepositoryMethodsTrait.php +++ b/src/Repository/Traits/RepositoryMethodsTrait.php @@ -105,7 +105,7 @@ public function findByAdvanced( */ RepositoryHelper::resetParameterCount(); - $iterator = (new Paginator($queryBuilder, true))->getIterator(); + $iterator = new Paginator($queryBuilder, true)->getIterator(); assert($iterator instanceof ArrayIterator); diff --git a/src/Rest/RestResource.php b/src/Rest/RestResource.php index d8c196329..c52bc96ca 100644 --- a/src/Rest/RestResource.php +++ b/src/Rest/RestResource.php @@ -120,7 +120,7 @@ public function getDtoForEntity( * @var RestDtoInterface $restDto * @var class-string $dtoClass */ - $restDto = (new $dtoClass()) + $restDto = new $dtoClass() ->setId($id); if ($patch === true) { diff --git a/tests/DataFixtures/ORM/LoadApiKeyData.php b/tests/DataFixtures/ORM/LoadApiKeyData.php index 5b134dc1a..8350b6448 100644 --- a/tests/DataFixtures/ORM/LoadApiKeyData.php +++ b/tests/DataFixtures/ORM/LoadApiKeyData.php @@ -77,7 +77,7 @@ public function getOrder(): int private function createApiKey(ObjectManager $manager, ?string $role = null): bool { // Create new entity - $entity = (new ApiKey()) + $entity = new ApiKey() ->setDescription('ApiKey Description: ' . ($role === null ? '' : $this->rolesService->getShort($role))) ->setToken(str_pad($role === null ? '' : $this->rolesService->getShort($role), 40, '_')); diff --git a/tests/DataFixtures/ORM/LoadRoleData.php b/tests/DataFixtures/ORM/LoadRoleData.php index b2182b7e9..155919dc7 100644 --- a/tests/DataFixtures/ORM/LoadRoleData.php +++ b/tests/DataFixtures/ORM/LoadRoleData.php @@ -59,7 +59,7 @@ public function getOrder(): int private function createRole(ObjectManager $manager, string $role): bool { // Create new Role entity - $entity = (new Role($role)) + $entity = new Role($role) ->setDescription('Description - ' . $role); // Persist entity diff --git a/tests/DataFixtures/ORM/LoadUserData.php b/tests/DataFixtures/ORM/LoadUserData.php index de5962c1a..12dd61b94 100644 --- a/tests/DataFixtures/ORM/LoadUserData.php +++ b/tests/DataFixtures/ORM/LoadUserData.php @@ -82,7 +82,7 @@ private function createUser(ObjectManager $manager, ?string $role = null): bool $suffix = $role === null ? '' : '-' . $this->rolesService->getShort($role); // Create new entity - $entity = (new User()) + $entity = new User() ->setUsername('john' . $suffix) ->setFirstName('John') ->setLastName('Doe') diff --git a/tests/DataFixtures/ORM/LoadUserGroupData.php b/tests/DataFixtures/ORM/LoadUserGroupData.php index 2619557ff..f7f7ea524 100644 --- a/tests/DataFixtures/ORM/LoadUserGroupData.php +++ b/tests/DataFixtures/ORM/LoadUserGroupData.php @@ -74,7 +74,7 @@ private function createUserGroup(ObjectManager $manager, string $role): bool $roleReference = $this->getReference('Role-' . $this->rolesService->getShort($role), Role::class); // Create new entity - $entity = (new UserGroup()) + $entity = new UserGroup() ->setRole($roleReference) ->setName($this->rolesService->getRoleLabel($role)); diff --git a/tests/Functional/Repository/HealthzRepositoryTest.php b/tests/Functional/Repository/HealthzRepositoryTest.php index ba93853e0..b6f03a233 100644 --- a/tests/Functional/Repository/HealthzRepositoryTest.php +++ b/tests/Functional/Repository/HealthzRepositoryTest.php @@ -65,7 +65,7 @@ public function testThatReadValueMethodReturnsExpectedWithEmptyDatabase(): void public function testThatCreateValueReturnsExpected(): void { self::assertEqualsWithDelta( - (new DateTimeImmutable('now', new DateTimeZone('utc')))->getTimestamp(), + new DateTimeImmutable('now', new DateTimeZone('utc'))->getTimestamp(), $this->getRepository()->create()->getCreatedAt()->getTimestamp(), 1, ); diff --git a/tests/Integration/AutoMapper/GenericRestRequestMapperTest.php b/tests/Integration/AutoMapper/GenericRestRequestMapperTest.php index b17fa079d..d470cce4c 100644 --- a/tests/Integration/AutoMapper/GenericRestRequestMapperTest.php +++ b/tests/Integration/AutoMapper/GenericRestRequestMapperTest.php @@ -39,7 +39,7 @@ public function testThatMapToObjectThrowsAnExceptionIfSourceIsAnArray(): void $resource = $this->getMockBuilder(UserGroupResource::class)->disableOriginalConstructor()->getMock(); - (new RequestMapper($resource))->mapToObject([], new stdClass()); + new RequestMapper($resource)->mapToObject([], new stdClass()); } /** @@ -53,7 +53,7 @@ public function testThatMapToObjectThrowsAnExceptionIfSourceIsNotRequestObject() $resource = $this->getMockBuilder(UserGroupResource::class)->disableOriginalConstructor()->getMock(); - (new RequestMapper($resource))->mapToObject(new stdClass(), new stdClass()); + new RequestMapper($resource)->mapToObject(new stdClass(), new stdClass()); } /** @@ -69,7 +69,7 @@ public function testThatMapToObjectThrowsAnExceptionIfDestinationIsNotRestDtoInt $resource = $this->getMockBuilder(UserGroupResource::class)->disableOriginalConstructor()->getMock(); - (new RequestMapper($resource))->mapToObject(new Request(), new stdClass()); + new RequestMapper($resource)->mapToObject(new Request(), new stdClass()); } /** @@ -85,7 +85,7 @@ public function testThatMapToObjectThrowsAnExceptionIfThereIsNotPropertiesToConv $mockRestDtoInterface = $this->getMockBuilder(RestDtoInterface::class)->getMock(); - (new TestRestRequestMapperWithoutProperties())->mapToObject(new Request(), $mockRestDtoInterface); + new TestRestRequestMapperWithoutProperties()->mapToObject(new Request(), $mockRestDtoInterface); } /** @@ -100,7 +100,7 @@ public function testThatMapToObjectWorksAsExpected(): void ]); /** @var TestRestRequestMapperDto $transformedObject */ - $transformedObject = (new TestRestRequestMapper())->mapToObject($request, new TestRestRequestMapperDto()); + $transformedObject = new TestRestRequestMapper()->mapToObject($request, new TestRestRequestMapperDto()); self::assertSame('someValue', $transformedObject->getSomeProperty()); self::assertSame('fbzrGenafsbezInyhr', $transformedObject->getSomeTransformProperty()); diff --git a/tests/Integration/Compiler/StopwatchCompilerPassTest.php b/tests/Integration/Compiler/StopwatchCompilerPassTest.php index 6e4ffc3af..ab2c7c80d 100644 --- a/tests/Integration/Compiler/StopwatchCompilerPassTest.php +++ b/tests/Integration/Compiler/StopwatchCompilerPassTest.php @@ -31,7 +31,7 @@ public function testThatFindTaggedServiceIdsMethodIsCalled(): void ->method('findTaggedServiceIds') ->willReturn([]); - (new StopwatchCompilerPass())->process($container); + new StopwatchCompilerPass()->process($container); } #[TestDox('Test that no other container methods are called when tagged service is not supported')] @@ -54,7 +54,7 @@ public function testThatIfServiceStartsWithAppNoOtherContainerMethodsAreCalled() ->expects(self::never()) ->method('setDefinition'); - (new StopwatchCompilerPass())->process($container); + new StopwatchCompilerPass()->process($container); } public function testThatAllExpectedContainerMethodsAreCalled(): void @@ -80,6 +80,6 @@ public function testThatAllExpectedContainerMethodsAreCalled(): void ->method('setDefinition') ->with('App\Foo.stopwatch'); - (new StopwatchCompilerPass())->process($container); + new StopwatchCompilerPass()->process($container); } } diff --git a/tests/Integration/Controller/HealthzControllerTest.php b/tests/Integration/Controller/HealthzControllerTest.php index e6390e3cd..6b0c30b39 100644 --- a/tests/Integration/Controller/HealthzControllerTest.php +++ b/tests/Integration/Controller/HealthzControllerTest.php @@ -71,7 +71,7 @@ public function testThatInvokeMethodIsCallingExpectedMethods(): void ), ); - $response = (new HealthzController($responseHandler, $healthzService))($request); + $response = new HealthzController($responseHandler, $healthzService)($request); $content = $response->getContent(); self::assertSame(200, $response->getStatusCode()); diff --git a/tests/Integration/Controller/IndexControllerTest.php b/tests/Integration/Controller/IndexControllerTest.php index 61bc5d4ef..5ab6424c5 100644 --- a/tests/Integration/Controller/IndexControllerTest.php +++ b/tests/Integration/Controller/IndexControllerTest.php @@ -21,7 +21,7 @@ class IndexControllerTest extends KernelTestCase #[TestDox('Test that `__invoke` method returns proper response')] public function testThatInvokeMethodReturnsExpectedResponse(): void { - $response = (new IndexController())(); + $response = new IndexController()(); $content = $response->getContent(); self::assertSame(200, $response->getStatusCode()); diff --git a/tests/Integration/Controller/VersionControllerTest.php b/tests/Integration/Controller/VersionControllerTest.php index e4d0ad447..11ccaa284 100644 --- a/tests/Integration/Controller/VersionControllerTest.php +++ b/tests/Integration/Controller/VersionControllerTest.php @@ -31,7 +31,7 @@ public function testThatInvokeMethodIsCallingExpectedMethods(): void ->method('get') ->willReturn('1.0.0'); - $response = (new VersionController($version))(); + $response = new VersionController($version)(); $content = $response->getContent(); self::assertSame(200, $response->getStatusCode()); diff --git a/tests/Integration/Controller/v1/Auth/GetTokenControllerTest.php b/tests/Integration/Controller/v1/Auth/GetTokenControllerTest.php index c72b88e46..68c49c4f4 100644 --- a/tests/Integration/Controller/v1/Auth/GetTokenControllerTest.php +++ b/tests/Integration/Controller/v1/Auth/GetTokenControllerTest.php @@ -24,7 +24,7 @@ class GetTokenControllerTest extends KernelTestCase public function testThatGetTokenThrowsAnException(): void { try { - (new GetTokenController())(); + new GetTokenController()(); } catch (Throwable $exception) { self::assertInstanceOf(HttpException::class, $exception); self::assertSame( diff --git a/tests/Integration/Controller/v1/Localization/LanguageControllerTest.php b/tests/Integration/Controller/v1/Localization/LanguageControllerTest.php index e2a0e1ce4..10f99a53b 100644 --- a/tests/Integration/Controller/v1/Localization/LanguageControllerTest.php +++ b/tests/Integration/Controller/v1/Localization/LanguageControllerTest.php @@ -29,7 +29,7 @@ public function testThatInvokeMethodCallsExpectedServiceMethods(): void ->method('getLanguages') ->willReturn(['fi', 'en']); - $response = (new LanguageController($Localization))(); + $response = new LanguageController($Localization)(); $content = $response->getContent(); self::assertSame(200, $response->getStatusCode()); diff --git a/tests/Integration/Controller/v1/Localization/LocaleControllerTest.php b/tests/Integration/Controller/v1/Localization/LocaleControllerTest.php index 494606a59..9a65a96b5 100644 --- a/tests/Integration/Controller/v1/Localization/LocaleControllerTest.php +++ b/tests/Integration/Controller/v1/Localization/LocaleControllerTest.php @@ -29,7 +29,7 @@ public function testThatInvokeMethodCallsExpectedServiceMethods(): void ->method('getLocales') ->willReturn(['fi', 'en']); - $response = (new LocaleController($Localization))(); + $response = new LocaleController($Localization)(); $content = $response->getContent(); self::assertSame(200, $response->getStatusCode()); diff --git a/tests/Integration/Controller/v1/Localization/TimeZoneControllerTest.php b/tests/Integration/Controller/v1/Localization/TimeZoneControllerTest.php index cff3ee56e..d7a4b40c8 100644 --- a/tests/Integration/Controller/v1/Localization/TimeZoneControllerTest.php +++ b/tests/Integration/Controller/v1/Localization/TimeZoneControllerTest.php @@ -36,7 +36,7 @@ public function testThatInvokeMethodCallsExpectedServiceMethods(): void ], ]); - $response = (new TimeZoneController($Localization))(); + $response = new TimeZoneController($Localization)(); $content = $response->getContent(); self::assertSame(200, $response->getStatusCode()); diff --git a/tests/Integration/Controller/v1/Profile/GroupsControllerTest.php b/tests/Integration/Controller/v1/Profile/GroupsControllerTest.php index d72d3e3ca..c2161cb2a 100644 --- a/tests/Integration/Controller/v1/Profile/GroupsControllerTest.php +++ b/tests/Integration/Controller/v1/Profile/GroupsControllerTest.php @@ -43,6 +43,6 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ) ->willReturn('{}'); - (new GroupsController($serializer))($user); + new GroupsController($serializer)($user); } } diff --git a/tests/Integration/Controller/v1/Profile/IndexControllerTest.php b/tests/Integration/Controller/v1/Profile/IndexControllerTest.php index d1e85aff6..49a56a197 100644 --- a/tests/Integration/Controller/v1/Profile/IndexControllerTest.php +++ b/tests/Integration/Controller/v1/Profile/IndexControllerTest.php @@ -54,6 +54,6 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->with(['foo', 'bar']) ->willReturn(['foo', 'bar']); - (new IndexController($serializer, $rolesService))($user); + new IndexController($serializer, $rolesService)($user); } } diff --git a/tests/Integration/Controller/v1/Profile/RolesControllerTest.php b/tests/Integration/Controller/v1/Profile/RolesControllerTest.php index be5577f5a..037d5ea13 100644 --- a/tests/Integration/Controller/v1/Profile/RolesControllerTest.php +++ b/tests/Integration/Controller/v1/Profile/RolesControllerTest.php @@ -39,6 +39,6 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->with($user->getRoles()) ->willReturn([]); - (new RolesController($rolesService))->__invoke($user); + new RolesController($rolesService)->__invoke($user); } } diff --git a/tests/Integration/Controller/v1/Role/FindOneRoleControllerTest.php b/tests/Integration/Controller/v1/Role/FindOneRoleControllerTest.php index 2c21ce412..06935101d 100644 --- a/tests/Integration/Controller/v1/Role/FindOneRoleControllerTest.php +++ b/tests/Integration/Controller/v1/Role/FindOneRoleControllerTest.php @@ -58,7 +58,7 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->method('createResponse') ->with($request, $role, $resource); - (new FindOneRoleController($resource)) + new FindOneRoleController($resource) ->setResponseHandler($responseHandler) ->__invoke($request, 'role'); } diff --git a/tests/Integration/Controller/v1/Role/InheritedRolesControllerTest.php b/tests/Integration/Controller/v1/Role/InheritedRolesControllerTest.php index 97073c6ad..dd2edc40b 100644 --- a/tests/Integration/Controller/v1/Role/InheritedRolesControllerTest.php +++ b/tests/Integration/Controller/v1/Role/InheritedRolesControllerTest.php @@ -32,6 +32,6 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->with([$role->getId()]) ->willReturn([$role]); - (new InheritedRolesController($rolesService))($role); + new InheritedRolesController($rolesService)($role); } } diff --git a/tests/Integration/Controller/v1/User/AttachUserGroupControllerTest.php b/tests/Integration/Controller/v1/User/AttachUserGroupControllerTest.php index cd21ac043..02be2a1bd 100644 --- a/tests/Integration/Controller/v1/User/AttachUserGroupControllerTest.php +++ b/tests/Integration/Controller/v1/User/AttachUserGroupControllerTest.php @@ -36,7 +36,7 @@ public function testThatInvokeMethodCallsExpectedMethods(): void $serializer = $this->getMockBuilder(SerializerInterface::class)->getMock(); $user = new User(); - $userGroup = (new UserGroup())->setRole(new Role('role')); + $userGroup = new UserGroup()->setRole(new Role('role')); $userResource ->expects($this->once()) @@ -55,7 +55,7 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->method('serialize') ->willReturn('[]'); - (new AttachUserGroupController($userResource, $userGroupResource, $serializer))($user, $userGroup); + new AttachUserGroupController($userResource, $userGroupResource, $serializer)($user, $userGroup); self::assertTrue( $user->getUserGroups()->contains($userGroup), diff --git a/tests/Integration/Controller/v1/User/DeleteUserControllerTest.php b/tests/Integration/Controller/v1/User/DeleteUserControllerTest.php index 106d60aed..7f044e4dd 100644 --- a/tests/Integration/Controller/v1/User/DeleteUserControllerTest.php +++ b/tests/Integration/Controller/v1/User/DeleteUserControllerTest.php @@ -56,7 +56,7 @@ public function testThatInvokeMethodThrowsAnExceptionIfUserTriesToDeleteHimself( $request = Request::create('/'); $user = new User(); - (new DeleteUserController($resource))($request, $user, $user); + new DeleteUserController($resource)($request, $user, $user); } /** @@ -83,7 +83,7 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->method('createResponse') ->with($request, $requestUser, $resource); - (new DeleteUserController($resource)) + new DeleteUserController($resource) ->setResponseHandler($responseHandler) ->__invoke($request, $requestUser, $loggedInUser); } diff --git a/tests/Integration/Controller/v1/User/DetachUserGroupControllerTest.php b/tests/Integration/Controller/v1/User/DetachUserGroupControllerTest.php index 9988a5aea..6f8b338fd 100644 --- a/tests/Integration/Controller/v1/User/DetachUserGroupControllerTest.php +++ b/tests/Integration/Controller/v1/User/DetachUserGroupControllerTest.php @@ -35,8 +35,8 @@ public function testThatInvokeMethodCallsExpectedMethods(): void $userGroupResource = $this->getMockBuilder(UserGroupResource::class)->disableOriginalConstructor()->getMock(); $serializer = $this->getMockBuilder(SerializerInterface::class)->getMock(); - $userGroup = (new UserGroup())->setRole(new Role('role')); - $user = (new User())->addUserGroup($userGroup); + $userGroup = new UserGroup()->setRole(new Role('role')); + $user = new User()->addUserGroup($userGroup); $userResource ->expects($this->once()) @@ -55,7 +55,7 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->method('serialize') ->willReturn('[]'); - (new DetachUserGroupController($userResource, $userGroupResource, $serializer))($user, $userGroup); + new DetachUserGroupController($userResource, $userGroupResource, $serializer)($user, $userGroup); self::assertFalse( $user->getUserGroups()->contains($userGroup), diff --git a/tests/Integration/Controller/v1/User/UserGroupsControllerTest.php b/tests/Integration/Controller/v1/User/UserGroupsControllerTest.php index c8c046c2e..71b8d3fa6 100644 --- a/tests/Integration/Controller/v1/User/UserGroupsControllerTest.php +++ b/tests/Integration/Controller/v1/User/UserGroupsControllerTest.php @@ -43,6 +43,6 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ) ->willReturn('[]'); - (new UserGroupsController($serializer))($user); + new UserGroupsController($serializer)($user); } } diff --git a/tests/Integration/Controller/v1/User/UserRolesControllerTest.php b/tests/Integration/Controller/v1/User/UserRolesControllerTest.php index f922a9e82..15a8b86ab 100644 --- a/tests/Integration/Controller/v1/User/UserRolesControllerTest.php +++ b/tests/Integration/Controller/v1/User/UserRolesControllerTest.php @@ -39,6 +39,6 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->with($user->getRoles()) ->willReturn([]); - (new UserRolesController($rolesService))->__invoke($user); + new UserRolesController($rolesService)->__invoke($user); } } diff --git a/tests/Integration/Controller/v1/UserGroup/AttachUserControllerTest.php b/tests/Integration/Controller/v1/UserGroup/AttachUserControllerTest.php index 0b0d8533a..6954f458b 100644 --- a/tests/Integration/Controller/v1/UserGroup/AttachUserControllerTest.php +++ b/tests/Integration/Controller/v1/UserGroup/AttachUserControllerTest.php @@ -35,7 +35,7 @@ public function testThatInvokeMethodCallsExpectedMethods(): void $userGroupResource = $this->getMockBuilder(UserGroupResource::class)->disableOriginalConstructor()->getMock(); $serializer = $this->getMockBuilder(SerializerInterface::class)->getMock(); - $userGroup = (new UserGroup())->setRole(new Role('role')); + $userGroup = new UserGroup()->setRole(new Role('role')); $user = new User(); $userResource @@ -55,7 +55,7 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->method('serialize') ->willReturn('[]'); - (new AttachUserController($userResource, $userGroupResource, $serializer))($userGroup, $user); + new AttachUserController($userResource, $userGroupResource, $serializer)($userGroup, $user); self::assertTrue( $user->getUserGroups()->contains($userGroup), diff --git a/tests/Integration/Controller/v1/UserGroup/DetachUserControllerTest.php b/tests/Integration/Controller/v1/UserGroup/DetachUserControllerTest.php index b0416d142..cd391bbc0 100644 --- a/tests/Integration/Controller/v1/UserGroup/DetachUserControllerTest.php +++ b/tests/Integration/Controller/v1/UserGroup/DetachUserControllerTest.php @@ -35,8 +35,8 @@ public function testThatInvokeMethodCallsExpectedMethods(): void $userGroupResource = $this->getMockBuilder(UserGroupResource::class)->disableOriginalConstructor()->getMock(); $serializer = $this->getMockBuilder(SerializerInterface::class)->getMock(); - $userGroup = (new UserGroup())->setRole(new Role('role')); - $user = (new User())->addUserGroup($userGroup); + $userGroup = new UserGroup()->setRole(new Role('role')); + $user = new User()->addUserGroup($userGroup); $userResource ->expects($this->once()) @@ -55,7 +55,7 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->method('serialize') ->willReturn('[]'); - (new DetachUserController($userResource, $userGroupResource, $serializer))($userGroup, $user); + new DetachUserController($userResource, $userGroupResource, $serializer)($userGroup, $user); self::assertFalse( $user->getUserGroups()->contains($userGroup), diff --git a/tests/Integration/Controller/v1/UserGroup/UsersControllerTest.php b/tests/Integration/Controller/v1/UserGroup/UsersControllerTest.php index 063a06550..5ccca1435 100644 --- a/tests/Integration/Controller/v1/UserGroup/UsersControllerTest.php +++ b/tests/Integration/Controller/v1/UserGroup/UsersControllerTest.php @@ -35,8 +35,8 @@ public function testThatInvokeMethodCallsExpectedMethods(): void $responseHandler = $this->getMockBuilder(ResponseHandler::class)->disableOriginalConstructor()->getMock(); $request = new Request(); - $userGroup = (new UserGroup())->setRole(new Role('Some Role')); - $user = (new User())->addUserGroup($userGroup); + $userGroup = new UserGroup()->setRole(new Role('Some Role')); + $user = new User()->addUserGroup($userGroup); $userResource ->expects($this->once()) @@ -49,6 +49,6 @@ public function testThatInvokeMethodCallsExpectedMethods(): void ->method('createResponse') ->with($request, [$user], $userResource); - (new UsersController($userResource, $responseHandler))($request, $userGroup); + new UsersController($userResource, $responseHandler)($request, $userGroup); } } diff --git a/tests/Integration/DTO/ApiKey/ApiKeyPatchTest.php b/tests/Integration/DTO/ApiKey/ApiKeyPatchTest.php index f47f2b7a2..c3da57894 100644 --- a/tests/Integration/DTO/ApiKey/ApiKeyPatchTest.php +++ b/tests/Integration/DTO/ApiKey/ApiKeyPatchTest.php @@ -30,19 +30,19 @@ class ApiKeyPatchTest extends DtoTestCase #[TestDox('Test that `setUserGroups` method updates entity correctly')] public function testThatUserGroupsAreExpected(): void { - $userGroup1 = (new UserGroup()) + $userGroup1 = new UserGroup() ->setName('Group 1') ->setRole(new Role('Role 1')); - $userGroup2 = (new UserGroup()) + $userGroup2 = new UserGroup() ->setName('Group 2') ->setRole(new Role('Role 2')); - $user = (new ApiKey()) + $user = new ApiKey() ->setDescription('description') ->addUserGroup($userGroup1); - $dto = (new ApiKeyPatch()) + $dto = new ApiKeyPatch() ->load($user) ->setUserGroups([$userGroup2]); diff --git a/tests/Integration/DTO/ApiKey/ApiKeyTest.php b/tests/Integration/DTO/ApiKey/ApiKeyTest.php index ffa01bfff..b0b18780e 100644 --- a/tests/Integration/DTO/ApiKey/ApiKeyTest.php +++ b/tests/Integration/DTO/ApiKey/ApiKeyTest.php @@ -36,16 +36,16 @@ public function testThatLoadMethodWorks(): void $roleEntity = new RoleEntity('test role'); // Create UserGroup entity - $userGroupEntity = (new UserGroupEntity()) + $userGroupEntity = new UserGroupEntity() ->setName('test user group') ->setRole($roleEntity); // Create ApiKey entity - $apiKeyEntity = (new ApiKeyEntity()) + $apiKeyEntity = new ApiKeyEntity() ->setDescription('Some description') ->addUserGroup($userGroupEntity); - $dto = (new ApiKeyDto()) + $dto = new ApiKeyDto() ->load($apiKeyEntity); self::assertSame('Some description', $dto->getDescription()); @@ -81,7 +81,7 @@ public function testThatUpdateMethodCallsExpectedEntityMethodsIfUserGroupsIsVisi ->method('addUserGroup') ->willReturn($entity); - (new ApiKeyDto()) + new ApiKeyDto() ->setDescription('some description') ->setUserGroups($userGroups) ->update($entity); diff --git a/tests/Integration/DTO/ApiKey/ApiKeyUpdateTest.php b/tests/Integration/DTO/ApiKey/ApiKeyUpdateTest.php index d0d1084c5..a67596e58 100644 --- a/tests/Integration/DTO/ApiKey/ApiKeyUpdateTest.php +++ b/tests/Integration/DTO/ApiKey/ApiKeyUpdateTest.php @@ -30,19 +30,19 @@ class ApiKeyUpdateTest extends DtoTestCase #[TestDox('Test that `setUserGroups` method updates entity correctly')] public function testThatUserGroupsAreExpected(): void { - $userGroup1 = (new UserGroup()) + $userGroup1 = new UserGroup() ->setName('Group 1') ->setRole(new Role('Role 1')); - $userGroup2 = (new UserGroup()) + $userGroup2 = new UserGroup() ->setName('Group 2') ->setRole(new Role('Role 2')); - $user = (new ApiKey()) + $user = new ApiKey() ->setDescription('description') ->addUserGroup($userGroup1); - $dto = (new ApiKeyUpdate()) + $dto = new ApiKeyUpdate() ->load($user) ->setUserGroups([$userGroup2]); diff --git a/tests/Integration/DTO/GenericDtoTest.php b/tests/Integration/DTO/GenericDtoTest.php index e2c4c1d01..68032ae86 100644 --- a/tests/Integration/DTO/GenericDtoTest.php +++ b/tests/Integration/DTO/GenericDtoTest.php @@ -42,7 +42,7 @@ public function testThatPatchThrowsAnExceptionIfGetterMethodDoesNotExist(): void ->method('getVisited') ->willReturn(['foo']); - (new User()) + new User() ->patch($dtoMock); } @@ -70,10 +70,10 @@ public function testThatPatchThrowsAnErrorIfMultipleGettersAreDefined(): void $this->expectException(LogicException::class); $this->expectExceptionMessage('Property \'foo\' has multiple getter methods - this is insane!'); - $dtoMock = (new DummyDto()) + $dtoMock = new DummyDto() ->setFoo('foo'); - (new User()) + new User() ->patch($dtoMock); } @@ -100,7 +100,7 @@ public function testThatPatchCallsExpectedMethods(): void ->method('getEmail') ->willReturn('email@com'); - $dto = (new User()) + $dto = new User() ->patch($dtoUser); self::assertInstanceOf(User::class, $dto); @@ -134,7 +134,7 @@ public function testThatUpdateMethodCallsExpectedMethods(): void ->with('password') ->willReturn($userEntity); - (new User()) + new User() ->setUsername('username') ->setEmail('email@com') ->setPassword('password') diff --git a/tests/Integration/DTO/User/UserPatchTest.php b/tests/Integration/DTO/User/UserPatchTest.php index f60cded97..e80f3dedd 100644 --- a/tests/Integration/DTO/User/UserPatchTest.php +++ b/tests/Integration/DTO/User/UserPatchTest.php @@ -30,19 +30,19 @@ class UserPatchTest extends DtoTestCase #[TestDox('Test that `setUserGroups` method updates entity correctly')] public function testThatUserGroupsAreExpected(): void { - $userGroup1 = (new UserGroup()) + $userGroup1 = new UserGroup() ->setName('Group 1') ->setRole(new Role('Role 1')); - $userGroup2 = (new UserGroup()) + $userGroup2 = new UserGroup() ->setName('Group 2') ->setRole(new Role('Role 2')); - $user = (new User()) + $user = new User() ->setUsername('username') ->addUserGroup($userGroup1); - $dto = (new UserPatch())->load($user) + $dto = new UserPatch()->load($user) ->setUserGroups([$userGroup2]); /** @var User $updatedUser */ diff --git a/tests/Integration/DTO/User/UserTest.php b/tests/Integration/DTO/User/UserTest.php index e1a466211..87c1dffbf 100644 --- a/tests/Integration/DTO/User/UserTest.php +++ b/tests/Integration/DTO/User/UserTest.php @@ -36,19 +36,19 @@ public function testThatLoadMethodWorks(): void $roleEntity = new RoleEntity('test role'); // Create UserGroup entity - $userGroupEntity = (new UserGroupEntity()) + $userGroupEntity = new UserGroupEntity() ->setName('test user group') ->setRole($roleEntity); // Create User entity - $userEntity = (new UserEntity()) + $userEntity = new UserEntity() ->setUsername('username') ->setFirstName('first name') ->setLastName('last name') ->setEmail('firstname.surname@test.com') ->addUserGroup($userGroupEntity); - $dto = (new UserDto()) + $dto = new UserDto() ->load($userEntity); self::assertSame('username', $dto->getUsername()); @@ -71,7 +71,7 @@ public function testThatUpdateMethodCallsExpectedEntityMethodIfPasswordIsVisited ->method('setPlainPassword') ->with('password'); - (new UserDto()) + new UserDto() ->setPassword('password') ->update($entity); } @@ -98,7 +98,7 @@ public function testThatUpdateMethodCallsExpectedEntityMethodsIfUserGroupsIsVisi ->method('addUserGroup') ->willReturn($entity); - (new UserDto()) + new UserDto() ->setUserGroups($userGroups) ->update($entity); } diff --git a/tests/Integration/DTO/User/UserUpdateTest.php b/tests/Integration/DTO/User/UserUpdateTest.php index 123e33f5c..d984d105d 100644 --- a/tests/Integration/DTO/User/UserUpdateTest.php +++ b/tests/Integration/DTO/User/UserUpdateTest.php @@ -30,19 +30,19 @@ class UserUpdateTest extends DtoTestCase #[TestDox('Test that `setUserGroups` method updates entity correctly')] public function testThatUserGroupsAreExpected(): void { - $userGroup1 = (new UserGroup()) + $userGroup1 = new UserGroup() ->setName('Group 1') ->setRole(new Role('Role 1')); - $userGroup2 = (new UserGroup()) + $userGroup2 = new UserGroup() ->setName('Group 2') ->setRole(new Role('Role 2')); - $user = (new User()) + $user = new User() ->setUsername('username') ->addUserGroup($userGroup1); - $dto = (new UserUpdate()) + $dto = new UserUpdate() ->load($user) ->setUserGroups([$userGroup2]); diff --git a/tests/Integration/DTO/UserGroup/UserGroupTest.php b/tests/Integration/DTO/UserGroup/UserGroupTest.php index 472dce7bf..9eb24ef00 100644 --- a/tests/Integration/DTO/UserGroup/UserGroupTest.php +++ b/tests/Integration/DTO/UserGroup/UserGroupTest.php @@ -33,11 +33,11 @@ public function testThatLoadCallsExpectedEntityMethods(): void $roleEntity = new RoleEntity('test role'); // Create UserGroup entity - $userGroupEntity = (new UserGroupEntity()) + $userGroupEntity = new UserGroupEntity() ->setName('test user group') ->setRole($roleEntity); - $dto = (new UserGroup()) + $dto = new UserGroup() ->load($userGroupEntity); self::assertSame('test user group', $dto->getName()); @@ -64,7 +64,7 @@ public function testThatUpdateMethodCallsExpectedEntityMethods(): void ->with($roleEntity) ->willReturn($userGroupEntity); - (new UserGroup()) + new UserGroup() ->setName('test name') ->setRole($roleEntity) ->update($userGroupEntity); diff --git a/tests/Integration/Entity/UserTest.php b/tests/Integration/Entity/UserTest.php index 1c18e3200..666fb9975 100644 --- a/tests/Integration/Entity/UserTest.php +++ b/tests/Integration/Entity/UserTest.php @@ -111,8 +111,8 @@ public function testThatEraseCredentialsMethodWorksAsExpected(): void #[TestDox('Test that `getRoles` method returns expected roles')] public function testThatGetRolesReturnsExpectedRoles(): void { - $group = (new UserGroup())->setRole(new Role('ROLE_ROOT')); - $user = (new User())->addUserGroup($group); + $group = new UserGroup()->setRole(new Role('ROLE_ROOT')); + $user = new User()->addUserGroup($group); self::assertSame(['ROLE_ROOT'], $user->getRoles()); } diff --git a/tests/Integration/EventListener/UserEntityEventListenerTest.php b/tests/Integration/EventListener/UserEntityEventListenerTest.php index 95c237e17..d2883c9ad 100644 --- a/tests/Integration/EventListener/UserEntityEventListenerTest.php +++ b/tests/Integration/EventListener/UserEntityEventListenerTest.php @@ -34,7 +34,7 @@ public function testThatTooShortPasswordThrowsAnExceptionWithPrePersist(): void { [$entityManager, $hasher] = $this->getServices(); - $entity = (new User()) + $entity = new User() ->setUsername('john_doe_the_tester') ->setEmail('john.doe_the_tester@test.com') ->setFirstName('John') @@ -50,7 +50,7 @@ public function testThatTooShortPasswordThrowsAnExceptionWithPrePersist(): void $event = new LifecycleEventArgs($entity, $entityManager); // Call listener method - (new UserEntityEventListener($hasher))->prePersist($event); + new UserEntityEventListener($hasher)->prePersist($event); } /** @@ -61,7 +61,7 @@ public function testThatTooShortPasswordThrowsAnExceptionWithPreUpdate(): void { [$entityManager, $hasher] = $this->getServices(); - $entity = (new User()) + $entity = new User() ->setUsername('john_doe_the_tester') ->setEmail('john.doe_the_tester@test.com') ->setFirstName('John') @@ -77,7 +77,7 @@ public function testThatTooShortPasswordThrowsAnExceptionWithPreUpdate(): void $event = new PreUpdateEventArgs($entity, $entityManager, $changeSet); - (new UserEntityEventListener($hasher))->preUpdate($event); + new UserEntityEventListener($hasher)->preUpdate($event); } /** @@ -88,7 +88,7 @@ public function testListenerPrePersistMethodWorksAsExpected(): void { [$entityManager, $hasher] = $this->getServices(); - $entity = (new User()) + $entity = new User() ->setUsername('john_doe_the_tester') ->setEmail('john.doe_the_tester@test.com') ->setFirstName('John') @@ -104,7 +104,7 @@ public function testListenerPrePersistMethodWorksAsExpected(): void $event = new LifecycleEventArgs($entity, $entityManager); // Call listener method - (new UserEntityEventListener($hasher))->prePersist($event); + new UserEntityEventListener($hasher)->prePersist($event); self::assertEmpty( $entity->getPlainPassword(), @@ -131,7 +131,7 @@ public function testListenerPreUpdateMethodWorksAsExpected(): void { [$entityManager, $hasher] = $this->getServices(); - $entity = (new User()) + $entity = new User() ->setUsername('john_doe_the_tester') ->setEmail('john.doe_the_tester@test.com') ->setFirstName('John') @@ -154,7 +154,7 @@ public function testListenerPreUpdateMethodWorksAsExpected(): void $event = new PreUpdateEventArgs($entity, $entityManager, $changeSet); - (new UserEntityEventListener($hasher))->preUpdate($event); + new UserEntityEventListener($hasher)->preUpdate($event); self::assertEmpty( $entity->getPlainPassword(), diff --git a/tests/Integration/EventSubscriber/AcceptLanguageSubscriberTest.php b/tests/Integration/EventSubscriber/AcceptLanguageSubscriberTest.php index 5b1a69f6d..717cd07a0 100644 --- a/tests/Integration/EventSubscriber/AcceptLanguageSubscriberTest.php +++ b/tests/Integration/EventSubscriber/AcceptLanguageSubscriberTest.php @@ -58,7 +58,7 @@ public function testThatLocaleIsSetAsExpected(string $expected, string $default, $event = new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST); - (new AcceptLanguageSubscriber($default)) + new AcceptLanguageSubscriber($default) ->onKernelRequest($event); self::assertSame($expected, $request->getLocale()); diff --git a/tests/Integration/EventSubscriber/AuthenticationFailureSubscriberTest.php b/tests/Integration/EventSubscriber/AuthenticationFailureSubscriberTest.php index 3bfb771de..1eacda25e 100644 --- a/tests/Integration/EventSubscriber/AuthenticationFailureSubscriberTest.php +++ b/tests/Integration/EventSubscriber/AuthenticationFailureSubscriberTest.php @@ -31,7 +31,7 @@ class AuthenticationFailureSubscriberTest extends KernelTestCase */ public function testThatOnAuthenticationFailureCallsExpectedServiceMethodsWhenUserPresent(): void { - $user = (new User()) + $user = new User() ->setUsername('test-user'); $token = new UsernamePasswordToken(new SecurityUser($user), 'firewall'); @@ -62,7 +62,7 @@ public function testThatOnAuthenticationFailureCallsExpectedServiceMethodsWhenUs ->expects($this->once()) ->method('process'); - (new AuthenticationFailureSubscriber($loginLogger, $userRepository)) + new AuthenticationFailureSubscriber($loginLogger, $userRepository) ->onAuthenticationFailure($event); } diff --git a/tests/Integration/EventSubscriber/AuthenticationSuccessSubscriberTest.php b/tests/Integration/EventSubscriber/AuthenticationSuccessSubscriberTest.php index 8f25bb18b..2f52aa800 100644 --- a/tests/Integration/EventSubscriber/AuthenticationSuccessSubscriberTest.php +++ b/tests/Integration/EventSubscriber/AuthenticationSuccessSubscriberTest.php @@ -29,7 +29,7 @@ class AuthenticationSuccessSubscriberTest extends KernelTestCase */ public function testThatOnAuthenticationSuccessMethodCallsExpectedLoggerMethods(): void { - $userEntity = (new User())->setUsername('test_user'); + $userEntity = new User()->setUsername('test_user'); $securityUser = new SecurityUser($userEntity); $event = new AuthenticationSuccessEvent([], $securityUser, new Response()); @@ -52,7 +52,7 @@ public function testThatOnAuthenticationSuccessMethodCallsExpectedLoggerMethods( ->with($userEntity->getId()) ->willReturn($userEntity); - (new AuthenticationSuccessSubscriber($loginLogger, $userRepository)) + new AuthenticationSuccessSubscriber($loginLogger, $userRepository) ->onAuthenticationSuccess($event); } } diff --git a/tests/Integration/EventSubscriber/BodySubscriberTest.php b/tests/Integration/EventSubscriber/BodySubscriberTest.php index 2b154974e..332de2093 100644 --- a/tests/Integration/EventSubscriber/BodySubscriberTest.php +++ b/tests/Integration/EventSubscriber/BodySubscriberTest.php @@ -41,7 +41,7 @@ public function testThatEmptyBodyWorksLikeExpected(): void $event = new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST); - (new BodySubscriber()) + new BodySubscriber() ->onKernelRequest($event); self::assertEmpty($request->query->all()); @@ -73,7 +73,7 @@ public function testThatNonJsonContentTypeWorksLikeExpected(): void $event = new RequestEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST); - (new BodySubscriber()) + new BodySubscriber() ->onKernelRequest($event); self::assertSame($inputQuery, $request->query->all()); diff --git a/tests/Integration/EventSubscriber/DoctrineExtensionSubscriberTest.php b/tests/Integration/EventSubscriber/DoctrineExtensionSubscriberTest.php index 407a559b2..492d7667c 100644 --- a/tests/Integration/EventSubscriber/DoctrineExtensionSubscriberTest.php +++ b/tests/Integration/EventSubscriber/DoctrineExtensionSubscriberTest.php @@ -41,7 +41,7 @@ public function testThatUserIsNotSetToBlameableListenerWhenThereIsNotLoggedInUse ->expects(self::never()) ->method('setUserValue'); - (new DoctrineExtensionSubscriber($blameableListener, $userTypeIdentification)) + new DoctrineExtensionSubscriber($blameableListener, $userTypeIdentification) ->onKernelRequest(); } @@ -66,7 +66,7 @@ public function testThatUserIsSetToBlameableListenerWhenThereIsLoggedInUser(): v ->method('setUserValue') ->with($user); - (new DoctrineExtensionSubscriber($blameableListener, $userTypeIdentification)) + new DoctrineExtensionSubscriber($blameableListener, $userTypeIdentification) ->onKernelRequest(); } diff --git a/tests/Integration/EventSubscriber/ExceptionSubscriberTest.php b/tests/Integration/EventSubscriber/ExceptionSubscriberTest.php index 2e72c7b7e..1fea7d97d 100644 --- a/tests/Integration/EventSubscriber/ExceptionSubscriberTest.php +++ b/tests/Integration/EventSubscriber/ExceptionSubscriberTest.php @@ -67,7 +67,7 @@ public function testThatOnKernelExceptionMethodCallsLogger(string $environment): ->method('error') ->with((string)$exception); - (new ExceptionSubscriber($stubLogger, $stubUserTypeIdentification, $environment)) + new ExceptionSubscriber($stubLogger, $stubUserTypeIdentification, $environment) ->onKernelException($event); } @@ -87,7 +87,7 @@ public function testThatOnKernelExceptionMethodSetResponse(string $environment): $originalResponse = $event->getResponse(); - (new ExceptionSubscriber($stubLogger, $stubUserTypeIdentification, $environment)) + new ExceptionSubscriber($stubLogger, $stubUserTypeIdentification, $environment) ->onKernelException($event); self::assertNotSame($originalResponse, $event->getResponse()); @@ -119,7 +119,7 @@ public function testThatResponseHasExpectedStatusCode( $exception ); - (new ExceptionSubscriber($stubLogger, $stubUserTypeIdentification, $environment)) + new ExceptionSubscriber($stubLogger, $stubUserTypeIdentification, $environment) ->onKernelException($event); $response = $event->getResponse(); @@ -161,7 +161,7 @@ public function testThatResponseHasExpectedKeys(array $expectedKeys, string $env new Exception('error') ); - (new ExceptionSubscriber($stubLogger, $stubUserTypeIdentification, $environment)) + new ExceptionSubscriber($stubLogger, $stubUserTypeIdentification, $environment) ->onKernelException($event); $response = $event->getResponse(); diff --git a/tests/Integration/EventSubscriber/JWTCreatedSubscriberTest.php b/tests/Integration/EventSubscriber/JWTCreatedSubscriberTest.php index 907279e5e..e9bbdb65a 100644 --- a/tests/Integration/EventSubscriber/JWTCreatedSubscriberTest.php +++ b/tests/Integration/EventSubscriber/JWTCreatedSubscriberTest.php @@ -32,7 +32,7 @@ public function testThatPayloadContainsExpectedDataWhenRequestIsPresent(): void $logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); // Create new user for JWT - $user = (new User()) + $user = new User() ->setFirstName('first name') ->setLastName('last name') ->setEmail('firstname.surname@test.com'); @@ -44,7 +44,7 @@ public function testThatPayloadContainsExpectedDataWhenRequestIsPresent(): void // Create JWTCreatedEvent $event = new JWTCreatedEvent([], new SecurityUser($user)); - (new JWTCreatedSubscriber($requestStack, $logger)) + new JWTCreatedSubscriber($requestStack, $logger) ->onJWTCreated($event); $keys = ['exp', 'checksum']; @@ -59,7 +59,7 @@ public function testThatPayloadContainsExpectedDataWhenRequestIsNotPresent(): vo $logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); // Create new user for JWT - $user = (new User()) + $user = new User() ->setFirstName('first name') ->setLastName('last name') ->setEmail('firstname.surname@test.com'); @@ -67,7 +67,7 @@ public function testThatPayloadContainsExpectedDataWhenRequestIsNotPresent(): vo // Create JWTCreatedEvent $event = new JWTCreatedEvent([], new SecurityUser($user)); - (new JWTCreatedSubscriber(new RequestStack(), $logger)) + new JWTCreatedSubscriber(new RequestStack(), $logger) ->onJWTCreated($event); $keys = ['exp']; @@ -89,7 +89,7 @@ public function testThatLoggerAlertIsCalledIfRequestDoesNotExist(): void ->with('Request not available'); // Create new user for JWT - $user = (new User()) + $user = new User() ->setFirstName('first name') ->setLastName('last name') ->setEmail('firstname.surname@test.com'); @@ -97,7 +97,7 @@ public function testThatLoggerAlertIsCalledIfRequestDoesNotExist(): void // Create JWTCreatedEvent $event = new JWTCreatedEvent([], new SecurityUser($user)); - (new JWTCreatedSubscriber(new RequestStack(), $logger)) + new JWTCreatedSubscriber(new RequestStack(), $logger) ->onJWTCreated($event); } @@ -106,7 +106,7 @@ public function testThatExpectedLocalizationDataIsSetWhenUsingSecurityUser(): vo $logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); // Create new user for JWT - $user = (new User()) + $user = new User() ->setFirstName('first name') ->setLastName('last name') ->setEmail('firstname.surname@test.com') @@ -121,7 +121,7 @@ public function testThatExpectedLocalizationDataIsSetWhenUsingSecurityUser(): vo // Create JWTCreatedEvent $event = new JWTCreatedEvent([], new SecurityUser($user)); - (new JWTCreatedSubscriber($requestStack, $logger)) + new JWTCreatedSubscriber($requestStack, $logger) ->onJWTCreated($event); $keys = ['language', 'locale', 'timezone']; @@ -148,7 +148,7 @@ public function testThatDefaultLocalizationDataIsSetWhenNotUsingSecurityUser(): // Create JWTCreatedEvent $event = new JWTCreatedEvent([], $user); - (new JWTCreatedSubscriber($requestStack, $logger)) + new JWTCreatedSubscriber($requestStack, $logger) ->onJWTCreated($event); $keys = ['language', 'locale', 'timezone']; diff --git a/tests/Integration/EventSubscriber/JWTDecodedSubscriberTest.php b/tests/Integration/EventSubscriber/JWTDecodedSubscriberTest.php index d96290025..3f3f9fb8d 100644 --- a/tests/Integration/EventSubscriber/JWTDecodedSubscriberTest.php +++ b/tests/Integration/EventSubscriber/JWTDecodedSubscriberTest.php @@ -41,7 +41,7 @@ public function testThatJwtIsMarkedInvalidIfChecksumDiffers(): void $event = new JWTDecodedEvent($payload); // Create subscriber and call actual process method - (new JWTDecodedSubscriber($requestStack, $logger)) + new JWTDecodedSubscriber($requestStack, $logger) ->onJWTDecoded($event); self::assertFalse($event->isValid(), 'JWTDecodedEvent did not mark event as invalid.'); @@ -70,7 +70,7 @@ public function testThatJwtIsNotMarkedInvalidIfChecksumMatches(): void $event = new JWTDecodedEvent($payload); // Create subscriber and call actual process method - (new JWTDecodedSubscriber($requestStack, $logger)) + new JWTDecodedSubscriber($requestStack, $logger) ->onJWTDecoded($event); self::assertTrue($event->isValid(), 'JWTDecodedEvent did mark event as invalid.'); @@ -84,7 +84,7 @@ public function testThatEventIsMarkedInvalidIfRequestDoesNotExist(): void $event = new JWTDecodedEvent([]); // Create subscriber and call actual process method - (new JWTDecodedSubscriber(new RequestStack(), $logger)) + new JWTDecodedSubscriber(new RequestStack(), $logger) ->onJWTDecoded($event); self::assertFalse($event->isValid(), 'JWTDecodedEvent did not mark event as invalid.'); @@ -101,7 +101,7 @@ public function testThatEventIsNotTouchedIfItHasAlreadyBeenMarkedInvalid(): void $expectedEvent = clone $event; // Create subscriber and call actual process method - (new JWTDecodedSubscriber(new RequestStack(), $logger)) + new JWTDecodedSubscriber(new RequestStack(), $logger) ->onJWTDecoded($event); self::assertSame($expectedEvent->getPayload(), $event->getPayload()); @@ -119,7 +119,7 @@ public function testThatLoggerIsCalledAndEventIsMarkedInvalidIfThereIsNoRequest( $event = new JWTDecodedEvent([]); - (new JWTDecodedSubscriber(new RequestStack(), $logger)) + new JWTDecodedSubscriber(new RequestStack(), $logger) ->onJWTDecoded($event); self::assertFalse($event->isValid()); diff --git a/tests/Integration/EventSubscriber/LockedUserSubscriberTest.php b/tests/Integration/EventSubscriber/LockedUserSubscriberTest.php index 611934e3f..f7152796b 100644 --- a/tests/Integration/EventSubscriber/LockedUserSubscriberTest.php +++ b/tests/Integration/EventSubscriber/LockedUserSubscriberTest.php @@ -60,7 +60,7 @@ public function testThatOnAuthenticationSuccessThrowsUserNotFoundException(): vo new Response() ); - (new LockedUserSubscriber($userRepository, $logLoginFailureResource, $requestStack)) + new LockedUserSubscriber($userRepository, $logLoginFailureResource, $requestStack) ->onAuthenticationSuccess($event); } @@ -113,7 +113,7 @@ public function testThatOnAuthenticationSuccessThrowsLockedException(): void $securityUser = new SecurityUser($user); $event = new AuthenticationSuccessEvent([], $securityUser, new Response()); - (new LockedUserSubscriber($userRepository, $logLoginFailureResource, $requestStack)) + new LockedUserSubscriber($userRepository, $logLoginFailureResource, $requestStack) ->onAuthenticationSuccess($event); } @@ -148,7 +148,7 @@ public function testThatOnAuthenticationSuccessResourceResetMethodIsCalled(): vo $securityUser = new SecurityUser($user); $event = new AuthenticationSuccessEvent([], $securityUser, new Response()); - (new LockedUserSubscriber($userRepository, $logLoginFailureResource, $requestStack)) + new LockedUserSubscriber($userRepository, $logLoginFailureResource, $requestStack) ->onAuthenticationSuccess($event); } @@ -178,7 +178,7 @@ public function testThatOnAuthenticationFailureTestThatResourceMethodsAreNotCall 'username' => 'test-user', ])); - (new LockedUserSubscriber($userRepository, $logLoginFailureResource, $requestStack)) + new LockedUserSubscriber($userRepository, $logLoginFailureResource, $requestStack) ->onAuthenticationFailure(); } @@ -220,7 +220,7 @@ public function testThatOnAuthenticationFailureTestThatResourceSaveMethodIsCalle ->expects(static::once()) ->method('save'); - (new LockedUserSubscriber($userRepository, $logLoginFailureResource, $requestStack)) + new LockedUserSubscriber($userRepository, $logLoginFailureResource, $requestStack) ->onAuthenticationFailure(); } } diff --git a/tests/Integration/EventSubscriber/RequestLogSubscriberTest.php b/tests/Integration/EventSubscriber/RequestLogSubscriberTest.php index 2179024a4..e476a3f13 100644 --- a/tests/Integration/EventSubscriber/RequestLogSubscriberTest.php +++ b/tests/Integration/EventSubscriber/RequestLogSubscriberTest.php @@ -88,11 +88,11 @@ public function testThatMethodCallsExpectedLoggerMethods(): void ->expects(self::never()) ->method('setApiKeyId'); - (new RequestLogSubscriber( + new RequestLogSubscriber( $requestLogger, $userTypeIdentification, [] - )) + ) ->onTerminateEvent($event); } @@ -140,11 +140,11 @@ public function testThatSetUserIsCalled(): void ->expects(self::never()) ->method('setApiKeyId'); - (new RequestLogSubscriber( + new RequestLogSubscriber( $requestLogger, $userTypeIdentification, [] - )) + ) ->onTerminateEvent($event); } @@ -192,11 +192,11 @@ public function testThatSetApiKeyIsCalled(): void ->expects(self::never()) ->method('setUserId'); - (new RequestLogSubscriber( + new RequestLogSubscriber( $requestLogger, $userTypeIdentification, [] - )) + ) ->onTerminateEvent($event); } @@ -227,11 +227,11 @@ public function testThatLoggerServiceIsNotCalledIfOptionsRequest(): void ->with($request) ->willReturn($requestLogger); - (new RequestLogSubscriber( + new RequestLogSubscriber( $requestLogger, $userTypeIdentification, [] - )) + ) ->onTerminateEvent($event); } @@ -293,11 +293,11 @@ public function testThatLoggerServiceIsNotCalledWhenUsingSpecifiedIgnoredRoute(s ->expects(self::never()) ->method('setApiKeyId'); - (new RequestLogSubscriber( + new RequestLogSubscriber( $requestLogger, $userTypeIdentification, [$ignored] - )) + ) ->onTerminateEvent($event); } diff --git a/tests/Integration/EventSubscriber/ResponseSubscriberTest.php b/tests/Integration/EventSubscriber/ResponseSubscriberTest.php index 0772537f7..01f80aa87 100644 --- a/tests/Integration/EventSubscriber/ResponseSubscriberTest.php +++ b/tests/Integration/EventSubscriber/ResponseSubscriberTest.php @@ -53,7 +53,7 @@ public function testThatSubscriberAddsHeader(): void $event = new ResponseEvent($kernel, $request, HttpKernelInterface::MAIN_REQUEST, $response); $version = new Version($kernel->getProjectDir(), $cacheStub, $logger); - (new ResponseSubscriber($version)) + new ResponseSubscriber($version) ->onKernelResponse($event); $version = $event->getResponse()->headers->get('X-API-VERSION'); diff --git a/tests/Integration/Form/DataTransformer/RoleTransformerTest.php b/tests/Integration/Form/DataTransformer/RoleTransformerTest.php index 46fface02..12d93b40f 100644 --- a/tests/Integration/Form/DataTransformer/RoleTransformerTest.php +++ b/tests/Integration/Form/DataTransformer/RoleTransformerTest.php @@ -52,7 +52,7 @@ public function testThatReverseTransformCallsExpectedResourceMethods(): void ->with($entity->getId()) ->willReturn($entity); - (new RoleTransformer($resource)) + new RoleTransformer($resource) ->reverseTransform($entity->getId()); } @@ -73,7 +73,7 @@ public function testThatReverseTransformThrowsAnException(): void ->with('role_name') ->willReturn(null); - (new RoleTransformer($resource)) + new RoleTransformer($resource) ->reverseTransform('role_name'); } diff --git a/tests/Integration/Form/DataTransformer/UserGroupTransformerTest.php b/tests/Integration/Form/DataTransformer/UserGroupTransformerTest.php index 089f4acad..9f10c7dd2 100644 --- a/tests/Integration/Form/DataTransformer/UserGroupTransformerTest.php +++ b/tests/Integration/Form/DataTransformer/UserGroupTransformerTest.php @@ -64,7 +64,7 @@ public function testThatReverseTransformCallsExpectedResourceMethods(): void ->method('findOne') ->willReturnOnConsecutiveCalls($entity1, $entity2); - (new UserGroupTransformer($resource)) + new UserGroupTransformer($resource) ->reverseTransform(['1', '2']); } @@ -86,7 +86,7 @@ public function testThatReverseTransformThrowsAnException(): void ->method('findOne') ->willReturnOnConsecutiveCalls($entity, null); - (new UserGroupTransformer($resource)) + new UserGroupTransformer($resource) ->reverseTransform(['1', '2']); } diff --git a/tests/Integration/Form/Type/Console/ApiKeyTypeTest.php b/tests/Integration/Form/Type/Console/ApiKeyTypeTest.php index a2fb267e3..b4d7c8633 100644 --- a/tests/Integration/Form/Type/Console/ApiKeyTypeTest.php +++ b/tests/Integration/Form/Type/Console/ApiKeyTypeTest.php @@ -36,7 +36,7 @@ public function testSubmitValidData(): void $roleEntity = new Role('ROLE_ADMIN'); // Create new apiKey group entity - $userGroupEntity = (new UserGroup()) + $userGroupEntity = new UserGroup() ->setRole($roleEntity) ->setName('Some name'); @@ -55,7 +55,7 @@ public function testSubmitValidData(): void $form = $this->factory->create(ApiKeyType::class); // Create new DTO object - $dto = (new ApiKeyDto()) + $dto = new ApiKeyDto() ->setDescription('description') ->setUserGroups([$userGroupEntity]); diff --git a/tests/Integration/Form/Type/Console/UserGroupTypeTest.php b/tests/Integration/Form/Type/Console/UserGroupTypeTest.php index 386bc9788..df2dc72fe 100644 --- a/tests/Integration/Form/Type/Console/UserGroupTypeTest.php +++ b/tests/Integration/Form/Type/Console/UserGroupTypeTest.php @@ -56,7 +56,7 @@ public function testSubmitValidData(): void $form = $this->factory->create(UserGroupType::class); // Create new DTO object - $dto = (new UserGroupDto()) + $dto = new UserGroupDto() ->setName('ROLE_ADMIN') ->setRole($roleEntity); diff --git a/tests/Integration/Form/Type/Console/UserTypeTest.php b/tests/Integration/Form/Type/Console/UserTypeTest.php index e2a6df718..964f7cff1 100644 --- a/tests/Integration/Form/Type/Console/UserTypeTest.php +++ b/tests/Integration/Form/Type/Console/UserTypeTest.php @@ -40,7 +40,7 @@ public function testSubmitValidData(): void $roleEntity = new Role('ROLE_ADMIN'); // Create new user group entity - $userGroupEntity = (new UserGroup()) + $userGroupEntity = new UserGroup() ->setRole($roleEntity); $resource @@ -76,7 +76,7 @@ public function testSubmitValidData(): void $form = $this->factory->create(UserType::class); // Create new DTO object - $dto = (new UserDto()) + $dto = new UserDto() ->setUsername('username') ->setFirstName('John') ->setLastName('Doe') diff --git a/tests/Integration/Resource/LogLoginFailureResourceTest.php b/tests/Integration/Resource/LogLoginFailureResourceTest.php index 2dd471c4b..496661e27 100644 --- a/tests/Integration/Resource/LogLoginFailureResourceTest.php +++ b/tests/Integration/Resource/LogLoginFailureResourceTest.php @@ -46,7 +46,7 @@ public function testThatResetMethodCallsExpectedRepositoryMethod(): void { $repository = $this->getMockBuilder($this->repositoryClass)->disableOriginalConstructor()->getMock(); - $user = (new User())->setUsername('username'); + $user = new User()->setUsername('username'); $repository ->expects($this->once()) @@ -57,6 +57,6 @@ public function testThatResetMethodCallsExpectedRepositoryMethod(): void /** * @var LogLoginFailureRepository $repository */ - (new LogLoginFailureResource($repository))->reset($user); // @phpstan-ignore-line + new LogLoginFailureResource($repository)->reset($user); // @phpstan-ignore-line } } diff --git a/tests/Integration/Resource/ResourceCollectionTest.php b/tests/Integration/Resource/ResourceCollectionTest.php index 0e2dbbcd5..2f9e906da 100644 --- a/tests/Integration/Resource/ResourceCollectionTest.php +++ b/tests/Integration/Resource/ResourceCollectionTest.php @@ -56,7 +56,7 @@ public function testThatGetMethodThrowsAnException(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Resource \'FooBar\' does not exist'); - (new ResourceCollection($this->getEmptyIteratorAggregate(), $logger)) + new ResourceCollection($this->getEmptyIteratorAggregate(), $logger) ->get('FooBar'); } @@ -72,7 +72,7 @@ public function testThatLoggerIsCalledIfGetMethodGetIteratorThrowsAnException(): ->expects($this->once()) ->method('error'); - (new ResourceCollection($this->getIteratorAggregateThatThrowsAnException(), $logger)) + new ResourceCollection($this->getIteratorAggregateThatThrowsAnException(), $logger) ->get('FooBar'); } @@ -84,7 +84,7 @@ public function testThatGetEntityResourceMethodThrowsAnException(): void $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('Resource class does not exist for entity \'FooBar\''); - (new ResourceCollection($this->getEmptyIteratorAggregate(), $logger)) + new ResourceCollection($this->getEmptyIteratorAggregate(), $logger) ->getEntityResource('FooBar'); } @@ -100,7 +100,7 @@ public function testThatLoggerIsCalledIfGetEntityResourceMethodGetIteratorThrows ->expects($this->once()) ->method('error'); - (new ResourceCollection($this->getIteratorAggregateThatThrowsAnException(), $logger)) + new ResourceCollection($this->getIteratorAggregateThatThrowsAnException(), $logger) ->getEntityResource('FooBar'); } diff --git a/tests/Integration/Resource/UserResourceTest.php b/tests/Integration/Resource/UserResourceTest.php index 2571e64e9..8f6e83e49 100644 --- a/tests/Integration/Resource/UserResourceTest.php +++ b/tests/Integration/Resource/UserResourceTest.php @@ -51,8 +51,8 @@ public function testThatGetUsersForGroupMethodCallsExpectedServiceMethods(): voi $repository = $this->getMockBuilder(UserRepository::class)->disableOriginalConstructor()->getMock(); $rolesService = $this->getMockBuilder(RolesService::class)->disableOriginalConstructor()->getMock(); - $userGroup = (new UserGroup())->setRole(new Role('Some Role')); - $user = (new User())->addUserGroup($userGroup); + $userGroup = new UserGroup()->setRole(new Role('Some Role')); + $user = new User()->addUserGroup($userGroup); $repository ->expects($this->once()) @@ -66,6 +66,6 @@ public function testThatGetUsersForGroupMethodCallsExpectedServiceMethods(): voi ->with(['Some Role']) ->willReturn(['Some Role']); - self::assertSame([$user], (new UserResource($repository, $rolesService))->getUsersForGroup($userGroup)); + self::assertSame([$user], new UserResource($repository, $rolesService)->getUsersForGroup($userGroup)); } } diff --git a/tests/Integration/Rest/ControllerCollectionTest.php b/tests/Integration/Rest/ControllerCollectionTest.php index 1f9a34f36..24bce928e 100644 --- a/tests/Integration/Rest/ControllerCollectionTest.php +++ b/tests/Integration/Rest/ControllerCollectionTest.php @@ -72,7 +72,7 @@ public function getIterator(): ArrayObject } }; - (new ControllerCollection($iteratorAggregate, $stubLogger))->get('FooBar'); + new ControllerCollection($iteratorAggregate, $stubLogger)->get('FooBar'); } #[TestDox('Test that `getAll` method returns expected count of `REST` controllers')] diff --git a/tests/Integration/Rest/ResponseHandlerTest.php b/tests/Integration/Rest/ResponseHandlerTest.php index 85eecf074..9d30572e4 100644 --- a/tests/Integration/Rest/ResponseHandlerTest.php +++ b/tests/Integration/Rest/ResponseHandlerTest.php @@ -53,7 +53,7 @@ public function testThatCreateResponseReturnsExpected( $serializer = self::getContainer()->get(SerializerInterface::class); $stubResourceService = $this->createMock(RestResourceInterface::class); - $httpResponse = (new ResponseHandler($serializer))->createResponse($request, $data, $stubResourceService, 200); + $httpResponse = new ResponseHandler($serializer)->createResponse($request, $data, $stubResourceService, 200); self::assertSame($expectedContent, $httpResponse->getContent()); } @@ -77,7 +77,7 @@ public function testThatCreateResponseThrowsAnExceptionIfSerializationFails(): v ->withAnyParameters() ->willThrowException($exception); - (new ResponseHandler($stubSerializer)) + new ResponseHandler($stubSerializer) ->createResponse($request, []); } @@ -107,7 +107,7 @@ public function testThatNonSupportedSerializerFormatThrowsHttpException(string $ $stubResourceService = $this->createMock(RestResourceInterface::class); - (new ResponseHandler($serializer)) + new ResponseHandler($serializer) ->createResponse( $request, [ @@ -154,7 +154,7 @@ public function testThatHandleFormErrorThrowsExpectedExceptionWithProperty(): vo ->method('getMessage') ->willReturn('test error'); - (new ResponseHandler($serializer))->handleFormError($formInterface); + new ResponseHandler($serializer)->handleFormError($formInterface); } /** @@ -193,7 +193,7 @@ public function testThatHandleFormErrorThrowsExpectedExceptionWithoutProperty(): ->method('getMessage') ->willReturn('test error'); - (new ResponseHandler($serializer))->handleFormError($formInterface); + new ResponseHandler($serializer)->handleFormError($formInterface); } /** @@ -214,7 +214,7 @@ public function testThatGetSerializeContextReturnsExpectedWhenUsingPopulateAll() ], ); - $output = (new ResponseHandler($serializer))->getSerializeContext($request, $resource); + $output = new ResponseHandler($serializer)->getSerializeContext($request, $resource); $expectedContext = [ 'groups' => [ @@ -247,7 +247,7 @@ public function testThatGetSerializeContextReturnsExpectedWhenUsingPopulateOnly( ], ); - $output = (new ResponseHandler($serializer))->getSerializeContext($request, $resource); + $output = new ResponseHandler($serializer)->getSerializeContext($request, $resource); $expectedContext = [ 'groups' => [ diff --git a/tests/Integration/Rest/Traits/Methods/CountMethodTest.php b/tests/Integration/Rest/Traits/Methods/CountMethodTest.php index 11673ff20..fcdb8ae43 100644 --- a/tests/Integration/Rest/Traits/Methods/CountMethodTest.php +++ b/tests/Integration/Rest/Traits/Methods/CountMethodTest.php @@ -47,7 +47,7 @@ public function testThatTraitThrowsAnException(): void $this->expectException(LogicException::class); $this->expectExceptionMessageMatches($regex); - (new CountMethodInvalidTestClass()) + new CountMethodInvalidTestClass() ->countMethod(Request::create('/')); } @@ -65,7 +65,7 @@ public function testThatTraitThrowsAnExceptionWithWrongHttpMethod(string $httpMe ->disableOriginalConstructor() ->getMock(); - (new CountMethodTestClass($resourceMock, $responseHandlerMock)) + new CountMethodTestClass($resourceMock, $responseHandlerMock) ->countMethod(Request::create('/', $httpMethod)) ->getContent(); } @@ -91,7 +91,7 @@ public function testThatTraitHandlesException(Throwable $exception, int $expecte ->with([], []) ->willThrowException($exception); - (new CountMethodTestClass($resourceMock, $responseHandlerMock)) + new CountMethodTestClass($resourceMock, $responseHandlerMock) ->countMethod(Request::create('/')); } @@ -136,7 +136,7 @@ public function testThatTraitCallsServiceMethods( $resourceMock ); - (new CountMethodTestClass($resourceMock, $responseHandlerMock)) + new CountMethodTestClass($resourceMock, $responseHandlerMock) ->countMethod($request); } @@ -155,7 +155,7 @@ public function testThatTraitThrowsAnExceptionWhenWhereParameterIsNotValidJson() $this->expectExceptionCode(400); $this->expectExceptionMessage('Current \'where\' parameter is not valid JSON.'); - (new CountMethodTestClass($resourceMock, $responseHandlerMock)) + new CountMethodTestClass($resourceMock, $responseHandlerMock) ->countMethod(Request::create('/?where=foo')); } diff --git a/tests/Integration/Rest/Traits/Methods/CreateMethodTest.php b/tests/Integration/Rest/Traits/Methods/CreateMethodTest.php index 1a0bffb9f..34a4dbd62 100644 --- a/tests/Integration/Rest/Traits/Methods/CreateMethodTest.php +++ b/tests/Integration/Rest/Traits/Methods/CreateMethodTest.php @@ -48,7 +48,7 @@ public function testThatTraitThrowsAnException(): void $this->expectException(LogicException::class); $this->expectExceptionMessageMatches($regex); - (new CreateMethodInvalidTestClass()) + new CreateMethodInvalidTestClass() ->createMethod( Request::create('/', Request::METHOD_POST), $this->getMockBuilder(RestDtoInterface::class)->getMock(), @@ -70,7 +70,7 @@ public function testThatTraitThrowsAnExceptionWithWrongHttpMethod(string $httpMe ->disableOriginalConstructor() ->getMock(); - (new CreateMethodTestClass($resourceMock, $responseHandlerMock)) + new CreateMethodTestClass($resourceMock, $responseHandlerMock) ->createMethod(Request::create('/', $httpMethod), $restDtoMock) ->getContent(); } @@ -97,7 +97,7 @@ public function testThatHandleRestMethodExceptionIsCalled(Throwable $exception, $this->expectException(HttpException::class); $this->expectExceptionCode($expectedCode); - (new CreateMethodTestClass($resourceMock, $responseHandlerMock)) + new CreateMethodTestClass($resourceMock, $responseHandlerMock) ->createMethod(Request::create('/', Request::METHOD_POST), $restDtoMock) ->getContent(); } @@ -128,7 +128,7 @@ public function testThatTraitCallsServiceMethods(): void ->method('createResponse') ->with($request, $entityMock, $resourceMock, Response::HTTP_CREATED); - (new CreateMethodTestClass($resourceMock, $responseHandlerMock)) + new CreateMethodTestClass($resourceMock, $responseHandlerMock) ->createMethod($request, $restDtoMock); } diff --git a/tests/Integration/Rest/Traits/Methods/DeleteMethodTest.php b/tests/Integration/Rest/Traits/Methods/DeleteMethodTest.php index 8c9d69c35..072b5a9ab 100644 --- a/tests/Integration/Rest/Traits/Methods/DeleteMethodTest.php +++ b/tests/Integration/Rest/Traits/Methods/DeleteMethodTest.php @@ -48,7 +48,7 @@ public function testThatTraitThrowsAnException(): void $this->expectException(LogicException::class); $this->expectExceptionMessageMatches($regex); - (new DeleteMethodInvalidTestClass()) + new DeleteMethodInvalidTestClass() ->deleteMethod( Request::create('/' . Uuid::uuid4()->toString(), Request::METHOD_DELETE), 'some-id', @@ -69,7 +69,7 @@ public function testThatTraitThrowsAnExceptionWithWrongHttpMethod(string $httpMe $this->expectException(MethodNotAllowedHttpException::class); - (new DeleteMethodTestClass($resourceMock, $responseHandlerMock)) + new DeleteMethodTestClass($resourceMock, $responseHandlerMock) ->deleteMethod(Request::create('/' . Uuid::uuid4()->toString(), $httpMethod), 'some-id'); } @@ -96,7 +96,7 @@ public function testThatTraitHandlesException(Throwable $exception, int $expecte $this->expectException(HttpException::class); $this->expectExceptionCode($expectedCode); - (new DeleteMethodTestClass($resourceMock, $responseHandlerMock)) + new DeleteMethodTestClass($resourceMock, $responseHandlerMock) ->deleteMethod(Request::create('/' . $uuid, Request::METHOD_DELETE), $uuid); } @@ -126,7 +126,7 @@ public function testThatTraitCallsServiceMethods(): void ->method('createResponse') ->with($request, $entityMock, $resourceMock); - (new DeleteMethodTestClass($resourceMock, $responseHandlerMock)) + new DeleteMethodTestClass($resourceMock, $responseHandlerMock) ->deleteMethod($request, $uuid); } diff --git a/tests/Integration/Rest/Traits/Methods/FindMethodTest.php b/tests/Integration/Rest/Traits/Methods/FindMethodTest.php index 7b75ada1e..fa36ed51c 100644 --- a/tests/Integration/Rest/Traits/Methods/FindMethodTest.php +++ b/tests/Integration/Rest/Traits/Methods/FindMethodTest.php @@ -47,7 +47,7 @@ public function testThatTraitThrowsAnException(): void $this->expectException(LogicException::class); $this->expectExceptionMessageMatches($regex); - (new FindMethodInvalidTestClass()) + new FindMethodInvalidTestClass() ->findMethod(Request::create('/')); } @@ -65,7 +65,7 @@ public function testThatTraitThrowsAnExceptionWithWrongHttpMethod(string $httpMe ->disableOriginalConstructor() ->getMock(); - (new FindMethodTestClass($resourceMock, $responseHandlerMock)) + new FindMethodTestClass($resourceMock, $responseHandlerMock) ->findMethod(Request::create('/', $httpMethod))->getContent(); } @@ -90,7 +90,7 @@ public function testThatTraitHandlesException(Throwable $exception, int $expecte ->with([], [], null, null, []) ->willThrowException($exception); - (new FindMethodTestClass($resourceMock, $responseHandlerMock)) + new FindMethodTestClass($resourceMock, $responseHandlerMock) ->findMethod(Request::create('/')); } @@ -138,7 +138,7 @@ public function testThatTraitCallsServiceMethods( ->method('createResponse') ->with($request, [], $resourceMock); - (new FindMethodTestClass($resourceMock, $responseHandlerMock)) + new FindMethodTestClass($resourceMock, $responseHandlerMock) ->findMethod($request); } @@ -157,7 +157,7 @@ public function testThatTraitThrowsAnExceptionWhenWhereParameterIsNotValidJson() ->disableOriginalConstructor() ->getMock(); - (new FindMethodTestClass($resourceMock, $responseHandlerMock)) + new FindMethodTestClass($resourceMock, $responseHandlerMock) ->findMethod(Request::create('/?where=foo')); } diff --git a/tests/Integration/Rest/Traits/Methods/FindOneMethodTest.php b/tests/Integration/Rest/Traits/Methods/FindOneMethodTest.php index 4a09f0a40..f4aa82c58 100644 --- a/tests/Integration/Rest/Traits/Methods/FindOneMethodTest.php +++ b/tests/Integration/Rest/Traits/Methods/FindOneMethodTest.php @@ -48,7 +48,7 @@ public function testThatTraitThrowsAnException(): void $this->expectException(LogicException::class); $this->expectExceptionMessageMatches($regex); - (new FindOneMethodInvalidTestClass()) + new FindOneMethodInvalidTestClass() ->findOneMethod(Request::create('/' . Uuid::uuid4()->toString()), 'some-id'); } @@ -66,7 +66,7 @@ public function testThatTraitThrowsAnExceptionWithWrongHttpMethod(string $httpMe ->disableOriginalConstructor() ->getMock(); - (new FindOneMethodTestClass($resourceMock, $responseHandlerMock)) + new FindOneMethodTestClass($resourceMock, $responseHandlerMock) ->findOneMethod(Request::create('/' . Uuid::uuid4()->toString(), $httpMethod), 'some-id') ->getContent(); } @@ -94,7 +94,7 @@ public function testThatTraitHandlesException(Throwable $exception, int $expecte ->with($uuid) ->willThrowException($exception); - (new FindOneMethodTestClass($resourceMock, $responseHandlerMock)) + new FindOneMethodTestClass($resourceMock, $responseHandlerMock) ->findOneMethod(Request::create('/' . $uuid), $uuid); } @@ -124,7 +124,7 @@ public function testThatTraitCallsServiceMethods(): void ->method('createResponse') ->with($request, $entityMock, $resourceMock); - (new FindOneMethodTestClass($resourceMock, $responseHandlerMock)) + new FindOneMethodTestClass($resourceMock, $responseHandlerMock) ->findOneMethod($request, $uuid); } diff --git a/tests/Integration/Rest/Traits/Methods/IdsMethodTest.php b/tests/Integration/Rest/Traits/Methods/IdsMethodTest.php index 150846089..f5c6b1d56 100644 --- a/tests/Integration/Rest/Traits/Methods/IdsMethodTest.php +++ b/tests/Integration/Rest/Traits/Methods/IdsMethodTest.php @@ -47,7 +47,7 @@ public function testThatTraitThrowsAnException(): void $this->expectException(LogicException::class); $this->expectExceptionMessageMatches($regex); - (new IdsMethodInvalidTestClass()) + new IdsMethodInvalidTestClass() ->idsMethod(Request::create('/')); } @@ -66,7 +66,7 @@ public function testThatTraitThrowsAnExceptionWithWrongHttpMethod(string $httpMe ->disableOriginalConstructor() ->getMock(); - (new IdsMethodTestClass($resourceMock, $responseHandlerMock)) + new IdsMethodTestClass($resourceMock, $responseHandlerMock) ->idsMethod(Request::create('/', $httpMethod)) ->getContent(); } @@ -93,7 +93,7 @@ public function testThatTraitHandlesException(Throwable $exception, int $expecte ->with([], []) ->willThrowException($exception); - (new IdsMethodTestClass($resourceMock, $responseHandlerMock)) + new IdsMethodTestClass($resourceMock, $responseHandlerMock) ->idsMethod(Request::create('/')); } @@ -131,7 +131,7 @@ public function testThatTraitCallsServiceMethods( ->method('createResponse') ->with($request, [], $resourceMock); - (new IdsMethodTestClass($resourceMock, $responseHandlerMock)) + new IdsMethodTestClass($resourceMock, $responseHandlerMock) ->idsMethod($request); } @@ -151,7 +151,7 @@ public function testThatTraitThrowsAnExceptionWhenWhereParameterIsNotValidJson() ->disableOriginalConstructor() ->getMock(); - (new IdsMethodTestClass($resourceMock, $responseHandlerMock)) + new IdsMethodTestClass($resourceMock, $responseHandlerMock) ->idsMethod(Request::create('/?where=foo')); } diff --git a/tests/Integration/Rest/Traits/Methods/PatchMethodTest.php b/tests/Integration/Rest/Traits/Methods/PatchMethodTest.php index 7b8e15cd8..b722df08f 100644 --- a/tests/Integration/Rest/Traits/Methods/PatchMethodTest.php +++ b/tests/Integration/Rest/Traits/Methods/PatchMethodTest.php @@ -49,7 +49,7 @@ public function testThatTraitThrowsAnException(): void $this->expectException(LogicException::class); $this->expectExceptionMessageMatches($regex); - (new PatchMethodInvalidTestClass()) + new PatchMethodInvalidTestClass() ->patchMethod( Request::create('/' . Uuid::uuid4()->toString(), Request::METHOD_PATCH), $this->getMockBuilder(RestDtoInterface::class)->getMock(), @@ -71,7 +71,7 @@ public function testThatTraitThrowsAnExceptionWithWrongHttpMethod(string $httpMe ->disableOriginalConstructor() ->getMock(); - (new PatchMethodTestClass($resourceMock, $responseHandlerMock)) + new PatchMethodTestClass($resourceMock, $responseHandlerMock) ->patchMethod( Request::create('/' . Uuid::uuid4()->toString(), $httpMethod), $this->getMockBuilder(RestDtoInterface::class)->getMock(), @@ -104,7 +104,7 @@ public function testThatTraitHandlesException(Throwable $exception, int $expecte $this->expectException(HttpException::class); $this->expectExceptionCode($expectedCode); - (new PatchMethodTestClass($resourceMock, $responseHandlerMock)) + new PatchMethodTestClass($resourceMock, $responseHandlerMock) ->patchMethod( Request::create('/' . $uuid, Request::METHOD_PATCH), $restDtoMock, @@ -140,7 +140,7 @@ public function testThatTraitCallsServiceMethods(): void ->method('createResponse') ->with($request, $entityMock, $resourceMock); - (new PatchMethodTestClass($resourceMock, $responseHandlerMock)) + new PatchMethodTestClass($resourceMock, $responseHandlerMock) ->patchMethod($request, $restDtoMock, $uuid); } diff --git a/tests/Integration/Rest/Traits/Methods/UpdateMethodTest.php b/tests/Integration/Rest/Traits/Methods/UpdateMethodTest.php index 69ea6705a..f6ae05e03 100644 --- a/tests/Integration/Rest/Traits/Methods/UpdateMethodTest.php +++ b/tests/Integration/Rest/Traits/Methods/UpdateMethodTest.php @@ -49,7 +49,7 @@ public function testThatTraitThrowsAnException(): void $this->expectException(LogicException::class); $this->expectExceptionMessageMatches($regex); - (new UpdateMethodInvalidTestClass()) + new UpdateMethodInvalidTestClass() ->updateMethod( Request::create('/' . Uuid::uuid4()->toString(), Request::METHOD_PUT), $this->getMockBuilder(RestDtoInterface::class)->getMock(), @@ -72,7 +72,7 @@ public function testThatTraitThrowsAnExceptionWithWrongHttpMethod(string $httpMe ->getMock(); $resourceMock = $this->getMockBuilder(RestResourceInterface::class)->getMock(); - (new UpdateMethodTestClass($resourceMock, $responseHandlerMock)) + new UpdateMethodTestClass($resourceMock, $responseHandlerMock) ->updateMethod( Request::create('/' . Uuid::uuid4()->toString(), $httpMethod), $restDtoMock, @@ -105,7 +105,7 @@ public function testThatTraitHandlesException(Throwable $exception, int $expecte $this->expectException(HttpException::class); $this->expectExceptionCode($expectedCode); - (new UpdateMethodTestClass($resourceMock, $responseHandlerMock)) + new UpdateMethodTestClass($resourceMock, $responseHandlerMock) ->updateMethod(Request::create('/' . $uuid, Request::METHOD_PUT), $restDtoMock, $uuid); } @@ -136,7 +136,7 @@ public function testThatTraitCallsServiceMethods(): void ->method('createResponse') ->with($request, $entityMock, $resourceMock); - (new UpdateMethodTestClass($resourceMock, $responseHandlerMock)) + new UpdateMethodTestClass($resourceMock, $responseHandlerMock) ->updateMethod($request, $restDtoMock, $uuid); } diff --git a/tests/Integration/Security/Authenticator/ApiKeyAuthenticatorTest.php b/tests/Integration/Security/Authenticator/ApiKeyAuthenticatorTest.php index 06001b702..ae0bfcbbe 100644 --- a/tests/Integration/Security/Authenticator/ApiKeyAuthenticatorTest.php +++ b/tests/Integration/Security/Authenticator/ApiKeyAuthenticatorTest.php @@ -72,7 +72,7 @@ public function testThatAuthenticateMethodCallsExpectedServiceMethodAndReturnsEx 'Authorization' => 'ApiKey SomeToken', ]); - $passport = (new ApiKeyAuthenticator($apiKeyUserProvider))->authenticate($request); + $passport = new ApiKeyAuthenticator($apiKeyUserProvider)->authenticate($request); self::assertTrue($passport->hasBadge(UserBadge::class)); @@ -92,7 +92,7 @@ public function testThatAuthenticateMethodThrowsAnExceptionWhenTokenNotFound(): ->disableOriginalConstructor() ->getMock(); - (new ApiKeyAuthenticator($apiKeyUserProvider))->authenticate(new Request()); + new ApiKeyAuthenticator($apiKeyUserProvider)->authenticate(new Request()); } /** diff --git a/tests/Integration/Security/Handler/TranslatedAuthenticationFailureHandlerTest.php b/tests/Integration/Security/Handler/TranslatedAuthenticationFailureHandlerTest.php index 9de87b79b..701d76cff 100644 --- a/tests/Integration/Security/Handler/TranslatedAuthenticationFailureHandlerTest.php +++ b/tests/Integration/Security/Handler/TranslatedAuthenticationFailureHandlerTest.php @@ -45,7 +45,7 @@ public function testThatOnAuthenticationFailureMethodCallsExpectedServiceMethods $request = new Request(); $exception = new AuthenticationException('Invalid credentials.'); - (new TranslatedAuthenticationFailureHandler($dispatcher, $translator)) + new TranslatedAuthenticationFailureHandler($dispatcher, $translator) ->onAuthenticationFailure($request, $exception); } } diff --git a/tests/Integration/Security/Provider/ApiKeyUserProviderTest.php b/tests/Integration/Security/Provider/ApiKeyUserProviderTest.php index 8c6a3161b..865269478 100644 --- a/tests/Integration/Security/Provider/ApiKeyUserProviderTest.php +++ b/tests/Integration/Security/Provider/ApiKeyUserProviderTest.php @@ -70,7 +70,7 @@ public function testThatRefreshUserThrowsAnException(): void $user = new InMemoryUser('username', 'password'); - (new ApiKeyUserProvider($apiKeyRepositoryMock, $rolesServiceMock)) + new ApiKeyUserProvider($apiKeyRepositoryMock, $rolesServiceMock) ->refreshUser($user); } @@ -99,7 +99,7 @@ public function testThatLoadUserByIdentifierThrowsAnException(): void $this->expectException(UserNotFoundException::class); $this->expectExceptionMessage('API key is not valid'); - (new ApiKeyUserProvider($apiKeyRepositoryMock, $rolesServiceMock)) + new ApiKeyUserProvider($apiKeyRepositoryMock, $rolesServiceMock) ->loadUserByIdentifier('guid'); } @@ -127,7 +127,7 @@ public function testThatLoadUserByIdentifierCreatesExpectedApiKeyUser(): void ]) ->willReturn($apiKey); - $user = (new ApiKeyUserProvider($apiKeyRepositoryMock, $rolesServiceMock)) + $user = new ApiKeyUserProvider($apiKeyRepositoryMock, $rolesServiceMock) ->loadUserByIdentifier('guid'); self::assertSame($apiKey->getId(), $user->getApiKeyIdentifier()); @@ -155,7 +155,7 @@ public function testThatGetApiKeyForTokenCallsExpectedRepositoryMethod(): void ]) ->willReturn(null); - (new ApiKeyUserProvider($apiKeyRepositoryMock, $rolesServiceMock)) + new ApiKeyUserProvider($apiKeyRepositoryMock, $rolesServiceMock) ->getApiKeyForToken('some_token'); } diff --git a/tests/Integration/Security/Provider/SecurityUserFactoryTest.php b/tests/Integration/Security/Provider/SecurityUserFactoryTest.php index 87a9d6c5b..fb23638f1 100644 --- a/tests/Integration/Security/Provider/SecurityUserFactoryTest.php +++ b/tests/Integration/Security/Provider/SecurityUserFactoryTest.php @@ -55,7 +55,7 @@ public function testThatLoadUserByIdentifierThrowsAnExceptionIfUserNotFound(): v ->with('test_user') ->willReturn(null); - (new SecurityUserFactory($userRepositoryMock, $rolesServiceMock)) + new SecurityUserFactory($userRepositoryMock, $rolesServiceMock) ->loadUserByIdentifier('test_user'); } @@ -87,7 +87,7 @@ public function testThatLoadByUsernameReturnsExpectedSecurityUser(): void ->with($user->getRoles()) ->willReturn(['FOO', 'BAR']); - $securityUser = (new SecurityUserFactory($userRepositoryMock, $rolesServiceMock)) + $securityUser = new SecurityUserFactory($userRepositoryMock, $rolesServiceMock) ->loadUserByIdentifier('test_user'); self::assertSame($user->getId(), $securityUser->getUserIdentifier()); @@ -107,7 +107,7 @@ public function testThatSupportsMethodsReturnsFalseWithNotSupportedType(bool | i ->getMock(); self::assertFalse( - (new SecurityUserFactory($userRepositoryMock, $rolesServiceMock)) + new SecurityUserFactory($userRepositoryMock, $rolesServiceMock) ->supportsClass((string)$input) ); } @@ -127,7 +127,7 @@ public function testThatSupportsMethodsReturnsTrueWithSupportedType(): void ->getMock(); self::assertTrue( - (new SecurityUserFactory($userRepositoryMock, $rolesServiceMock)) + new SecurityUserFactory($userRepositoryMock, $rolesServiceMock) ->supportsClass(SecurityUser::class) ); } @@ -149,7 +149,7 @@ public function testThatRefreshUserThrowsAnExceptionWithNotSupportedUser(): void $this->expectException(UnsupportedUserException::class); $this->expectExceptionMessageMatches('#^Invalid user class(.*)#'); - (new SecurityUserFactory($userRepositoryMock, $rolesServiceMock)) + new SecurityUserFactory($userRepositoryMock, $rolesServiceMock) ->refreshUser(new InMemoryUser('username', 'password')); } @@ -175,7 +175,7 @@ public function testThatRefreshUserThrowsAnExceptionIfUserNotFound(): void ->method('find') ->willReturn(null); - (new SecurityUserFactory($userRepositoryMock, $rolesServiceMock)) + new SecurityUserFactory($userRepositoryMock, $rolesServiceMock) ->refreshUser(new SecurityUser(new User())); } @@ -208,7 +208,7 @@ public function testThatRefreshUserReturnsNewInstanceOfSecurityUser(): void ->with($user->getRoles()) ->willReturn(['FOO', 'BAR']); - $newSecurityUser = (new SecurityUserFactory($userRepositoryMock, $rolesServiceMock)) + $newSecurityUser = new SecurityUserFactory($userRepositoryMock, $rolesServiceMock) ->refreshUser($securityUser); self::assertNotSame($securityUser, $newSecurityUser); diff --git a/tests/Integration/Security/RolesServiceTest.php b/tests/Integration/Security/RolesServiceTest.php index fa176e2e3..e035099ec 100644 --- a/tests/Integration/Security/RolesServiceTest.php +++ b/tests/Integration/Security/RolesServiceTest.php @@ -34,7 +34,7 @@ public function testThatGetInheritedRolesMethodCallsExpectedServiceMethod(): voi ->with(['RoleA', 'RoleB']) ->willReturn(['RoleA', 'RoleB', 'RoleC']); - (new RolesService($roleHierarchy))->getInheritedRoles(['RoleA', 'RoleB']); + new RolesService($roleHierarchy)->getInheritedRoles(['RoleA', 'RoleB']); } #[TestDox('Test that `RolesServiceInterface::getRoles` method returns expected')] diff --git a/tests/Integration/Security/UserTypeIdentificationTest.php b/tests/Integration/Security/UserTypeIdentificationTest.php index 5d196c746..2cefa7529 100644 --- a/tests/Integration/Security/UserTypeIdentificationTest.php +++ b/tests/Integration/Security/UserTypeIdentificationTest.php @@ -51,7 +51,7 @@ public function testThatGetApiKeyReturnsNullWhenTokenIsNotValid(?TokenInterface ->willReturn($token); self::assertNull( - (new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock))->getApiKey(), + new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock)->getApiKey(), ); } @@ -82,7 +82,7 @@ public function testThatGetApiKeyReturnsExpectedApiKey(): void self::assertSame( $apiKey, - (new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock))->getApiKey(), + new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock)->getApiKey(), ); } @@ -103,7 +103,7 @@ public function testThatGetUserReturnsNullWhenTokenIsNotValid(?TokenInterface $t ->willReturn($token); self::assertNull( - (new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock))->getUser(), + new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock)->getUser(), ); } @@ -117,7 +117,7 @@ public function testThatGetUserReturnsExpectedUser(): void $userRepositoryMock = $this->createMock(UserRepository::class); $apiKeyUserProviderMock = $this->createMock(ApiKeyUserProvider::class); - $user = (new User())->setUsername('some-username'); + $user = new User()->setUsername('some-username'); $securityUser = new SecurityUser($user); $token = new UsernamePasswordToken($securityUser, 'firewallName', ['role']); @@ -134,7 +134,7 @@ public function testThatGetUserReturnsExpectedUser(): void self::assertSame( $user, - (new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock))->getUser(), + new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock)->getUser(), ); } @@ -155,11 +155,11 @@ public function testThatGetIdentityReturnsNullWhenTokenIsNotValid(?TokenInterfac ->willReturn($token); self::assertNull( - (new UserTypeIdentification( + new UserTypeIdentification( $tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock - ))->getIdentity(), + )->getIdentity(), ); } @@ -183,7 +183,7 @@ public function testThatGetIdentityReturnsExpectedSecurityUser(): void self::assertSame( $securityUser, - (new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock))->getIdentity() + new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock)->getIdentity() ); } @@ -207,7 +207,7 @@ public function testThatGetIdentityReturnsExpectedApiKeyUser(): void self::assertSame( $apiKeyUser, - (new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock))->getIdentity() + new UserTypeIdentification($tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock)->getIdentity() ); } @@ -228,11 +228,11 @@ public function testThatGetApiKeyUserReturnsNullWhenTokenIsNotValid(?TokenInterf ->willReturn($token); self::assertNull( - (new UserTypeIdentification( + new UserTypeIdentification( $tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock - ))->getApiKeyUser(), + )->getApiKeyUser(), ); } @@ -256,11 +256,11 @@ public function testThatGetApiKeyUserReturnsExpectedUser(): void self::assertSame( $apiKeyUser, - (new UserTypeIdentification( + new UserTypeIdentification( $tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock - ))->getApiKeyUser(), + )->getApiKeyUser(), ); } @@ -281,11 +281,11 @@ public function testThatGetSecurityUserReturnsNullWhenTokenIsNotValid(?TokenInte ->willReturn($token); self::assertNull( - (new UserTypeIdentification( + new UserTypeIdentification( $tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock, - ))->getSecurityUser(), + )->getSecurityUser(), ); } @@ -309,11 +309,11 @@ public function testThatGetSecurityUserReturnsExpectedUser(): void self::assertSame( $securityUser, - (new UserTypeIdentification( + new UserTypeIdentification( $tokenStorageMock, $userRepositoryMock, $apiKeyUserProviderMock, - ))->getSecurityUser(), + )->getSecurityUser(), ); } diff --git a/tests/Integration/Service/LocalizationTest.php b/tests/Integration/Service/LocalizationTest.php index 0063ac140..ec753d34d 100644 --- a/tests/Integration/Service/LocalizationTest.php +++ b/tests/Integration/Service/LocalizationTest.php @@ -38,7 +38,7 @@ public function testThatGetLanguagesReturnsExpected(): void self::assertSame( $expected, - (new Localization($cache, $logger, $requestStack))->getLanguages(), + new Localization($cache, $logger, $requestStack)->getLanguages(), ); } @@ -53,7 +53,7 @@ public function testThatGetLocalesReturnsExpected(): void self::assertSame( $expected, - (new Localization($cache, $logger, $requestStack))->getLocales(), + new Localization($cache, $logger, $requestStack)->getLocales(), ); } @@ -76,7 +76,7 @@ public function testThatLoggerIsCalledWhenCacheThrowsAnException(): void ->method('error') ->with($exception->getMessage(), $exception->getTrace()); - (new Localization($cache, $logger, $requestStack)) + new Localization($cache, $logger, $requestStack) ->getTimezones(); } @@ -87,7 +87,7 @@ public function testThatGetFormattedTimezonesMethodReturnsExpectedAmountOfResult $logger = $this->getMockBuilder(LoggerInterface::class)->getMock(); $requestStack = new RequestStack(); - $output = (new Localization($cache, $logger, $requestStack)) + $output = new Localization($cache, $logger, $requestStack) ->getFormattedTimezones(); self::assertCount(count(DateTimeZone::listIdentifiers()), $output); @@ -110,7 +110,7 @@ public function testThatGetRequestLocaleReturnsDefaultLocaleIfThereIsNoCurrentRe self::assertSame( Locale::getDefault()->value, - (new Localization($cache, $logger, $requestStack))->getRequestLocale(), + new Localization($cache, $logger, $requestStack)->getRequestLocale(), ); } @@ -128,7 +128,7 @@ public function testThatGetRequestLocaleReturnsDefaultLocaleWhenThereIsRequest() self::assertSame( 'en', - (new Localization($cache, $logger, $requestStack))->getRequestLocale(), + new Localization($cache, $logger, $requestStack)->getRequestLocale(), ); } } diff --git a/tests/Integration/Service/VersionTest.php b/tests/Integration/Service/VersionTest.php index a5bb3f513..16d28eca2 100644 --- a/tests/Integration/Service/VersionTest.php +++ b/tests/Integration/Service/VersionTest.php @@ -40,7 +40,7 @@ public function testThatLoggerIsCalledWhenCacheThrowsAnException(): void ->method('error') ->with($exception->getMessage(), $exception->getTrace()); - (new Version('', $cache, $logger)) + new Version('', $cache, $logger) ->get(); } diff --git a/tests/Integration/TestCase/RestIntegrationControllerTestCase.php b/tests/Integration/TestCase/RestIntegrationControllerTestCase.php index c97fc88c9..7cfc7ee0c 100644 --- a/tests/Integration/TestCase/RestIntegrationControllerTestCase.php +++ b/tests/Integration/TestCase/RestIntegrationControllerTestCase.php @@ -49,7 +49,7 @@ protected function setUp(): void public function testThatGivenControllerIsCorrect(): void { - $expected = mb_substr((new ReflectionClass($this))->getShortName(), 0, -4); + $expected = mb_substr(new ReflectionClass($this)->getShortName(), 0, -4); $message = sprintf( 'Your REST controller integration test \'%s\' uses likely wrong controller class \'%s\'', @@ -57,7 +57,7 @@ public function testThatGivenControllerIsCorrect(): void $this->controllerClass ); - self::assertSame($expected, (new ReflectionClass($this->getController()))->getShortName(), $message); + self::assertSame($expected, new ReflectionClass($this->getController())->getShortName(), $message); } /** diff --git a/tests/Integration/Utils/HealthzServiceTest.php b/tests/Integration/Utils/HealthzServiceTest.php index 4d43c0c64..fba35ac85 100644 --- a/tests/Integration/Utils/HealthzServiceTest.php +++ b/tests/Integration/Utils/HealthzServiceTest.php @@ -41,7 +41,7 @@ public function testThatCheckMethodCallsExpectedRepositoryMethods(): void ->expects($this->once()) ->method('read'); - (new HealthzService($repository)) + new HealthzService($repository) ->check(); } diff --git a/tests/Integration/Utils/LoginLoggerTest.php b/tests/Integration/Utils/LoginLoggerTest.php index 166747243..302cd5347 100644 --- a/tests/Integration/Utils/LoginLoggerTest.php +++ b/tests/Integration/Utils/LoginLoggerTest.php @@ -34,7 +34,7 @@ public function testThatExceptionIsThrownIfRequestIsNotAvailable(): void $this->expectException(BadMethodCallException::class); $this->expectExceptionMessage('Could not get request from current request stack'); - (new LoginLogger($this->getResource(), new RequestStack())) + new LoginLogger($this->getResource(), new RequestStack()) ->process(LogLogin::SUCCESS); } @@ -53,7 +53,7 @@ public function testThatCreateEntryCallsResourceSaveMethod(): void $requestStack = new RequestStack(); $requestStack->push(new Request()); - (new LoginLogger($resource, $requestStack)) + new LoginLogger($resource, $requestStack) ->process(LogLogin::SUCCESS); } diff --git a/tests/Integration/Utils/RequestLoggerTest.php b/tests/Integration/Utils/RequestLoggerTest.php index e0a57b387..0c192301d 100644 --- a/tests/Integration/Utils/RequestLoggerTest.php +++ b/tests/Integration/Utils/RequestLoggerTest.php @@ -40,7 +40,7 @@ public function testThatLogIsNotCreatedIfRequestAndResponseObjectsAreNotSet(): v ->expects(self::never()) ->method('save'); - (new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, [])) + new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, []) ->handle(); } @@ -56,7 +56,7 @@ public function testThatLogIsNotCreatedIfRequestObjectIsNotSet(): void ->expects(self::never()) ->method('save'); - (new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, [])) + new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, []) ->setResponse(new Response()) ->handle(); } @@ -73,7 +73,7 @@ public function testThatLogIsNotCreatedIfResponseObjectIsNotSet(): void ->expects(self::never()) ->method('save'); - (new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, [])) + new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, []) ->setRequest(new Request()) ->handle(); } @@ -91,7 +91,7 @@ public function testThatResourceSaveMethodIsCalled(): void ->method('save') ->with(); - (new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, [])) + new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, []) ->setRequest(new Request()) ->setResponse(new Response()) ->handle(); @@ -115,7 +115,7 @@ public function testThatLoggerIsCalledIfExceptionIsThrown(): void ->method('error') ->with('test exception'); - (new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, [])) + new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, []) ->setRequest(new Request()) ->setResponse(new Response()) ->handle(); @@ -145,7 +145,7 @@ public function testThatUserResourceMethodIsCalledWhenUserIdIsSet(): void ->method('save') ->with(); - (new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, [])) + new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, []) ->setRequest(new Request()) ->setResponse(new Response()) ->setUserId($user->getId()) @@ -176,7 +176,7 @@ public function testThatApiKeyResourceMethodIsCalledWhenUserIdIsSet(): void ->method('save') ->with(); - (new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, [])) + new RequestLogger($logRequestResource, $userResource, $apiKeyResource, $logger, []) ->setRequest(new Request()) ->setResponse(new Response()) ->setApiKeyId($user->getId()) diff --git a/tests/Integration/Validator/Constraints/EntityReferenceExistsValidatorTest.php b/tests/Integration/Validator/Constraints/EntityReferenceExistsValidatorTest.php index c095ce653..a70c668db 100644 --- a/tests/Integration/Validator/Constraints/EntityReferenceExistsValidatorTest.php +++ b/tests/Integration/Validator/Constraints/EntityReferenceExistsValidatorTest.php @@ -46,7 +46,7 @@ public function testThatValidateMethodThrowsUnexpectedTypeException(): void $constraint = new TestConstraint(); - (new EntityReferenceExistsValidator($loggerMock))->validate('', $constraint); + new EntityReferenceExistsValidator($loggerMock)->validate('', $constraint); } /** @@ -67,7 +67,7 @@ public function testThatValidateMethodThrowsUnexpectedValueException( $constraint = new EntityReferenceExists(); $constraint->entityClass = $entityClass; - (new EntityReferenceExistsValidator($loggerMock))->validate($value, $constraint); + new EntityReferenceExistsValidator($loggerMock)->validate($value, $constraint); } #[TestDox('Test that `validate` method throws an exception if value is `stdClass`')] @@ -83,7 +83,7 @@ public function testThatValidateMethodThrowsUnexpectedValueExceptionWhenValueIsN $constraint = new EntityReferenceExists(); $constraint->entityClass = stdClass::class; - (new EntityReferenceExistsValidator($loggerMock))->validate(new stdClass(), $constraint); + new EntityReferenceExistsValidator($loggerMock)->validate(new stdClass(), $constraint); } /** diff --git a/tests/Integration/Validator/Constraints/UniqueEmailValidatorTest.php b/tests/Integration/Validator/Constraints/UniqueEmailValidatorTest.php index f5a5592a0..1e146cf5a 100644 --- a/tests/Integration/Validator/Constraints/UniqueEmailValidatorTest.php +++ b/tests/Integration/Validator/Constraints/UniqueEmailValidatorTest.php @@ -35,7 +35,7 @@ public function testThatValidateCallsExpectedMethods(): void $builderMock = $this->getMockBuilder(ConstraintViolationBuilderInterface::class)->getMock(); // Create new user - $user = (new User()) + $user = new User() ->setEmail('john.doe@test.com'); $repositoryMock diff --git a/tests/Integration/Validator/Constraints/UniqueUsernameValidatorTest.php b/tests/Integration/Validator/Constraints/UniqueUsernameValidatorTest.php index 208118908..11e067557 100644 --- a/tests/Integration/Validator/Constraints/UniqueUsernameValidatorTest.php +++ b/tests/Integration/Validator/Constraints/UniqueUsernameValidatorTest.php @@ -35,7 +35,7 @@ public function testThatValidateCallsExpectedMethods(): void $builderMock = $this->getMockBuilder(ConstraintViolationBuilderInterface::class)->getMock(); // Create new user - $user = (new User()) + $user = new User() ->setUsername('john'); $repositoryMock diff --git a/tests/Integration/ValueResolver/RestDtoValueResolverTest.php b/tests/Integration/ValueResolver/RestDtoValueResolverTest.php index 2490000e4..b01186591 100644 --- a/tests/Integration/ValueResolver/RestDtoValueResolverTest.php +++ b/tests/Integration/ValueResolver/RestDtoValueResolverTest.php @@ -103,7 +103,7 @@ public function testThatResolveMethodWorksAsExpected(): void public static function dataProviderTestThatSupportMethodWorksAsExpected(): Generator { /** @psalm-suppress InternalMethod */ - $controllerCollection = (new MockBuilder(new self(self::class), ControllerCollection::class)) + $controllerCollection = new MockBuilder(new self(self::class), ControllerCollection::class) ->disableOriginalConstructor() ->getMock(); @@ -130,7 +130,7 @@ public static function dataProviderTestThatSupportMethodWorksAsExpected(): Gener ]; /** @psalm-suppress InternalMethod */ - $controllerCollection = (new MockBuilder(new self(self::class), ControllerCollection::class)) + $controllerCollection = new MockBuilder(new self(self::class), ControllerCollection::class) ->disableOriginalConstructor() ->getMock(); @@ -149,7 +149,7 @@ public static function dataProviderTestThatSupportMethodWorksAsExpected(): Gener ]; /** @psalm-suppress InternalMethod */ - $controllerCollection = (new MockBuilder(new self(self::class), ControllerCollection::class)) + $controllerCollection = new MockBuilder(new self(self::class), ControllerCollection::class) ->disableOriginalConstructor() ->getMock(); @@ -168,7 +168,7 @@ public static function dataProviderTestThatSupportMethodWorksAsExpected(): Gener ]; /** @psalm-suppress InternalMethod */ - $controllerCollection = (new MockBuilder(new self(self::class), ControllerCollection::class)) + $controllerCollection = new MockBuilder(new self(self::class), ControllerCollection::class) ->disableOriginalConstructor() ->getMock(); diff --git a/tests/Unit/Entity/ApiKeyTest.php b/tests/Unit/Entity/ApiKeyTest.php index a4bc429f7..808c73423 100644 --- a/tests/Unit/Entity/ApiKeyTest.php +++ b/tests/Unit/Entity/ApiKeyTest.php @@ -23,12 +23,12 @@ class ApiKeyTest extends KernelTestCase #[TestDox('Test that token is generated on creation of ApiKey entity')] public function testThatTokenIsGenerated(): void { - self::assertSame(40, strlen((new ApiKey())->getToken())); + self::assertSame(40, strlen(new ApiKey()->getToken())); } #[TestDox('Test that ApiKey entity has `ROLE_API` role')] public function testThatGetRolesContainsExpectedRole(): void { - self::assertContainsEquals(Role::API->value, (new ApiKey())->getRoles()); + self::assertContainsEquals(Role::API->value, new ApiKey()->getRoles()); } } diff --git a/tests/Unit/Entity/DateDimensionTest.php b/tests/Unit/Entity/DateDimensionTest.php index a69106a60..645d3d6e1 100644 --- a/tests/Unit/Entity/DateDimensionTest.php +++ b/tests/Unit/Entity/DateDimensionTest.php @@ -28,7 +28,7 @@ class DateDimensionTest extends KernelTestCase public function testThatConstructorCallsExpectedMethods(): void { $dateTime = DateTimeImmutable::createFromMutable( - (new DateTime('now', new DateTimeZone('UTC')))->setTime(10, 10, 10) + new DateTime('now', new DateTimeZone('UTC'))->setTime(10, 10, 10) ); $entity = new DateDimension($dateTime); diff --git a/tests/Unit/Entity/LogLoginTest.php b/tests/Unit/Entity/LogLoginTest.php index a232a1731..42683ffc0 100644 --- a/tests/Unit/Entity/LogLoginTest.php +++ b/tests/Unit/Entity/LogLoginTest.php @@ -42,7 +42,7 @@ public function testThatGetCreatedAtReturnsExpected( self::assertNotNull($createdAt); self::assertEqualsWithDelta( - (new DateTime('now', new DateTimeZone('utc')))->getTimestamp(), + new DateTime('now', new DateTimeZone('utc'))->getTimestamp(), $createdAt->getTimestamp(), 1 ); diff --git a/tests/Unit/Entity/LogRequestTest.php b/tests/Unit/Entity/LogRequestTest.php index 1cd05e7f5..4775ed9e3 100644 --- a/tests/Unit/Entity/LogRequestTest.php +++ b/tests/Unit/Entity/LogRequestTest.php @@ -33,7 +33,7 @@ public function testThatGetCreatedAtReturnsExpected(): void self::assertNotNull($createdAt); self::assertEqualsWithDelta( - (new DateTimeImmutable('now', new DateTimeZone('utc')))->getTimestamp(), + new DateTimeImmutable('now', new DateTimeZone('utc'))->getTimestamp(), $createdAt->getTimestamp(), 1, ); diff --git a/tests/Unit/Entity/RoleTest.php b/tests/Unit/Entity/RoleTest.php index c3045c485..ad1576b60 100644 --- a/tests/Unit/Entity/RoleTest.php +++ b/tests/Unit/Entity/RoleTest.php @@ -22,7 +22,7 @@ class RoleTest extends KernelTestCase #[TestDox('Test that `Role::getUserGroups` returns expected')] public function testThatGetUserGroupsWorksLikeExpected(): void { - $userGroup = (new UserGroup()) + $userGroup = new UserGroup() ->setName('some name'); $role = new Role('some role'); diff --git a/tests/Unit/Security/ApiKeyUserTest.php b/tests/Unit/Security/ApiKeyUserTest.php index 8e8b1e7c0..4a93d1844 100644 --- a/tests/Unit/Security/ApiKeyUserTest.php +++ b/tests/Unit/Security/ApiKeyUserTest.php @@ -58,15 +58,15 @@ public static function dataProviderTestThatGetRolesReturnsExpected(): Generator $userGroupResource = static::getContainer()->get(UserGroupResource::class); yield [ - (new ApiKey())->addUserGroup((new UserGroup())->setRole(new Role('ROLE_LOGGED'))), + new ApiKey()->addUserGroup(new UserGroup()->setRole(new Role('ROLE_LOGGED'))), new StringableArrayObject(['ROLE_LOGGED', 'ROLE_API']), ]; $exception = new Exception('Cannot find user group'); yield [ - (new ApiKey()) - ->addUserGroup((new UserGroup())->setRole(new Role('ROLE_LOGGED'))) + new ApiKey() + ->addUserGroup(new UserGroup()->setRole(new Role('ROLE_LOGGED'))) ->addUserGroup($userGroupResource->findOneBy([ 'name' => 'Normal users', ]) ?? throw $exception), @@ -74,8 +74,8 @@ public static function dataProviderTestThatGetRolesReturnsExpected(): Generator ]; yield [ - (new ApiKey()) - ->addUserGroup((new UserGroup())->setRole(new Role('ROLE_LOGGED'))) + new ApiKey() + ->addUserGroup(new UserGroup()->setRole(new Role('ROLE_LOGGED'))) ->addUserGroup($userGroupResource->findOneBy([ 'name' => 'Admin users', ]) ?? throw $exception), @@ -83,8 +83,8 @@ public static function dataProviderTestThatGetRolesReturnsExpected(): Generator ]; yield [ - (new ApiKey()) - ->addUserGroup((new UserGroup())->setRole(new Role('ROLE_LOGGED'))) + new ApiKey() + ->addUserGroup(new UserGroup()->setRole(new Role('ROLE_LOGGED'))) ->addUserGroup($userGroupResource->findOneBy([ 'name' => 'Root users', ]) ?? throw $exception), diff --git a/tests/Unit/Security/SecurityUserTest.php b/tests/Unit/Security/SecurityUserTest.php index 7cf2240c5..7035f7f69 100644 --- a/tests/Unit/Security/SecurityUserTest.php +++ b/tests/Unit/Security/SecurityUserTest.php @@ -33,7 +33,7 @@ public function testThatGetPasswordReturnsExpected(): void { $encoder = fn (string $password): string => str_rot13($password); - $securityUser = new SecurityUser((new User())->setPassword($encoder, 'foobar')); + $securityUser = new SecurityUser(new User()->setPassword($encoder, 'foobar')); self::assertSame('sbbone', $securityUser->getPassword()); } @@ -41,7 +41,7 @@ public function testThatGetPasswordReturnsExpected(): void #[TestDox('Test that `SecurityUser::getSalt` method returns null')] public function testThatGetSaltReturnNothing(): void { - self::assertNull((new SecurityUser(new User()))->getSalt()); + self::assertNull(new SecurityUser(new User())->getSalt()); } #[TestDox('Test that `SecurityUser::getUsername` method returns expected UUID')] @@ -49,7 +49,7 @@ public function testThatGetUsernameReturnsExpected(): void { $user = new User(); - self::assertSame($user->getId(), (new SecurityUser($user))->getUserIdentifier()); + self::assertSame($user->getId(), new SecurityUser($user)->getUserIdentifier()); } #[TestDox('Test that `SecurityUser::getUuid` method returns expected UUID')] @@ -57,7 +57,7 @@ public function testThatGetUuidReturnsExpected(): void { $user = new User(); - self::assertSame($user->getId(), (new SecurityUser($user))->getUuid()); + self::assertSame($user->getId(), new SecurityUser($user)->getUuid()); } #[TestDox('Test that password is present after `SecurityUser::eraseCredentials` method call')] @@ -65,7 +65,7 @@ public function testThatPasswordIsPresentAfterEraseCredential(): void { $encoder = fn (string $password): string => str_rot13($password); - $securityUser = new SecurityUser((new User())->setPassword($encoder, 'foobar')); + $securityUser = new SecurityUser(new User()->setPassword($encoder, 'foobar')); $securityUser->eraseCredentials(); diff --git a/tests/Unit/Validator/Constraints/EntityReferenceExistsTest.php b/tests/Unit/Validator/Constraints/EntityReferenceExistsTest.php index 367168023..5f249a6c7 100644 --- a/tests/Unit/Validator/Constraints/EntityReferenceExistsTest.php +++ b/tests/Unit/Validator/Constraints/EntityReferenceExistsTest.php @@ -21,6 +21,6 @@ class EntityReferenceExistsTest extends KernelTestCase #[TestDox('Test that `getTargets` method returns expected')] public function testThatGetTargetsReturnsExpected(): void { - self::assertSame('property', (new EntityReferenceExists())->getTargets()); + self::assertSame('property', new EntityReferenceExists()->getTargets()); } } diff --git a/tests/Unit/Validator/Constraints/LanguageTest.php b/tests/Unit/Validator/Constraints/LanguageTest.php index ac1f8e43c..2be80967e 100644 --- a/tests/Unit/Validator/Constraints/LanguageTest.php +++ b/tests/Unit/Validator/Constraints/LanguageTest.php @@ -21,6 +21,6 @@ class LanguageTest extends KernelTestCase #[TestDox('Test that `getTargets` method returns expected')] public function testThatGetTargetsReturnsExpected(): void { - self::assertSame('property', (new Language())->getTargets()); + self::assertSame('property', new Language()->getTargets()); } } diff --git a/tests/Unit/Validator/Constraints/LocaleTest.php b/tests/Unit/Validator/Constraints/LocaleTest.php index 5f190c5a4..b60f04655 100644 --- a/tests/Unit/Validator/Constraints/LocaleTest.php +++ b/tests/Unit/Validator/Constraints/LocaleTest.php @@ -21,6 +21,6 @@ class LocaleTest extends KernelTestCase #[TestDox('Test that `getTargets` method returns expected')] public function testThatGetTargetsReturnsExpected(): void { - self::assertSame('property', (new Locale())->getTargets()); + self::assertSame('property', new Locale()->getTargets()); } } diff --git a/tests/Unit/Validator/Constraints/TimezoneTest.php b/tests/Unit/Validator/Constraints/TimezoneTest.php index 5a7bab632..f65a78eae 100644 --- a/tests/Unit/Validator/Constraints/TimezoneTest.php +++ b/tests/Unit/Validator/Constraints/TimezoneTest.php @@ -21,6 +21,6 @@ class TimezoneTest extends KernelTestCase #[TestDox('Test that `getTargets` method returns expected')] public function testThatGetTargetsReturnsExpected(): void { - self::assertSame('property', (new Timezone())->getTargets()); + self::assertSame('property', new Timezone()->getTargets()); } } diff --git a/tests/Unit/Validator/Constraints/UniqueEmailTest.php b/tests/Unit/Validator/Constraints/UniqueEmailTest.php index 0d546962d..862a9985a 100644 --- a/tests/Unit/Validator/Constraints/UniqueEmailTest.php +++ b/tests/Unit/Validator/Constraints/UniqueEmailTest.php @@ -21,6 +21,6 @@ class UniqueEmailTest extends KernelTestCase #[TestDox('Test that `getTargets` method returns expected')] public function testThatGetTargetsReturnsExpected(): void { - self::assertSame('class', (new UniqueEmail())->getTargets()); + self::assertSame('class', new UniqueEmail()->getTargets()); } } diff --git a/tests/Unit/Validator/Constraints/UniqueUsernameTest.php b/tests/Unit/Validator/Constraints/UniqueUsernameTest.php index 5f2a4e91d..2c2a9b881 100644 --- a/tests/Unit/Validator/Constraints/UniqueUsernameTest.php +++ b/tests/Unit/Validator/Constraints/UniqueUsernameTest.php @@ -21,6 +21,6 @@ class UniqueUsernameTest extends KernelTestCase #[TestDox('Test that `getTargets` method returns expected')] public function testThatGetTargetsReturnsExpected(): void { - self::assertSame('class', (new UniqueUsername())->getTargets()); + self::assertSame('class', new UniqueUsername()->getTargets()); } } diff --git a/tests/Utils/PhpUnitUtil.php b/tests/Utils/PhpUnitUtil.php index 9ed0998fc..1e3dfa43f 100644 --- a/tests/Utils/PhpUnitUtil.php +++ b/tests/Utils/PhpUnitUtil.php @@ -274,7 +274,7 @@ private static function getValidValue( $type = self::TYPE_CUSTOM_CLASS; - if ((new ReflectionClass($class))->isEnum()) { + if (new ReflectionClass($class)->isEnum()) { $type = self::TYPE_ENUM; } else { /** @var class-string $class */ diff --git a/tests/bootstrap.php b/tests/bootstrap.php index a81a4c305..e491280b4 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -45,7 +45,7 @@ * * @var array $variables */ - $variables = (new Dotenv())->parse((string)file_get_contents(dirname(__DIR__) . '/.env.test')); + $variables = new Dotenv()->parse((string)file_get_contents(dirname(__DIR__) . '/.env.test')); /** @var array $configuration */ $configuration = JSON::decode((string)file_get_contents($variables['APPLICATION_CONFIG']), true); @@ -95,7 +95,7 @@ } // load all the .env files - (new Dotenv())->loadEnv(dirname(__DIR__) . '/.env'); + new Dotenv()->loadEnv(dirname(__DIR__) . '/.env'); /** @noinspection AdditionOperationOnArraysInspection */ $_SERVER += $_ENV; @@ -211,7 +211,7 @@ // Create database cache file $createDatabaseCreateCache = static function () use ($databaseCacheFile): void { // Create database cache file - file_put_contents($databaseCacheFile, '{"init": ' . (new DateTime())->format(DATE_RFC3339) . '}'); + file_put_contents($databaseCacheFile, '{"init": ' . new DateTime()->format(DATE_RFC3339) . '}'); }; // And finally call each of initialize functions to make test environment ready diff --git a/tools/08_phpmetrics/composer.json b/tools/08_phpmetrics/composer.json index 9ae6f4cfe..a338b665f 100644 --- a/tools/08_phpmetrics/composer.json +++ b/tools/08_phpmetrics/composer.json @@ -6,7 +6,7 @@ "php": "^8.4.0" }, "require-dev": { - "phpmetrics/phpmetrics": "2.8.2", + "phpmetrics/phpmetrics": "3.0.0rc8", "roave/security-advisories": "dev-latest" }, "config": { diff --git a/tools/08_phpmetrics/composer.lock b/tools/08_phpmetrics/composer.lock index 87ea8e0e8..bead8afc3 100644 --- a/tools/08_phpmetrics/composer.lock +++ b/tools/08_phpmetrics/composer.lock @@ -4,30 +4,32 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "191a7730ba3684231822419156d7119c", + "content-hash": "c468ecde1b5b4d972ccbb3401f53b7a6", "packages": [], "packages-dev": [ { "name": "nikic/php-parser", - "version": "v4.19.4", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", - "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { + "ext-ctype": "*", + "ext-json": "*", "ext-tokenizer": "*", - "php": ">=7.1" + "php": ">=7.4" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^9.0" }, "bin": [ "bin/php-parse" @@ -35,7 +37,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.9-dev" + "dev-master": "5.0-dev" } }, "autoload": { @@ -59,50 +61,102 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-09-29T15:01:53+00:00" + "time": "2024-12-30T11:07:19+00:00" + }, + { + "name": "openmetrics-php/exposition-text", + "version": "v0.4.1", + "source": { + "type": "git", + "url": "https://github.com/openmetrics-php/exposition-text.git", + "reference": "fcfca38f693e168f4520bbd359d91528bbb9a8e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/openmetrics-php/exposition-text/zipball/fcfca38f693e168f4520bbd359d91528bbb9a8e8", + "reference": "fcfca38f693e168f4520bbd359d91528bbb9a8e8", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "ext-xdebug": "*" + }, + "type": "library", + "autoload": { + "psr-4": { + "OpenMetricsPhp\\Exposition\\Text\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Holger Woltersdorf", + "email": "hw@hollo.me" + } + ], + "description": "Implementation of the text exposition format of OpenMetrics", + "support": { + "issues": "https://github.com/openmetrics-php/exposition-text/issues", + "source": "https://github.com/openmetrics-php/exposition-text/tree/v0.4.1" + }, + "time": "2024-07-16T12:47:30+00:00" }, { "name": "phpmetrics/phpmetrics", - "version": "v2.8.2", + "version": "v3.0.0rc8", "source": { "type": "git", "url": "https://github.com/phpmetrics/PhpMetrics.git", - "reference": "4b77140a11452e63c7a9b98e0648320bf6710090" + "reference": "7111fe26c10092ed73c88fd325b43ddcd1b08558" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/4b77140a11452e63c7a9b98e0648320bf6710090", - "reference": "4b77140a11452e63c7a9b98e0648320bf6710090", + "url": "https://api.github.com/repos/phpmetrics/PhpMetrics/zipball/7111fe26c10092ed73c88fd325b43ddcd1b08558", + "reference": "7111fe26c10092ed73c88fd325b43ddcd1b08558", "shasum": "" }, "require": { - "ext-dom": "*", "ext-tokenizer": "*", - "nikic/php-parser": "^3|^4", - "php": ">=5.5" + "nikic/php-parser": "^5.4", + "openmetrics-php/exposition-text": "^0.4.1", + "php": ">=8.1" }, "replace": { "halleck45/php-metrics": "*", "halleck45/phpmetrics": "*" }, "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.7.27 || ^6.5.14", - "sebastian/comparator": ">=1.2.3", - "squizlabs/php_codesniffer": "^3.5", - "symfony/dom-crawler": "^3.0 || ^4.0 || ^5.0" + "phake/phake": "^4.5.3", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^10.5", + "roave/security-advisories": "dev-latest", + "sebastian/comparator": ">=5.0.0", + "squizlabs/php_codesniffer": "^3.11", + "symfony/dom-crawler": "^6.4", + "vimeo/psalm": "^6.3" + }, + "suggest": { + "ext-dom": "To allow XML parsing and report results.", + "ext-yaml": "To allow yaml parsing of configuration files." }, "bin": [ "bin/phpmetrics" ], "type": "library", "autoload": { - "files": [ - "./src/functions.php" - ], - "psr-0": { - "Hal\\": "./src/" + "psr-4": { + "Hal\\": "src/Hal" } }, "notification-url": "https://packagist.org/downloads/", @@ -127,9 +181,9 @@ ], "support": { "issues": "https://github.com/PhpMetrics/PhpMetrics/issues", - "source": "https://github.com/phpmetrics/PhpMetrics/tree/v2.8.2" + "source": "https://github.com/phpmetrics/PhpMetrics/tree/v3.0.0rc8" }, - "time": "2023-03-08T15:03:36+00:00" + "time": "2025-02-05T09:10:37+00:00" }, { "name": "roave/security-advisories", @@ -137,16 +191,17 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "975c081c7e430d0316a94047e5d8ab26e0a8f49e" + "reference": "6c54d20ae795b83ecf3f826311d7f488cd1ef005" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/975c081c7e430d0316a94047e5d8ab26e0a8f49e", - "reference": "975c081c7e430d0316a94047e5d8ab26e0a8f49e", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/6c54d20ae795b83ecf3f826311d7f488cd1ef005", + "reference": "6c54d20ae795b83ecf3f826311d7f488cd1ef005", "shasum": "" }, "conflict": { "3f/pygmentize": "<1.2", + "adaptcms/adaptcms": "<=1.3", "admidio/admidio": "<4.3.12", "adodb/adodb-php": "<=5.20.20|>=5.21,<=5.21.3", "aheinze/cockpit": "<2.2", @@ -171,8 +226,8 @@ "andrewhaine/silverstripe-form-capture": ">=0.2,<=0.2.3|>=1,<1.0.2|>=2,<2.2.5", "apache-solr-for-typo3/solr": "<2.8.3", "apereo/phpcas": "<1.6", - "api-platform/core": "<4.0.22", - "api-platform/graphql": "<4.0.22", + "api-platform/core": "<3.4.17|>=4.0.0.0-alpha1,<4.0.22", + "api-platform/graphql": "<3.4.17|>=4.0.0.0-alpha1,<4.0.22", "appwrite/server-ce": "<=1.2.1", "arc/web": "<3", "area17/twill": "<1.2.5|>=2,<2.5.3", @@ -188,6 +243,7 @@ "awesome-support/awesome-support": "<=6.0.7", "aws/aws-sdk-php": "<3.288.1", "azuracast/azuracast": "<0.18.3", + "b13/seo_basics": "<0.8.2", "backdrop/backdrop": "<1.27.3|>=1.28,<1.28.2", "backpack/crud": "<3.4.9", "backpack/filemanager": "<2.0.2|>=3,<3.0.9", @@ -203,6 +259,7 @@ "bbpress/bbpress": "<2.6.5", "bcosca/fatfree": "<3.7.2", "bedita/bedita": "<4", + "bednee/cooluri": "<1.0.30", "bigfork/silverstripe-form-capture": ">=3,<3.1.1", "billz/raspap-webgui": "<=3.1.4", "bk2k/bootstrap-package": ">=7.1,<7.1.2|>=8,<8.0.8|>=9,<9.0.4|>=9.1,<9.1.3|>=10,<10.0.10|>=11,<11.0.3", @@ -219,6 +276,7 @@ "brotkrueml/typo3-matomo-integration": "<1.3.2", "buddypress/buddypress": "<7.2.1", "bugsnag/bugsnag-laravel": ">=2,<2.0.2", + "bvbmedia/multishop": "<2.0.39", "bytefury/crater": "<6.0.2", "cachethq/cachet": "<2.5.1", "cakephp/cakephp": "<3.10.3|>=4,<4.0.10|>=4.1,<4.1.4|>=4.2,<4.2.12|>=4.3,<4.3.11|>=4.4,<4.4.10", @@ -237,6 +295,7 @@ "civicrm/civicrm-core": ">=4.2,<4.2.9|>=4.3,<4.3.3", "ckeditor/ckeditor": "<4.25", "clickstorm/cs-seo": ">=6,<6.7|>=7,<7.4|>=8,<8.3|>=9,<9.2", + "co-stack/fal_sftp": "<0.2.6", "cockpit-hq/cockpit": "<2.7|==2.7", "codeception/codeception": "<3.1.3|>=4,<4.1.22", "codeigniter/framework": "<3.1.9", @@ -244,6 +303,7 @@ "codeigniter4/shield": "<1.0.0.0-beta8", "codiad/codiad": "<=2.8.4", "codingms/additional-tca": ">=1.7,<1.15.17|>=1.16,<1.16.9", + "commerceteam/commerce": ">=0.9.6,<0.9.9", "components/jquery": ">=1.0.3,<3.5", "composer/composer": "<1.10.27|>=2,<2.2.24|>=2.3,<2.7.7", "concrete5/concrete5": "<9.4.0.0-RC2-dev", @@ -277,6 +337,9 @@ "devgroup/dotplant": "<2020.09.14-dev", "digimix/wp-svg-upload": "<=1", "directmailteam/direct-mail": "<6.0.3|>=7,<7.0.3|>=8,<9.5.2", + "dl/yag": "<3.0.1", + "dmk/webkitpdf": "<1.1.4", + "dnadesign/silverstripe-elemental": "<5.3.12", "doctrine/annotations": "<1.2.7", "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", "doctrine/common": "<2.4.3|>=2.5,<2.5.1", @@ -337,7 +400,7 @@ "ezsystems/ezplatform-http-cache": "<2.3.16", "ezsystems/ezplatform-kernel": "<1.2.5.1-dev|>=1.3,<1.3.35", "ezsystems/ezplatform-rest": ">=1.2,<=1.2.2|>=1.3,<1.3.8", - "ezsystems/ezplatform-richtext": ">=2.3,<2.3.7.1-dev|>=3.3,<3.3.40", + "ezsystems/ezplatform-richtext": ">=2.3,<2.3.26|>=3.3,<3.3.40", "ezsystems/ezplatform-solr-search-engine": ">=1.7,<1.7.12|>=2,<2.0.2|>=3.3,<3.3.15", "ezsystems/ezplatform-user": ">=1,<1.0.1", "ezsystems/ezpublish-kernel": "<6.13.8.2-dev|>=7,<7.5.31", @@ -391,6 +454,8 @@ "funadmin/funadmin": "<=5.0.2", "gaoming13/wechat-php-sdk": "<=1.10.2", "genix/cms": "<=1.1.11", + "georgringer/news": "<1.3.3", + "geshi/geshi": "<1.0.8.11-dev", "getformwork/formwork": "<1.13.1|>=2.0.0.0-beta1,<2.0.0.0-beta4", "getgrav/grav": "<1.7.46", "getkirby/cms": "<=3.6.6.5|>=3.7,<=3.7.5.4|>=3.8,<=3.8.4.3|>=3.9,<=3.9.8.1|>=3.10,<=3.10.1|>=4,<=4.3", @@ -423,7 +488,7 @@ "hyn/multi-tenant": ">=5.6,<5.7.2", "ibexa/admin-ui": ">=4.2,<4.2.3|>=4.6,<4.6.14", "ibexa/core": ">=4,<4.0.7|>=4.1,<4.1.4|>=4.2,<4.2.3|>=4.5,<4.5.6|>=4.6,<4.6.2", - "ibexa/fieldtype-richtext": ">=4.6,<4.6.10", + "ibexa/fieldtype-richtext": ">=4.6,<4.6.19", "ibexa/graphql": ">=2.5,<2.5.31|>=3.3,<3.3.28|>=4.2,<4.2.3", "ibexa/http-cache": ">=4.6,<4.6.14", "ibexa/post-install": "<1.0.16|>=4.6,<4.6.14", @@ -439,7 +504,7 @@ "illuminate/view": "<6.20.42|>=7,<7.30.6|>=8,<8.75", "imdbphp/imdbphp": "<=5.1.1", "impresscms/impresscms": "<=1.4.5", - "impresspages/impresspages": "<=1.0.12", + "impresspages/impresspages": "<1.0.13", "in2code/femanager": "<5.5.3|>=6,<6.3.4|>=7,<7.2.3", "in2code/ipandlanguageredirect": "<5.1.2", "in2code/lux": "<17.6.1|>=18,<24.0.2", @@ -452,25 +517,30 @@ "islandora/islandora": ">=2,<2.4.1", "ivankristianto/phpwhois": "<=4.3", "jackalope/jackalope-doctrine-dbal": "<1.7.4", + "jambagecom/div2007": "<0.10.2", "james-heinrich/getid3": "<1.9.21", "james-heinrich/phpthumb": "<1.7.12", "jasig/phpcas": "<1.3.3", + "jbartels/wec-map": "<3.0.3", "jcbrand/converse.js": "<3.3.3", "joelbutcher/socialstream": "<5.6|>=6,<6.2", "johnbillion/wp-crontrol": "<1.16.2", "joomla/application": "<1.0.13", "joomla/archive": "<1.1.12|>=2,<2.0.1", + "joomla/database": ">=1,<2.2|>=3,<3.4", "joomla/filesystem": "<1.6.2|>=2,<2.0.1", "joomla/filter": "<1.4.4|>=2,<2.0.1", "joomla/framework": "<1.5.7|>=2.5.4,<=3.8.12", "joomla/input": ">=2,<2.0.2", - "joomla/joomla-cms": ">=2.5,<3.9.12", + "joomla/joomla-cms": "<3.9.12|>=4,<4.4.13|>=5,<5.2.6", + "joomla/joomla-platform": "<1.5.4", "joomla/session": "<1.3.1", "joyqi/hyper-down": "<=2.4.27", "jsdecena/laracom": "<2.0.9", "jsmitty12/phpwhois": "<5.1", "juzaweb/cms": "<=3.4", "jweiland/events2": "<8.3.8|>=9,<9.0.6", + "jweiland/kk-downloader": "<1.2.2", "kazist/phpwhois": "<=4.2.6", "kelvinmo/simplexrd": "<3.1.1", "kevinpapst/kimai2": "<1.16.7", @@ -527,6 +597,7 @@ "mainwp/mainwp": "<=4.4.3.3", "mantisbt/mantisbt": "<=2.26.3", "marcwillmann/turn": "<0.3.3", + "matomo/matomo": "<1.11", "matyhtf/framework": "<3.0.6", "mautic/core": "<5.2.3", "mautic/core-lib": ">=1.0.0.0-beta,<4.4.13|>=5.0.0.0-alpha,<5.1.1", @@ -538,6 +609,7 @@ "mediawiki/data-transfer": ">=1.39,<1.39.11|>=1.41,<1.41.3|>=1.42,<1.42.2", "mediawiki/matomo": "<2.4.3", "mediawiki/semantic-media-wiki": "<4.0.2", + "mehrwert/phpmyadmin": "<3.2", "melisplatform/melis-asset-manager": "<5.0.1", "melisplatform/melis-cms": "<5.0.1", "melisplatform/melis-front": "<5.0.1", @@ -597,6 +669,7 @@ "october/october": "<=3.6.4", "october/rain": "<1.0.472|>=1.1,<1.1.2", "october/system": "<1.0.476|>=1.1,<1.1.12|>=2,<2.2.34|>=3,<3.5.15", + "oliverklee/phpunit": "<3.5.15", "omeka/omeka-s": "<4.0.3", "onelogin/php-saml": "<2.10.4", "oneup/uploader-bundle": ">=1,<1.9.3|>=2,<2.1.5", @@ -630,6 +703,7 @@ "pear/archive_tar": "<1.4.14", "pear/auth": "<1.2.4", "pear/crypt_gpg": "<1.6.7", + "pear/http_request2": "<2.7", "pear/pear": "<=1.10.1", "pegasus/google-for-jobs": "<1.5.1|>=2,<2.1.1", "personnummer/personnummer": "<3.0.2", @@ -655,7 +729,7 @@ "phpxmlrpc/extras": "<0.6.1", "phpxmlrpc/phpxmlrpc": "<4.9.2", "pi/pi": "<=2.5", - "pimcore/admin-ui-classic-bundle": "<1.7.4", + "pimcore/admin-ui-classic-bundle": "<1.7.6", "pimcore/customer-management-framework-bundle": "<4.2.1", "pimcore/data-hub": "<1.2.4", "pimcore/data-importer": "<1.8.9|>=1.9,<1.9.3", @@ -663,6 +737,7 @@ "pimcore/ecommerce-framework-bundle": "<1.0.10", "pimcore/perspective-editor": "<1.5.1", "pimcore/pimcore": "<11.5.4", + "piwik/piwik": "<1.11", "pixelfed/pixelfed": "<0.12.5", "plotly/plotly.js": "<2.25.2", "pocketmine/bedrock-protocol": "<8.0.2", @@ -688,6 +763,7 @@ "ptheofan/yii2-statemachine": ">=2.0.0.0-RC1-dev,<=2", "ptrofimov/beanstalk_console": "<1.7.14", "pubnub/pubnub": "<6.1", + "punktde/pt_extbase": "<1.5.1", "pusher/pusher-php-server": "<2.2.1", "pwweb/laravel-core": "<=0.3.6.0-beta", "pxlrbt/filament-excel": "<1.1.14|>=2.0.0.0-alpha,<2.3.3", @@ -720,8 +796,8 @@ "serluck/phpwhois": "<=4.2.6", "sfroemken/url_redirect": "<=1.2.1", "sheng/yiicms": "<1.2.1", - "shopware/core": "<=6.5.8.12|>=6.6,<=6.6.5", - "shopware/platform": "<=6.5.8.12|>=6.6,<=6.6.5", + "shopware/core": "<6.5.8.17-dev|>=6.6,<6.6.10.3-dev|>=6.7.0.0-RC1-dev,<6.7.0.0-RC2-dev", + "shopware/platform": "<6.5.8.17-dev|>=6.6,<6.6.10.3-dev|>=6.7.0.0-RC1-dev,<6.7.0.0-RC2-dev", "shopware/production": "<=6.3.5.2", "shopware/shopware": "<=5.7.17", "shopware/storefront": "<=6.4.8.1|>=6.5.8,<6.5.8.7-dev", @@ -734,7 +810,7 @@ "silverstripe/cms": "<4.11.3", "silverstripe/comments": ">=1.3,<3.1.1", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": "<5.3.8", + "silverstripe/framework": "<5.3.23", "silverstripe/graphql": ">=2,<2.0.5|>=3,<3.8.2|>=4,<4.3.7|>=5,<5.1.3", "silverstripe/hybridsessions": ">=1,<2.4.1|>=2.5,<2.5.1", "silverstripe/recipe-cms": ">=4.5,<4.5.3", @@ -757,7 +833,9 @@ "simplesamlphp/xml-security": "==1.6.11", "simplito/elliptic-php": "<1.0.6", "sitegeist/fluid-components": "<3.5", + "sjbr/sr-feuser-register": "<2.6.2", "sjbr/sr-freecap": "<2.4.6|>=2.5,<2.5.3", + "sjbr/static-info-tables": "<2.3.1", "slim/psr7": "<1.4.1|>=1.5,<1.5.1|>=1.6,<1.6.1", "slim/slim": "<2.6", "slub/slub-events": "<3.0.3", @@ -785,6 +863,7 @@ "sulu/sulu": "<1.6.44|>=2,<2.5.21|>=2.6,<2.6.5", "sumocoders/framework-user-bundle": "<1.4", "superbig/craft-audit": "<3.0.2", + "svewap/a21glossary": "<=0.4.10", "swag/paypal": "<5.4.4", "swiftmailer/swiftmailer": "<6.2.5", "swiftyedit/swiftyedit": "<1.2", @@ -872,6 +951,7 @@ "typo3/cms-dashboard": ">=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", "typo3/cms-extbase": "<6.2.24|>=7,<7.6.8|==8.1.1", "typo3/cms-extensionmanager": ">=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", + "typo3/cms-felogin": ">=4.2,<4.2.3", "typo3/cms-fluid": "<4.3.4|>=4.4,<4.4.1", "typo3/cms-form": ">=8,<=8.7.39|>=9,<=9.5.24|>=10,<=10.4.47|>=11,<=11.5.41|>=12,<=12.4.24|>=13,<=13.4.2", "typo3/cms-frontend": "<4.3.9|>=4.4,<4.4.5", @@ -896,21 +976,24 @@ "uvdesk/core-framework": "<=1.1.1", "vanilla/safecurl": "<0.9.2", "verbb/comments": "<1.5.5", - "verbb/formie": "<2.1.6", + "verbb/formie": "<=2.1.43", "verbb/image-resizer": "<2.0.9", "verbb/knock-knock": "<1.2.8", "verot/class.upload.php": "<=2.1.6", + "vertexvaar/falsftp": "<0.2.6", "villagedefrance/opencart-overclocked": "<=1.11.1", "vova07/yii2-fileapi-widget": "<0.1.9", "vrana/adminer": "<4.8.1", "vufind/vufind": ">=2,<9.1.1", "waldhacker/hcaptcha": "<2.1.2", "wallabag/tcpdf": "<6.2.22", - "wallabag/wallabag": "<2.6.7", + "wallabag/wallabag": "<2.6.11", "wanglelecc/laracms": "<=1.0.3", + "wapplersystems/a21glossary": "<=0.4.10", "web-auth/webauthn-framework": ">=3.3,<3.3.4|>=4.5,<4.9", "web-auth/webauthn-lib": ">=4.5,<4.9", "web-feet/coastercms": "==5.5", + "web-tp3/wec_map": "<3.0.3", "webbuilders-group/silverstripe-kapost-bridge": "<0.4", "webcoast/deferred-image-processing": "<1.0.2", "webklex/laravel-imap": "<5.3", @@ -940,8 +1023,8 @@ "yetiforce/yetiforce-crm": "<6.5", "yidashi/yii2cmf": "<=2", "yii2mod/yii2-cms": "<1.9.2", - "yiisoft/yii": "<1.1.29", - "yiisoft/yii2": "<2.0.49.4-dev", + "yiisoft/yii": "<1.1.31", + "yiisoft/yii2": "<2.0.52", "yiisoft/yii2-authclient": "<2.2.15", "yiisoft/yii2-bootstrap": "<2.0.4", "yiisoft/yii2-dev": "<=2.0.45", @@ -1027,12 +1110,13 @@ "type": "tidelift" } ], - "time": "2025-04-04T15:05:17+00:00" + "time": "2025-04-17T15:05:22+00:00" } ], "aliases": [], "minimum-stability": "stable", "stability-flags": { + "phpmetrics/phpmetrics": 5, "roave/security-advisories": 20 }, "prefer-stable": false,