Skip to content

Commit b38ba48

Browse files
authored
Merge pull request #2978 from tarlepp/chore/parentheses-removal
Removed obsolete parentheses around the `new` calls
2 parents 49749a2 + 7ac017e commit b38ba48

File tree

117 files changed

+668
-505
lines changed

Some content is hidden

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

117 files changed

+668
-505
lines changed

composer.lock

Lines changed: 52 additions & 32 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docker-entrypoint-dev.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export XDEBUG_SESSION=PHPSTORM
2626
COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader
2727

2828
# Step 3
29-
#composer audit
29+
composer audit
3030

3131
# Step 4
3232
make generate-jwt-keys

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

0 commit comments

Comments
 (0)