Skip to content

Commit 48985cb

Browse files
committed
Removed obsolete parentheses around the 'new' calls
1 parent 49749a2 commit 48985cb

File tree

103 files changed

+283
-283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+283
-283
lines changed

src/Command/Utils/CheckDependencies.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
139139
private function getNamespaceDirectories(): array
140140
{
141141
// Find all main namespace directories under 'tools' directory
142-
$finder = (new Finder())
142+
$finder = new Finder()
143143
->depth(1)
144144
->ignoreDotFiles(true)
145145
->directories()

src/EventSubscriber/JWTCreatedSubscriber.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ private function setLocalizationData(array &$payload, UserInterface $user): void
100100
private function setExpiration(array &$payload): void
101101
{
102102
// Set new exp value for JWT
103-
$payload['exp'] = (new DateTime('+1 day', new DateTimeZone('UTC')))->getTimestamp();
103+
$payload['exp'] = new DateTime('+1 day', new DateTimeZone('UTC'))->getTimestamp();
104104
}
105105

106106
/**

src/Repository/HealthzRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function create(): Entity
8787
public function cleanup(): int
8888
{
8989
// Determine date
90-
$date = (new DateTimeImmutable(timezone: new DateTimeZone('UTC')))
90+
$date = new DateTimeImmutable(timezone: new DateTimeZone('UTC'))
9191
->sub(new DateInterval('P7D'));
9292

9393
// Create query builder

src/Repository/LogRequestRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(
5151
public function cleanHistory(): int
5252
{
5353
// Determine date
54-
$date = (new DateTimeImmutable(timezone: new DateTimeZone('UTC')))
54+
$date = new DateTimeImmutable(timezone: new DateTimeZone('UTC'))
5555
->sub(new DateInterval('P3Y'));
5656

5757
// Create query builder and define delete query

src/Repository/Traits/RepositoryMethodsTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function findByAdvanced(
105105
*/
106106
RepositoryHelper::resetParameterCount();
107107

108-
$iterator = (new Paginator($queryBuilder, true))->getIterator();
108+
$iterator = new Paginator($queryBuilder, true)->getIterator();
109109

110110
assert($iterator instanceof ArrayIterator);
111111

src/Rest/RestResource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public function getDtoForEntity(
120120
* @var RestDtoInterface $restDto
121121
* @var class-string<RestDtoInterface> $dtoClass
122122
*/
123-
$restDto = (new $dtoClass())
123+
$restDto = new $dtoClass()
124124
->setId($id);
125125

126126
if ($patch === true) {

tests/DataFixtures/ORM/LoadApiKeyData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public function getOrder(): int
7777
private function createApiKey(ObjectManager $manager, ?string $role = null): bool
7878
{
7979
// Create new entity
80-
$entity = (new ApiKey())
80+
$entity = new ApiKey()
8181
->setDescription('ApiKey Description: ' . ($role === null ? '' : $this->rolesService->getShort($role)))
8282
->setToken(str_pad($role === null ? '' : $this->rolesService->getShort($role), 40, '_'));
8383

tests/DataFixtures/ORM/LoadRoleData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function getOrder(): int
5959
private function createRole(ObjectManager $manager, string $role): bool
6060
{
6161
// Create new Role entity
62-
$entity = (new Role($role))
62+
$entity = new Role($role)
6363
->setDescription('Description - ' . $role);
6464

6565
// Persist entity

tests/DataFixtures/ORM/LoadUserData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ private function createUser(ObjectManager $manager, ?string $role = null): bool
8282
$suffix = $role === null ? '' : '-' . $this->rolesService->getShort($role);
8383

8484
// Create new entity
85-
$entity = (new User())
85+
$entity = new User()
8686
->setUsername('john' . $suffix)
8787
->setFirstName('John')
8888
->setLastName('Doe')

tests/DataFixtures/ORM/LoadUserGroupData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ private function createUserGroup(ObjectManager $manager, string $role): bool
7474
$roleReference = $this->getReference('Role-' . $this->rolesService->getShort($role), Role::class);
7575

7676
// Create new entity
77-
$entity = (new UserGroup())
77+
$entity = new UserGroup()
7878
->setRole($roleReference)
7979
->setName($this->rolesService->getRoleLabel($role));
8080

0 commit comments

Comments
 (0)