Skip to content

Commit

Permalink
Use camel case instead of kebab case to match current conventions
Browse files Browse the repository at this point in the history
Update features toArray representation to use camelCase instead of kebab-case to match other arrayable formats, like in the HydeKernel.
  • Loading branch information
caendesilva committed Apr 11, 2024
1 parent 88e9866 commit df37cce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This serves two purposes:

### Changed
- The `features` array in the `config/hyde.php` configuration file is now an array of `Feature` enums in https://github.com/hydephp/develop/pull/1650
- Internal: Updated the `Features::toArray` representation to use `camelCase` instead of `kebab-case` https://github.com/hydephp/develop/pull/1652 (the class is marked as internal, thus the change is not considered breaking)

### Deprecated
- Deprecated the static `Features` flag methods used in the configuration files in https://github.com/hydephp/develop/pull/1650 and will be removed in HydePHP v2.0
Expand Down
2 changes: 1 addition & 1 deletion packages/framework/src/Facades/Features.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public function toArray(): array
return collect(get_class_methods(static::class))
->filter(fn (string $method): bool => str_starts_with($method, 'has'))
->mapWithKeys(fn (string $method): array => [
Str::kebab(substr($method, 3)) => static::{$method}(),
Str::studly(substr($method, 3)) => static::{$method}(),
])->toArray();
}

Expand Down

0 comments on commit df37cce

Please sign in to comment.