@@ -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()); |
@@ -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 |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | public const FEATURED_IMAGE_SCHEMA = [ |
| 16 | 16 | 'source' => 'string', // Name of a file in _media/ or a remote URL (required) |
| 17 | 17 | 'altText' => 'string', // The alt text (important for accessibility) |
| 18 | - 'alt' => 'string', // Alternative to altText (simplified schema) |
|
| 18 | + 'alt' => 'string', // Alternative to altText (simplified schema) |
|
| 19 | 19 | 'titleText' => 'string', // The title text (hover tooltip & metadata) |
| 20 | 20 | 'caption' => 'string', // The caption text (simplified schema) |
| 21 | 21 | 'licenseName' => 'string', // The name of the license (e.g. "CC BY 4.0") |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | |
| 36 | 36 | public function render(Node $node, ChildNodeRendererInterface $childRenderer): string |
| 37 | 37 | { |
| 38 | - if (! ($node instanceof Heading)) { |
|
| 38 | + if (!($node instanceof Heading)) { |
|
| 39 | 39 | throw new \InvalidArgumentException('Incompatible node type: '.get_class($node)); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | return config('markdown.permalinks.enabled', true) |
| 59 | 59 | && $level >= config('markdown.permalinks.min_level', 2) |
| 60 | 60 | && $level <= config('markdown.permalinks.max_level', 6) |
| 61 | - && ! str_contains($content, 'class="heading-permalink"') |
|
| 61 | + && !str_contains($content, 'class="heading-permalink"') |
|
| 62 | 62 | && in_array($this->pageClass, config('markdown.permalinks.pages', [DocumentationPage::class])); |
| 63 | 63 | } |
| 64 | 64 | |