From 5b01fe46ebdd047eadb0d6df65ca7b544cfeb283 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sat, 8 Jun 2024 09:21:46 +0000 Subject: [PATCH 1/2] Use late static bindings to support overriding file finding --- packages/framework/src/Support/DataCollections.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/framework/src/Support/DataCollections.php b/packages/framework/src/Support/DataCollections.php index a6ea6e41466..b5ab786edef 100644 --- a/packages/framework/src/Support/DataCollections.php +++ b/packages/framework/src/Support/DataCollections.php @@ -51,7 +51,7 @@ public static function markdown(string $name): static { static::needsDirectory(static::$sourceDirectory); - return new static(DataCollections::findFiles($name, 'md')->mapWithKeys(function (string $file): array { + return new static(static::findFiles($name, 'md')->mapWithKeys(function (string $file): array { return [static::makeIdentifier($file) => MarkdownFileParser::parse($file)]; })); } @@ -67,7 +67,7 @@ public static function yaml(string $name): static { static::needsDirectory(static::$sourceDirectory); - return new static(DataCollections::findFiles($name, ['yaml', 'yml'])->mapWithKeys(function (string $file): array { + return new static(static::findFiles($name, ['yaml', 'yml'])->mapWithKeys(function (string $file): array { return [static::makeIdentifier($file) => MarkdownFileParser::parse($file)->matter()]; })); } @@ -83,7 +83,7 @@ public static function json(string $name, bool $asArray = false): static { static::needsDirectory(static::$sourceDirectory); - return new static(DataCollections::findFiles($name, 'json')->mapWithKeys(function (string $file) use ($asArray): array { + return new static(static::findFiles($name, 'json')->mapWithKeys(function (string $file) use ($asArray): array { return [static::makeIdentifier($file) => json_decode(Filesystem::get($file), $asArray)]; })); } From 38f938c487d6a4bfa21398c4efb7efdb0ddee038 Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sat, 8 Jun 2024 09:26:37 +0000 Subject: [PATCH 2/2] Update RELEASE_NOTES.md --- RELEASE_NOTES.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 156e905b363..c9bfe0aafa2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -16,6 +16,8 @@ This serves two purposes: ### Changed - When a navigation group is set in front matter, it will now be used regardless of the subdirectory configuration in https://github.com/hydephp/develop/pull/1703 (fixes https://github.com/hydephp/develop/issues/1515) +- Use late static bindings to support overriding data collections file finding in https://github.com/hydephp/develop/pull/1717 (fixes https://github.com/hydephp/develop/issues/1716) + ### Deprecated - for soon-to-be removed features. @@ -25,6 +27,7 @@ This serves two purposes: ### Fixed - Fixed explicitly set front matter navigation group behavior being dependent on subdirectory configuration, fixing https://github.com/hydephp/develop/issues/1515 in https://github.com/hydephp/develop/pull/1703 +- Fixed DataCollections file finding method not being able to be overriden https://github.com/hydephp/develop/issues/1716 in https://github.com/hydephp/develop/pull/1717 ### Security - in case of vulnerabilities.