From 766d8d3c78591081822f0ae831ab257a7011f6ab Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 11 Oct 2026 00:41:57 +0200 Subject: [PATCH] [split] remove preload for split packages 2 --- build/build-preload.php | 43 ------------------- .../RemoveUnusedPrivatePropertyRector.php | 2 +- 2 files changed, 1 insertion(+), 44 deletions(-) diff --git a/build/build-preload.php b/build/build-preload.php index c9836ba99a1..47630502cdf 100755 --- a/build/build-preload.php +++ b/build/build-preload.php @@ -140,38 +140,6 @@ public function buildPreloadScript(string $buildDirectory, string $preloadFile): $this->buildPreloadScriptPhpDocParser($buildDirectory, $preloadFile); } - public function buildPreloadScriptForSplitPackage(string $buildDirectory, string $preloadFile): void - { - $this->buildPreloadScriptForSplitPhpParser($buildDirectory, $preloadFile); - $this->buildPreloadScriptForSplitPhpDocParser($buildDirectory, $preloadFile); - } - - private function buildPreloadScriptForSplitPhpParser(string $buildDirectory, string $preloadFile): void - { - $vendorDir = $buildDirectory . '/vendor'; - if (! is_dir($vendorDir . '/nikic/php-parser/lib/PhpParser')) { - return; - } - - // 1. find php-parser file infos - $fileInfos = $this->findPhpParserFilesAndSortThem($vendorDir); - - file_put_contents($preloadFile, $preloadFileContent); - } - - private function buildPreloadScriptForSplitPhpDocParser(string $buildDirectory, string $preloadFile): void - { - $vendorDir = $buildDirectory . '/vendor'; - if (! is_dir($vendorDir . '/phpstan/phpdoc-parser')) { - return; - } - - // 1. find phpdoc-parser file infos - $fileInfos = $this->findPhpDocParserFilesAndSortThem($vendorDir); - - file_put_contents($preloadFile, $preloadFileContent, FILE_APPEND); - } - private function buildPreloadScriptPhpDocParser(string $buildDirectory, string $preloadFile): void { $vendorDir = $buildDirectory . '/vendor'; @@ -254,17 +222,6 @@ private function createPreloadFileContent(array $fileInfos, bool $append = false return $preloadFileContent; } - private function createRequireOnceFilePathLineForSplitPackage(string $realPath): string - { - if (! str_contains($realPath, 'vendor')) { - $filePath = '/src/' . Strings::after($realPath, '/src/'); - return "require_once __DIR__ . '" . $filePath . "';" . PHP_EOL; - } - - $filePath = '/../../../vendor/' . Strings::after($realPath, 'vendor/'); - return "require_once __DIR__ . '" . $filePath . "';" . PHP_EOL; - } - private function createRequireOnceFilePathLine(string $realPath): string { if (! str_contains($realPath, 'vendor')) { diff --git a/rules/DeadCode/Rector/Property/RemoveUnusedPrivatePropertyRector.php b/rules/DeadCode/Rector/Property/RemoveUnusedPrivatePropertyRector.php index 69bd21eb30a..88adce14513 100644 --- a/rules/DeadCode/Rector/Property/RemoveUnusedPrivatePropertyRector.php +++ b/rules/DeadCode/Rector/Property/RemoveUnusedPrivatePropertyRector.php @@ -69,7 +69,7 @@ public function getNodeTypes(): array public function refactor(Node $node): ?Node { // skip if has no private property - $hasAnyPrivateProperty = array_any($node->getProperties(), fn(Property $property): bool => $property->isPrivate()); + $hasAnyPrivateProperty = array_any($node->getProperties(), fn (Property $property): bool => $property->isPrivate()); if (! $hasAnyPrivateProperty) { return null;