From 3b38dff7a6f12a2a94e6ef062f496b265c10b39b Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 8 Nov 2024 16:04:07 +0100 Subject: [PATCH] TASK: Reintroduce methods and prefer to deprecate them :) --- Neos.Fusion/Classes/Core/FusionSourceCodeCollection.php | 9 +++++++++ .../Classes/Domain/Service/FusionSourceCodeFactory.php | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/Neos.Fusion/Classes/Core/FusionSourceCodeCollection.php b/Neos.Fusion/Classes/Core/FusionSourceCodeCollection.php index 00eacaa5b04..c1d4c809330 100644 --- a/Neos.Fusion/Classes/Core/FusionSourceCodeCollection.php +++ b/Neos.Fusion/Classes/Core/FusionSourceCodeCollection.php @@ -52,6 +52,15 @@ public static function tryFromFilePath(string $filePath): self return self::fromFilePath($filePath); } + /** + * @deprecated with Neos 9, remove me :) + */ + public static function tryFromPackageRootFusion(string $packageKey): self + { + $fusionPathAndFilename = sprintf('resource://%s/Private/Fusion/Root.fusion', $packageKey); + return self::tryFromFilePath($fusionPathAndFilename); + } + public static function empty(): self { return new self(); diff --git a/Neos.Neos/Classes/Domain/Service/FusionSourceCodeFactory.php b/Neos.Neos/Classes/Domain/Service/FusionSourceCodeFactory.php index 657d2ef94ff..e8766ba3e5a 100644 --- a/Neos.Neos/Classes/Domain/Service/FusionSourceCodeFactory.php +++ b/Neos.Neos/Classes/Domain/Service/FusionSourceCodeFactory.php @@ -59,6 +59,14 @@ public function createFromAutoIncludes(): FusionSourceCodeCollection return $sourcecode; } + /** + * @deprecated with Neos 9 - YAGNI from the start :) + */ + public function createFromSite(Site $site): FusionSourceCodeCollection + { + return FusionSourceCodeCollection::tryFromPackageRootFusion($site->getSiteResourcesPackageKey()); + } + /** * Generate Fusion prototype definitions for all node types *