diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index 9a4d803a2..9d9060c86 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -25,10 +25,13 @@ ->setRiskyAllowed(true) ->setRules([ // Presets - '@PSR12' => true, - '@PSR12:risky' => true, - '@PHP83Migration' => true, - '@PHP80Migration:risky' => true, + '@PER-CS' => true, + '@PER-CS:risky' => true, + '@PHP84Migration' => true, + // PHP-CS-Fixer 3.95 has no @PHP83Migration:risky or @PHP84Migration:risky; + // @PHP82Migration:risky is the latest extant risky migration set and a strict + // superset of @PHP80Migration:risky (the previous setting). + '@PHP82Migration:risky' => true, '@Symfony' => true, '@Symfony:risky' => true, diff --git a/tests/Command/TtSyncSubticketsCommandTest.php b/tests/Command/TtSyncSubticketsCommandTest.php index 690d1dfd3..cf5e469c5 100644 --- a/tests/Command/TtSyncSubticketsCommandTest.php +++ b/tests/Command/TtSyncSubticketsCommandTest.php @@ -49,8 +49,8 @@ public function testRunsForAllProjectsWithTicketSystem(): void ->willReturnOnConsecutiveCalls(['X-1', 'X-2'], []); // Repository mock that returns a minimal query builder-like object - $project = (new Project())->setId(1)->setName('Alpha'); - $p2 = (new Project())->setId(2)->setName('Beta'); + $project = new Project()->setId(1)->setName('Alpha'); + $p2 = new Project()->setId(2)->setName('Beta'); $projectRepo = $this->getMockBuilder(\Doctrine\ORM\EntityRepository::class) ->disableOriginalConstructor() ->onlyMethods(['createQueryBuilder']) diff --git a/tests/Controller/ControllingControllerTest.php b/tests/Controller/ControllingControllerTest.php index e1d057e4b..606210a57 100644 --- a/tests/Controller/ControllingControllerTest.php +++ b/tests/Controller/ControllingControllerTest.php @@ -123,11 +123,11 @@ public function testExportActionWithBillableAndTicketTitles(): void $exportServiceMock = $this->createMock(Export::class); // --- Real entities for export --- - $user = (new \App\Entity\User())->setId(1)->setUsername('unittest'); - $customer = (new \App\Entity\Customer())->setId(1)->setName('Test Customer'); - $project = (new \App\Entity\Project())->setId(1)->setName('Test Project'); + $user = new \App\Entity\User()->setId(1)->setUsername('unittest'); + $customer = new \App\Entity\Customer()->setId(1)->setName('Test Customer'); + $project = new \App\Entity\Project()->setId(1)->setName('Test Project'); - $entry1 = (new \App\Entity\Entry()) + $entry1 = new \App\Entity\Entry() ->setId(4) ->setDay(new DateTime('2023-10-15')) ->setStart(new DateTime('2023-10-15 09:00:00')) @@ -139,7 +139,7 @@ public function testExportActionWithBillableAndTicketTitles(): void ->setDescription('Real Desc 1'); // ->setActivity(null) // Assuming default is fine or set if needed - $entry2 = (new \App\Entity\Entry()) + $entry2 = new \App\Entity\Entry() ->setId(5) ->setDay(new DateTime('2023-10-20')) ->setStart(new DateTime('2023-10-20 11:00:00')) @@ -233,11 +233,11 @@ public function testExportActionHidesBillableFieldWhenNotConfigured(): void $exportServiceMock = $this->createMock(Export::class); // --- Mock data for export --- - $user = (new \App\Entity\User())->setId(1)->setUsername('testuser'); - $customer = (new \App\Entity\Customer())->setId(1)->setName('Test Customer'); - $project = (new \App\Entity\Project())->setId(1)->setName('Test Project'); + $user = new \App\Entity\User()->setId(1)->setUsername('testuser'); + $customer = new \App\Entity\Customer()->setId(1)->setName('Test Customer'); + $project = new \App\Entity\Project()->setId(1)->setName('Test Project'); - $entry1 = (new \App\Entity\Entry()) + $entry1 = new \App\Entity\Entry() ->setId(6) ->setDay(new DateTime('2023-11-05')) ->setStart(new DateTime('2023-11-05 08:00:00')) diff --git a/tests/Performance/PerformanceBenchmarkRunner.php b/tests/Performance/PerformanceBenchmarkRunner.php index c06819e2a..a2e3efd58 100644 --- a/tests/Performance/PerformanceBenchmarkRunner.php +++ b/tests/Performance/PerformanceBenchmarkRunner.php @@ -80,7 +80,7 @@ private function setupRegressionThresholds(): void public function runAllBenchmarks(): array { $this->benchmarkResults = [ - 'timestamp' => (new DateTime())->format('c'), + 'timestamp' => new DateTime()->format('c'), 'php_version' => PHP_VERSION, 'memory_limit' => ini_get('memory_limit'), 'max_execution_time' => ini_get('max_execution_time'), @@ -213,7 +213,7 @@ private function runSingleBenchmark(string $testClass, string $method): array 'execution_time_ms' => round(($endTime - $startTime) * 1000, 2), 'memory_usage_bytes' => $endMemory - $startMemory, 'peak_memory_usage_bytes' => $endPeakMemory - $startPeakMemory, - 'timestamp' => (new DateTime())->format('c'), + 'timestamp' => new DateTime()->format('c'), ]; } diff --git a/tests/Performance/PerformanceDashboard.php b/tests/Performance/PerformanceDashboard.php index 8c7f27753..36f15f9f7 100644 --- a/tests/Performance/PerformanceDashboard.php +++ b/tests/Performance/PerformanceDashboard.php @@ -455,7 +455,7 @@ private function prepareChartData(array $history): array if (!is_string($runTimestamp)) { $runTimestamp = is_scalar($runTimestamp) ? (string) $runTimestamp : date('c'); } - $timestamps[] = (new DateTime($runTimestamp))->format('M d'); + $timestamps[] = new DateTime($runTimestamp)->format('M d'); // Calculate average execution time per run $totalTime = 0; diff --git a/tests/Repository/EntryRepositoryTest.php b/tests/Repository/EntryRepositoryTest.php index 1c8a289b6..c61cacc82 100644 --- a/tests/Repository/EntryRepositoryTest.php +++ b/tests/Repository/EntryRepositoryTest.php @@ -40,8 +40,8 @@ public function today(): DateTimeImmutable }; // Avoid touching Doctrine by creating a partial instance without constructor - $entryRepository = (new ReflectionClass(EntryRepository::class))->newInstanceWithoutConstructor(); - $reflectionProperty = (new ReflectionClass(EntryRepository::class))->getProperty('clock'); + $entryRepository = new ReflectionClass(EntryRepository::class)->newInstanceWithoutConstructor(); + $reflectionProperty = new ReflectionClass(EntryRepository::class)->getProperty('clock'); $reflectionProperty->setValue($entryRepository, $clock); // 1 working day on Monday should include previous Fri,Sat,Sun => 3 calendar days @@ -65,9 +65,9 @@ public function today(): DateTimeImmutable } // Tuesday }; // Avoid touching Doctrine by creating a partial mock that bypasses parent constructor - $entryRepository = (new ReflectionClass(EntryRepository::class))->newInstanceWithoutConstructor(); + $entryRepository = new ReflectionClass(EntryRepository::class)->newInstanceWithoutConstructor(); // Inject clock via reflection - $reflectionProperty = (new ReflectionClass(EntryRepository::class))->getProperty('clock'); + $reflectionProperty = new ReflectionClass(EntryRepository::class)->getProperty('clock'); $reflectionProperty->setValue($entryRepository, $clock); self::assertSame(0, $entryRepository->getCalendarDaysByWorkDays(0)); @@ -89,8 +89,8 @@ public function today(): DateTimeImmutable } // Monday }; // Avoid touching Doctrine by creating a partial mock that bypasses parent constructor - $entryRepository = (new ReflectionClass(EntryRepository::class))->newInstanceWithoutConstructor(); - $reflectionProperty = (new ReflectionClass(EntryRepository::class))->getProperty('clock'); + $entryRepository = new ReflectionClass(EntryRepository::class)->newInstanceWithoutConstructor(); + $reflectionProperty = new ReflectionClass(EntryRepository::class)->getProperty('clock'); $reflectionProperty->setValue($entryRepository, $clock); self::assertSame(3, $entryRepository->getCalendarDaysByWorkDays(1)); // Monday spans back to Friday @@ -110,8 +110,8 @@ public function today(): DateTimeImmutable } }; - $entryRepository = (new ReflectionClass(EntryRepository::class))->newInstanceWithoutConstructor(); - $reflectionProperty = (new ReflectionClass(EntryRepository::class))->getProperty('clock'); + $entryRepository = new ReflectionClass(EntryRepository::class)->newInstanceWithoutConstructor(); + $reflectionProperty = new ReflectionClass(EntryRepository::class)->getProperty('clock'); $reflectionProperty->setValue($entryRepository, $clock); self::assertSame(0, $entryRepository->getCalendarDaysByWorkDays(-5)); @@ -132,8 +132,8 @@ public function today(): DateTimeImmutable } // Friday }; - $entryRepository = (new ReflectionClass(EntryRepository::class))->newInstanceWithoutConstructor(); - $reflectionProperty = (new ReflectionClass(EntryRepository::class))->getProperty('clock'); + $entryRepository = new ReflectionClass(EntryRepository::class)->newInstanceWithoutConstructor(); + $reflectionProperty = new ReflectionClass(EntryRepository::class)->getProperty('clock'); $reflectionProperty->setValue($entryRepository, $clock); // 1 working day on Friday should be just 1 calendar day @@ -158,8 +158,8 @@ public function today(): DateTimeImmutable } // Wednesday }; - $entryRepository = (new ReflectionClass(EntryRepository::class))->newInstanceWithoutConstructor(); - $reflectionProperty = (new ReflectionClass(EntryRepository::class))->getProperty('clock'); + $entryRepository = new ReflectionClass(EntryRepository::class)->newInstanceWithoutConstructor(); + $reflectionProperty = new ReflectionClass(EntryRepository::class)->getProperty('clock'); $reflectionProperty->setValue($entryRepository, $clock); // 1 working day on Wednesday is just 1 calendar day diff --git a/tests/Repository/EntryRepositoryUnitTest.php b/tests/Repository/EntryRepositoryUnitTest.php index 804941c6c..c9d2770ee 100644 --- a/tests/Repository/EntryRepositoryUnitTest.php +++ b/tests/Repository/EntryRepositoryUnitTest.php @@ -24,7 +24,7 @@ final class EntryRepositoryUnitTest extends TestCase */ private function createRepositoryWithClock(ClockInterface $clock): EntryRepository { - $repository = (new ReflectionClass(EntryRepository::class))->newInstanceWithoutConstructor(); + $repository = new ReflectionClass(EntryRepository::class)->newInstanceWithoutConstructor(); // Use reflection to set the readonly property before it's initialized $reflectionClass = new ReflectionClass(EntryRepository::class); diff --git a/tests/Security/LdapAuthenticatorTest.php b/tests/Security/LdapAuthenticatorTest.php index 7e85c8e5b..92f8d4c0c 100644 --- a/tests/Security/LdapAuthenticatorTest.php +++ b/tests/Security/LdapAuthenticatorTest.php @@ -198,7 +198,7 @@ public function testAuthenticateReturnsExistingUser(): void { $this->configureDefaultLdapParams(); - $existingUser = (new User())->setUsername('testuser'); + $existingUser = new User()->setUsername('testuser'); $userRepo = $this->createMock(UserRepository::class); $userRepo->method('findOneBy')->willReturn($existingUser); @@ -278,7 +278,7 @@ public function testAuthenticateCreatesUserWithTeams(): void { $this->configureDefaultLdapParams(); - $team = (new Team())->setName('Dev Team'); + $team = new Team()->setName('Dev Team'); $userRepo = $this->createMock(UserRepository::class); $userRepo->method('findOneBy')->willReturn(null); @@ -584,7 +584,7 @@ public function testAuthenticateWithValidEmailUsername(): void { $this->configureDefaultLdapParams(); - $existingUser = (new User())->setUsername('user@example.com'); + $existingUser = new User()->setUsername('user@example.com'); $userRepo = $this->createMock(UserRepository::class); $userRepo->method('findOneBy')->willReturn($existingUser); diff --git a/tests/Service/ExportServiceTest.php b/tests/Service/ExportServiceTest.php index ed09b69e7..1c5eb766e 100644 --- a/tests/Service/ExportServiceTest.php +++ b/tests/Service/ExportServiceTest.php @@ -274,10 +274,10 @@ public function testExportEntriesBatchedStopsWhenBatchSmallerThanLimit(): void public function testGetEntriesReturnsFormattedData(): void { - $user = (new User())->setUsername('johndoe'); - $customer = (new Customer())->setName('Acme Corp'); - $project = (new Project())->setName('Project X'); - $activity = (new Activity())->setName('Development'); + $user = new User()->setUsername('johndoe'); + $customer = new Customer()->setName('Acme Corp'); + $project = new Project()->setName('Project X'); + $activity = new Activity()->setName('Development'); $entry = $this->createEntry($user, $customer, $project, $activity, '', null, 'Test description'); @@ -351,12 +351,12 @@ public function testGetEntriesWithEmptyRelatedEntities(): void public function testGetEntriesWithTicketUrl(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::JIRA) ->setTicketUrl('https://jira.example.com/browse/%s'); - $project = (new Project()) + $project = new Project() ->setName('JIRA Project') ->setTicketSystem($ticketSystem); @@ -379,12 +379,12 @@ public function testGetEntriesWithTicketUrl(): void public function testGetEntriesWithWorklogUrl(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::JIRA) ->setTicketUrl('https://jira.example.com/browse/%s'); - $project = (new Project()) + $project = new Project() ->setName('JIRA Project') ->setTicketSystem($ticketSystem); @@ -447,7 +447,7 @@ public function testGetEntriesTicketUrlWithoutProject(): void public function testGetEntriesTicketUrlWithoutTicketSystem(): void { - $project = (new Project())->setName('No Ticket System'); + $project = new Project()->setName('No Ticket System'); $entry = $this->createEntry(null, null, $project, null, 'TEST-1'); $reflection = new ReflectionClass($entry); @@ -466,12 +466,12 @@ public function testGetEntriesTicketUrlWithoutTicketSystem(): void public function testGetEntriesWorklogUrlEmptyWithoutWorklogId(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::JIRA) ->setTicketUrl('https://jira.example.com/browse/%s'); - $project = (new Project()) + $project = new Project() ->setName('JIRA Project') ->setTicketSystem($ticketSystem); @@ -494,12 +494,12 @@ public function testGetEntriesWorklogUrlEmptyWithoutWorklogId(): void public function testGetEntriesWorklogUrlEmptyForNonJiraTicketSystem(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::OTRS) ->setTicketUrl('https://otrs.example.com/ticket/%s'); - $project = (new Project()) + $project = new Project() ->setName('OTRS Project') ->setTicketSystem($ticketSystem); @@ -521,12 +521,12 @@ public function testGetEntriesWorklogUrlEmptyForNonJiraTicketSystem(): void public function testGetEntriesTicketUrlNonJiraNoBookTime(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(false) ->setType(TicketSystemType::OTRS) ->setTicketUrl('https://otrs.example.com/ticket/%s'); - $project = (new Project()) + $project = new Project() ->setName('OTRS Project') ->setTicketSystem($ticketSystem); @@ -604,7 +604,7 @@ public function testEnrichEntriesSkipsEntriesWithoutTicket(): void public function testEnrichEntriesSkipsEntriesWithoutProject(): void { - $entry = (new Entry())->setTicket('PROJ-1'); + $entry = new Entry()->setTicket('PROJ-1'); // No project set $doctrine = $this->createManagerRegistry(user: new User()); @@ -618,8 +618,8 @@ public function testEnrichEntriesSkipsEntriesWithoutProject(): void public function testEnrichEntriesSkipsEntriesWithoutTicketSystem(): void { - $project = (new Project())->setName('No TS'); - $entry = (new Entry())->setTicket('PROJ-1')->setProject($project); + $project = new Project()->setName('No TS'); + $entry = new Entry()->setTicket('PROJ-1')->setProject($project); $doctrine = $this->createManagerRegistry(user: new User()); $jiraFactory = $this->createJiraFactory(); @@ -632,11 +632,11 @@ public function testEnrichEntriesSkipsEntriesWithoutTicketSystem(): void public function testEnrichEntriesSkipsNonBookTimeTicketSystems(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(false) ->setType(TicketSystemType::JIRA); - $project = (new Project())->setTicketSystem($ticketSystem); - $entry = (new Entry())->setTicket('PROJ-1')->setProject($project); + $project = new Project()->setTicketSystem($ticketSystem); + $entry = new Entry()->setTicket('PROJ-1')->setProject($project); $doctrine = $this->createManagerRegistry(user: new User()); $jiraFactory = $this->createJiraFactory(); @@ -649,11 +649,11 @@ public function testEnrichEntriesSkipsNonBookTimeTicketSystems(): void public function testEnrichEntriesSkipsNonJiraTicketSystems(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::OTRS); - $project = (new Project())->setTicketSystem($ticketSystem); - $entry = (new Entry())->setTicket('123456')->setProject($project); + $project = new Project()->setTicketSystem($ticketSystem); + $entry = new Entry()->setTicket('123456')->setProject($project); $doctrine = $this->createManagerRegistry(user: new User()); $jiraFactory = $this->createJiraFactory(); @@ -666,13 +666,13 @@ public function testEnrichEntriesSkipsNonJiraTicketSystems(): void public function testEnrichEntriesSetsBillableAndSummary(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::JIRA); - $project = (new Project())->setTicketSystem($ticketSystem); + $project = new Project()->setTicketSystem($ticketSystem); - $entry1 = (new Entry())->setTicket('TT-123')->setProject($project); - $entry2 = (new Entry())->setTicket('TT-999')->setProject($project); + $entry1 = new Entry()->setTicket('TT-123')->setProject($project); + $entry2 = new Entry()->setTicket('TT-999')->setProject($project); $doctrine = $this->createManagerRegistry(user: new User()); $jiraFactory = $this->createJiraFactory( @@ -692,12 +692,12 @@ public function testEnrichEntriesSetsBillableAndSummary(): void public function testEnrichEntriesOnlyBillable(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::JIRA); - $project = (new Project())->setTicketSystem($ticketSystem); + $project = new Project()->setTicketSystem($ticketSystem); - $entry = (new Entry())->setTicket('TT-100')->setProject($project); + $entry = new Entry()->setTicket('TT-100')->setProject($project); $doctrine = $this->createManagerRegistry(user: new User()); $jiraFactory = $this->createJiraFactory( @@ -715,12 +715,12 @@ public function testEnrichEntriesOnlyBillable(): void public function testEnrichEntriesOnlySummary(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::JIRA); - $project = (new Project())->setTicketSystem($ticketSystem); + $project = new Project()->setTicketSystem($ticketSystem); - $entry = (new Entry())->setTicket('TT-200')->setProject($project); + $entry = new Entry()->setTicket('TT-200')->setProject($project); $doctrine = $this->createManagerRegistry(user: new User()); $jiraFactory = $this->createJiraFactory( @@ -738,12 +738,12 @@ public function testEnrichEntriesOnlySummary(): void public function testEnrichEntriesSkipsWhenNoFieldsRequested(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::JIRA); - $project = (new Project())->setTicketSystem($ticketSystem); + $project = new Project()->setTicketSystem($ticketSystem); - $entry = (new Entry())->setTicket('TT-300')->setProject($project); + $entry = new Entry()->setTicket('TT-300')->setProject($project); $doctrine = $this->createManagerRegistry(user: new User()); $jiraFactory = $this->createJiraFactory(); @@ -757,12 +757,12 @@ public function testEnrichEntriesSkipsWhenNoFieldsRequested(): void public function testEnrichEntriesContinuesOnApiException(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::JIRA); - $project = (new Project())->setTicketSystem($ticketSystem); + $project = new Project()->setTicketSystem($ticketSystem); - $entry = (new Entry())->setTicket('TT-ERROR')->setProject($project); + $entry = new Entry()->setTicket('TT-ERROR')->setProject($project); $doctrine = $this->createManagerRegistry(user: new User()); $jiraFactory = $this->createJiraFactory(throwException: true); @@ -789,12 +789,12 @@ public function testEnrichEntriesHandlesEmptyEntries(): void public function testEnrichEntriesHandlesNonBillableLabels(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(true) ->setType(TicketSystemType::JIRA); - $project = (new Project())->setTicketSystem($ticketSystem); + $project = new Project()->setTicketSystem($ticketSystem); - $entry = (new Entry())->setTicket('TT-400')->setProject($project); + $entry = new Entry()->setTicket('TT-400')->setProject($project); $doctrine = $this->createManagerRegistry(user: new User()); $jiraFactory = $this->createJiraFactory( @@ -812,7 +812,7 @@ public function testEnrichEntriesHandlesNonBillableLabels(): void public function testGetUsernameReturnsUsername(): void { - $user = (new User())->setUsername('testuser'); + $user = new User()->setUsername('testuser'); $doctrine = $this->createManagerRegistry(user: $user); $jiraFactory = $this->createJiraFactory(); @@ -837,12 +837,12 @@ public function testGetUsernameReturnsNullForNonexistentUser(): void public function testGetEntriesHandlesWorklogUrlWithoutBookTime(): void { - $ticketSystem = (new TicketSystem()) + $ticketSystem = new TicketSystem() ->setBookTime(false) ->setType(TicketSystemType::JIRA) ->setTicketUrl('https://jira.example.com/browse/%s'); - $project = (new Project())->setTicketSystem($ticketSystem); + $project = new Project()->setTicketSystem($ticketSystem); $entry = $this->createEntry(null, null, $project, null, 'TEST-1', 12345); $reflection = new ReflectionClass($entry); diff --git a/tests/Service/SystemClockTest.php b/tests/Service/SystemClockTest.php index 0261e59f5..ce0dd4a4e 100644 --- a/tests/Service/SystemClockTest.php +++ b/tests/Service/SystemClockTest.php @@ -36,7 +36,7 @@ public function testTodayReturnsMidnight(): void { $systemClock = new SystemClock(); $today = $systemClock->today(); - $expectedDate = (new DateTimeImmutable('today midnight'))->format('Y-m-d'); + $expectedDate = new DateTimeImmutable('today midnight')->format('Y-m-d'); // Verify we get today's date at midnight self::assertSame($expectedDate, $today->format('Y-m-d')); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 52140a1d4..4fd32e16d 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -27,7 +27,7 @@ $_ENV['APP_ENV'] = $_SERVER['APP_ENV'] ?? 'test'; // Load .env files with proper test environment precedence -(new Dotenv())->usePutenv(false)->bootEnv(dirname(__DIR__) . '/.env'); +new Dotenv()->usePutenv(false)->bootEnv(dirname(__DIR__) . '/.env'); if (isset($_SERVER['APP_DEBUG']) && (bool) $_SERVER['APP_DEBUG']) { umask(0o000); diff --git a/tests/parallel-bootstrap.php b/tests/parallel-bootstrap.php index 66146ac9f..d60a78330 100644 --- a/tests/parallel-bootstrap.php +++ b/tests/parallel-bootstrap.php @@ -24,10 +24,10 @@ // Load cached env vars if the .env.local.php file exists if (is_array($env = @include dirname(__DIR__) . '/.env.local.php') && (!isset($env['APP_ENV']) || ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? $env['APP_ENV']) === $env['APP_ENV'])) { - (new Dotenv())->usePutenv(false)->populate($env); + new Dotenv()->usePutenv(false)->populate($env); } else { // load all the .env files - (new Dotenv())->usePutenv(false)->loadEnv(dirname(__DIR__) . '/.env'); + new Dotenv()->usePutenv(false)->loadEnv(dirname(__DIR__) . '/.env'); } if (isset($_SERVER['APP_DEBUG']) && (bool) $_SERVER['APP_DEBUG']) {