Skip to content

Commit da9bd59

Browse files
authored
Merge pull request #1220 from hydephp/normalize-static-constructor-naming
Refactor codebase to use consistent naming formats and scoped consistent public API
2 parents 32a4a2f + f61d9a9 commit da9bd59

File tree

72 files changed

+524
-426
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+524
-426
lines changed

_ide_helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ class Meta extends \Hyde\Facades\Meta {}
3131
/** @mixin \Hyde\Framework\Services\AssetService */
3232
class Asset extends \Hyde\Facades\Asset {}
3333
class Author extends \Hyde\Facades\Author {}
34-
class Includes extends \Hyde\Facades\Includes {}
3534
class Features extends \Hyde\Facades\Features {}
3635
class Config extends \Hyde\Facades\Config {}
3736
/** @mixin \Illuminate\Filesystem\Filesystem */
3837
class Filesystem extends \Hyde\Facades\Filesystem {}
3938
class DataCollections extends \Hyde\Support\DataCollections {}
39+
class Includes extends \Hyde\Support\Includes {}
4040
/** @mixin \Hyde\Foundation\Kernel\RouteCollection */
4141
class Routes extends \Hyde\Foundation\Facades\Routes {}
4242

app/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@
9393
'Meta' => \Hyde\Facades\Meta::class,
9494
'Asset' => \Hyde\Facades\Asset::class,
9595
'Author' => \Hyde\Facades\Author::class,
96-
'Includes' => \Hyde\Facades\Includes::class,
9796
'Features' => \Hyde\Facades\Features::class,
9897
'Config' => \Hyde\Facades\Config::class,
9998
'Filesystem' => \Hyde\Facades\Filesystem::class,
@@ -104,6 +103,7 @@
104103
'MarkdownPost' => \Hyde\Pages\MarkdownPost::class,
105104
'DocumentationPage' => \Hyde\Pages\DocumentationPage::class,
106105
'DataCollections' => \Hyde\Support\DataCollections::class,
106+
'Includes' => \Hyde\Support\Includes::class,
107107
],
108108

109109
];

docs/digging-deeper/customization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ There are two ways to customize the footer text. First, you can set it in the co
136136
If you don't want to write Markdown in the configuration file, you can create a Markdown file in your includes directory. When this file is found, it will be used instead of the configuration setting.
137137

138138
```markdown
139-
// filepath: resources/_includes/footer.md
139+
// filepath: resources/includes/footer.md
140140
Site proudly built with [HydePHP](https://github.com/hydephp/hyde) 🎩
141141
```
142142

monorepo/file_seeder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
error_reporting(E_ALL);
66
$time = microtime(true);
77

8-
// Generate some file fixtures for quick visual testing.
8+
// @internal Generate some file fixtures for quick visual testing.
99

1010
use Hyde\Framework\Actions\CreatesNewPageSourceFile;
1111
use Hyde\Pages\BladePage;

packages/framework/resources/views/layouts/docs.blade.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,14 @@
44
@include('hyde::layouts.head')
55
</head>
66
<body id="hyde-docs" class="bg-white dark:bg-gray-900 dark:text-white min-h-screen w-screen relative overflow-x-hidden overflow-y-auto"
7-
x-data="{ sidebarOpen: false, searchWindowOpen: false }"
8-
x-on:keydown.escape="searchWindowOpen = false; sidebarOpen = false" x-on:keydown.slash="searchWindowOpen = true">
7+
x-data="{ sidebarOpen: false, searchWindowOpen: false }" x-on:keydown.escape="searchWindowOpen = false; sidebarOpen = false" x-on:keydown.slash="searchWindowOpen = true">
98

109
@include('hyde::components.skip-to-content-button')
11-
1210
@include('hyde::components.docs.mobile-navigation')
1311
@include('hyde::components.docs.sidebar')
1412

1513
<main id="content" class="dark:bg-gray-900 min-h-screen bg-gray-50 md:bg-white absolute top-16 md:top-0 w-screen md:left-64 md:w-[calc(100vw_-_16rem)]">
16-
<x-hyde::docs.documentation-article
17-
:document="\Hyde\Framework\Features\Documentation\SemanticDocumentationArticle::create($page)"/>
14+
<x-hyde::docs.documentation-article :document="\Hyde\Framework\Features\Documentation\SemanticDocumentationArticle::make($page)"/>
1815
</main>
1916

2017
<div id="support">

packages/framework/resources/views/layouts/footer.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@if(config('hyde.footer') !== false)
22
<footer aria-label="Page footer" class="flex py-4 px-6 w-full text-center mt-auto bg-slate-100 dark:bg-gray-800">
33
<div class="prose dark:prose-invert text-center mx-auto">
4-
{!! \Hyde\Facades\Includes::markdown('footer',
4+
{!! \Hyde\Support\Includes::markdown('footer',
55
config('hyde.footer', 'Site proudly built with [HydePHP](https://github.com/hydephp/hyde) 🎩')) !!}
66
</div>
77
<a href="#app" aria-label="Go to top of page" class="float-right">

packages/framework/resources/views/layouts/navigation.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
@foreach ($navigation->items as $item)
3737
<li class="md:mx-2">
3838
@if($item instanceof \Hyde\Framework\Features\Navigation\DropdownNavItem)
39-
<x-hyde::navigation.dropdown :label="\Hyde\Hyde::makeTitle($item->name)" :items="$item->items"/>
39+
<x-hyde::navigation.dropdown :label="\Hyde\Hyde::makeTitle($item->label)" :items="$item->items"/>
4040
@else
4141
@include('hyde::components.navigation.navigation-link')
4242
@endif

packages/framework/src/Console/Commands/MakePageCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function handle(): int
6363

6464
$creator = new CreatesNewPageSourceFile($this->title, $this->pageClass, $this->force);
6565

66-
$this->info("Created file {$creator->getOutputPath()}");
66+
$this->info("Created file {$creator->save()}");
6767

6868
return Command::SUCCESS;
6969
}

packages/framework/src/Console/Commands/RebuildPageCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function handle(): void
7171
{
7272
$this->validate();
7373

74-
(new StaticPageBuilder(Pages::getPage($this->path)))->__invoke();
74+
StaticPageBuilder::handle(Pages::getPage($this->path));
7575
}
7676

7777
public function printFinishMessage(): void

packages/framework/src/Console/Concerns/Command.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ public function handleException(Exception $exception): int
8282
* Note that not all terminals support this, and it may lead to only
8383
* the label being shown, and the path being lost to the void.
8484
*/
85-
public static function fileLink(string $filepath, string $label = null): string
85+
public static function fileLink(string $path, string $label = null): string
8686
{
87-
$link = 'file://'.str_replace('\\', '/', realpath($filepath) ?: Hyde::path($filepath));
87+
$link = 'file://'.str_replace('\\', '/', realpath($path) ?: Hyde::path($path));
8888

8989
return $label ? "<href=$link>$label</>" : $link;
9090
}

0 commit comments

Comments
 (0)