Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use late static bindings to support overriding data collections file finding #1717

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
6 changes: 3 additions & 3 deletions packages/framework/src/Support/DataCollections.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)];
}));
}
Expand All @@ -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()];
}));
}
Expand All @@ -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)];
}));
}
Expand Down
Loading