@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | * |
| 65 | 65 | * @example ['twitter' => 'mr_hyde'] ($service => $handle) |
| 66 | 66 | */ |
| 67 | - public readonly ?array $socials; |
|
| 67 | + public readonly ? array $socials; |
|
| 68 | 68 | |
| 69 | 69 | /** |
| 70 | 70 | * Construct a new Post Author instance with the given data. |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | */ |
| 127 | 127 | public function getPosts(): PageCollection |
| 128 | 128 | { |
| 129 | - return MarkdownPost::getLatestPosts()->filter(function (MarkdownPost $post) { |
|
| 129 | + return MarkdownPost::getLatestPosts()->filter(function(MarkdownPost $post) { |
|
| 130 | 130 | return $post->author?->username === $this->username; |
| 131 | 131 | }); |
| 132 | 132 | } |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | if (isset($parentPath)) { |
| 54 | 54 | $parentPaths = explode('/', $parentPath); |
| 55 | - $parentPaths = array_map(function (string $part): string { |
|
| 55 | + $parentPaths = array_map(function(string $part): string { |
|
| 56 | 56 | return static::hasNumericalPrefix($part) ? static::splitNumericPrefix($part)[1] : $part; |
| 57 | 57 | }, $parentPaths); |
| 58 | 58 | $parentPath = implode('/', $parentPaths); |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | */ |
| 67 | 67 | public function getActiveGroup(): ?NavigationGroup |
| 68 | 68 | { |
| 69 | - if ($this->items->isEmpty() || (! $this->hasGroups()) || (! $this->isCollapsible()) || Render::getPage() === null) { |
|
| 69 | + if ($this->items->isEmpty() || (!$this->hasGroups()) || (!$this->isCollapsible()) || Render::getPage() === null) { |
|
| 70 | 70 | return null; |
| 71 | 71 | } |
| 72 | 72 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /** @var ?NavigationGroup $first */ |
| 81 | - $first = $this->items->first(function (NavigationGroup $group) use ($currentPage): bool { |
|
| 81 | + $first = $this->items->first(function(NavigationGroup $group) use ($currentPage): bool { |
|
| 82 | 82 | // A group is active when it contains the current page being rendered. |
| 83 | 83 | return $currentPage->navigationMenuGroup() && $group->getGroupKey() === NavigationGroup::normalizeGroupKey($currentPage->navigationMenuGroup()); |
| 84 | 84 | }); |
@@ -52,7 +52,7 @@ |
||
| 52 | 52 | |
| 53 | 53 | protected function containsOnlyDocumentationPages(): bool |
| 54 | 54 | { |
| 55 | - return count($this->getItems()) && $this->getItems()->every(function (NavigationItem $item): bool { |
|
| 55 | + return count($this->getItems()) && $this->getItems()->every(function(NavigationItem $item): bool { |
|
| 56 | 56 | return $item->getPage() instanceof DocumentationPage; |
| 57 | 57 | }); |
| 58 | 58 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | |
| 67 | 67 | protected function generate(): void |
| 68 | 68 | { |
| 69 | - $this->routes->each(function (Route $route): void { |
|
| 69 | + $this->routes->each(function(Route $route): void { |
|
| 70 | 70 | if ($this->canAddRoute($route)) { |
| 71 | 71 | if ($this->canGroupRoute($route)) { |
| 72 | 72 | $this->addRouteToGroup($route); |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | $this->items->push(NavigationItem::create(DocumentationPage::home())); |
| 83 | 83 | } |
| 84 | 84 | } else { |
| 85 | - collect(Config::getArray('hyde.navigation.custom', []))->each(function (array $data): void { |
|
| 85 | + collect(Config::getArray('hyde.navigation.custom', []))->each(function(array $data): void { |
|
| 86 | 86 | /** @var array{destination: string, label: ?string, priority: ?int, attributes: array<string, scalar>} $data */ |
| 87 | 87 | $message = 'Invalid navigation item configuration detected the configuration file. Please double check the syntax.'; |
| 88 | 88 | $item = InvalidConfigurationException::try(fn () => NavigationItem::create(...$data), $message); |
@@ -107,28 +107,28 @@ discard block |
||
| 107 | 107 | |
| 108 | 108 | protected function canAddRoute(Route $route): bool |
| 109 | 109 | { |
| 110 | - if (! $route->getPage()->showInNavigation()) { |
|
| 110 | + if (!$route->getPage()->showInNavigation()) { |
|
| 111 | 111 | return false; |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | if ($this->generatesSidebar) { |
| 115 | 115 | // Since the index page is linked in the header, we don't want it in the sidebar |
| 116 | - return ! $route->is(DocumentationPage::homeRouteName()); |
|
| 116 | + return !$route->is(DocumentationPage::homeRouteName()); |
|
| 117 | 117 | } else { |
| 118 | 118 | // While we for the most part can rely on the navigation visibility state provided by the navigation data factory, |
| 119 | 119 | // we need to make an exception for documentation pages, which generally have a visible state, as the data is |
| 120 | 120 | // also used in the sidebar. But we only want the documentation index page to be in the main navigation. |
| 121 | - return ! $route->getPage() instanceof DocumentationPage || $route->is(DocumentationPage::homeRouteName()); |
|
| 121 | + return !$route->getPage() instanceof DocumentationPage || $route->is(DocumentationPage::homeRouteName()); |
|
| 122 | 122 | } |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | protected function canGroupRoute(Route $route): bool |
| 126 | 126 | { |
| 127 | - if (! $this->generatesSidebar) { |
|
| 127 | + if (!$this->generatesSidebar) { |
|
| 128 | 128 | return $route->getPage()->navigationMenuGroup() !== null; |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | - if (! $this->usesGroups) { |
|
| 131 | + if (!$this->usesGroups) { |
|
| 132 | 132 | return false; |
| 133 | 133 | } |
| 134 | 134 | |
@@ -146,7 +146,7 @@ discard block |
||
| 146 | 146 | |
| 147 | 147 | $groupItem->add($item); |
| 148 | 148 | |
| 149 | - if (! $this->items->has($groupItem->getGroupKey())) { |
|
| 149 | + if (!$this->items->has($groupItem->getGroupKey())) { |
|
| 150 | 150 | $this->items->put($groupItem->getGroupKey(), $groupItem); |
| 151 | 151 | } |
| 152 | 152 | } |
@@ -42,8 +42,8 @@ |
||
| 42 | 42 | |
| 43 | 43 | protected function run(): void |
| 44 | 44 | { |
| 45 | - DocumentationPage::all()->each(function (DocumentationPage $page): void { |
|
| 46 | - if (! in_array($page->identifier, $this->getPagesToExcludeFromSearch())) { |
|
| 45 | + DocumentationPage::all()->each(function(DocumentationPage $page): void { |
|
| 46 | + if (!in_array($page->identifier, $this->getPagesToExcludeFromSearch())) { |
|
| 47 | 47 | $this->index->push($this->generatePageEntry($page)); |
| 48 | 48 | } |
| 49 | 49 | }); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | $this->skip("No media files to transfer.\n"); |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | - $this->withProgressBar($files, function (MediaFile $file): void { |
|
| 33 | + $this->withProgressBar($files, function(MediaFile $file): void { |
|
| 34 | 34 | $sitePath = $file->getOutputPath(); |
| 35 | 35 | $this->needsParentDirectory($sitePath); |
| 36 | 36 | Filesystem::putContents($sitePath, $file->getContents()); |
@@ -51,7 +51,7 @@ |
||
| 51 | 51 | * |
| 52 | 52 | * @experimental |
| 53 | 53 | */ |
| 54 | - public static function try(callable $callback, ?string $message = null): mixed |
|
| 54 | + public static function try(callable $callback, ?string $message = null) : mixed |
|
| 55 | 55 | { |
| 56 | 56 | try { |
| 57 | 57 | return $callback(); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function __construct(string $file = '', ?Throwable $previous = null) |
| 22 | 22 | { |
| 23 | - parent::__construct($this->formatMessage($file, $previous), previous: $previous); |
|
| 23 | + parent::__construct($this->formatMessage($file, $previous), previous : $previous); |
|
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | protected function formatMessage(string $file, ?Throwable $previous): string |