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

Update helper namespaces #395

Merged
merged 9 commits into from
May 18, 2022
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
4 changes: 2 additions & 2 deletions config/hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
|
*/

use Hyde\Framework\Features;
use Hyde\Framework\Meta;
use Hyde\Framework\Helpers\Features;
use Hyde\Framework\Helpers\Meta;

return [

Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/post/article.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<article aria-label="Article" id="{{ Hyde::uriPath() ?? '' }}posts/{{ $page->slug }}" itemscope itemtype="https://schema.org/Article"
@class(['post-article mx-auto prose dark:prose-invert', 'torchlight-enabled' => Hyde\Framework\Features::hasTorchlight()])>
@class(['post-article mx-auto prose dark:prose-invert', 'torchlight-enabled' => Hyde\Framework\Helpers\Features::hasTorchlight()])>
<meta itemprop="identifier" content="{{ $page->slug }}">
@if(Hyde::uriPath())
<meta itemprop="url" content="{{ Hyde::uriPath('posts/' . $page->slug) }}">
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/docs.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</aside>
<main id="content">
<article id="document" itemscope itemtype="https://schema.org/Article" @class(['mx-auto lg:ml-8 prose dark:prose-invert
max-w-3xl', 'torchlight-enabled'=> Hyde\Framework\Features::hasTorchlight()])>
max-w-3xl', 'torchlight-enabled'=> Hyde\Framework\Helpers\Features::hasTorchlight()])>
<section id="document-main-content" itemprop="articleBody">
{!! $markdown !!}
</section>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/layouts/page.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@section('content')

<main id="content" class="mx-auto max-w-7xl py-16 px-8">
<article @class(['mx-auto prose dark:prose-invert', 'torchlight-enabled' => Hyde\Framework\Features::hasTorchlight()])>
<article @class(['mx-auto prose dark:prose-invert', 'torchlight-enabled' => Hyde\Framework\Helpers\Features::hasTorchlight()])>
{!! $markdown !!}
</article>
</main>
Expand Down
2 changes: 1 addition & 1 deletion src/Actions/GeneratesNavigationMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Hyde\Framework\Actions;

use Hyde\Framework\Features;
use Hyde\Framework\Helpers\Features;
use Hyde\Framework\Hyde;
use Hyde\Framework\Services\CollectionService;
use Illuminate\Support\Str;
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/HydeBuildStaticSiteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Hyde\Framework\Actions\CreatesDefaultDirectories;
use Hyde\Framework\Concerns\Internal\BuildActionRunner;
use Hyde\Framework\Concerns\Internal\TransfersMediaAssetsForBuildCommands;
use Hyde\Framework\Features;
use Hyde\Framework\Helpers\Features;
use Hyde\Framework\Hyde;
use Hyde\Framework\Models\BladePage;
use Hyde\Framework\Models\DocumentationPage;
Expand Down
2 changes: 1 addition & 1 deletion src/Concerns/HasPageMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Hyde\Framework\Concerns;

use Hyde\Framework\Helpers\Meta;
use Hyde\Framework\Hyde;
use Hyde\Framework\Meta;
use Hyde\Framework\Models\MarkdownPost;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Concerns/Markdown/HasConfigurableMarkdownFeatures.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Hyde\Framework\Concerns\Markdown;

use Hyde\Framework\Features;
use Hyde\Framework\Markdown;
use Hyde\Framework\Helpers\Features;
use Hyde\Framework\Helpers\Markdown;
use Hyde\Framework\Models\DocumentationPage;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Features.php → src/Helpers/Features.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Hyde\Framework;
namespace Hyde\Framework\Helpers;

/**
* Allows features to be enabled and disabled in a simple object-oriented manner.
Expand Down
2 changes: 1 addition & 1 deletion src/Markdown.php → src/Helpers/Markdown.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Hyde\Framework;
namespace Hyde\Framework\Helpers;

use Hyde\Framework\Concerns\Markdown\HasMarkdownFeatures;

Expand Down
2 changes: 1 addition & 1 deletion src/Meta.php → src/Helpers/Meta.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Hyde\Framework;
namespace Hyde\Framework\Helpers;

/**
* Helpers to fluently declare HTML meta tags.
Expand Down
1 change: 1 addition & 0 deletions src/Hyde.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Hyde\Framework\Concerns\Internal\AssetManager;
use Hyde\Framework\Concerns\Internal\FileHelpers;
use Hyde\Framework\Concerns\Internal\FluentPathHelpers;
use Hyde\Framework\Helpers\Features;
use Hyde\Framework\Models\Parsers\MarkdownPostParser;
use Hyde\Framework\Services\CollectionService;
use Illuminate\Support\Collection;
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/Concerns/HasPageMetadataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Hyde\Framework\Concerns\HasPageMetadata;
use Hyde\Framework\Contracts\AbstractPage;
use Hyde\Framework\Meta;
use Hyde\Framework\Helpers\Meta;
use Tests\TestCase;

/**
Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/ConfigurableFeaturesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Tests\Feature;

use Hyde\Framework\Features;
use Hyde\Framework\Helpers\Features;
use Illuminate\Support\Facades\Config;
use Tests\TestCase;

/**
* @covers \Hyde\Framework\Features
* @covers \Hyde\Framework\Helpers\Features
*/
class ConfigurableFeaturesTest extends TestCase
{
Expand All @@ -30,7 +30,7 @@ public function testHasFeatureReturnsTrueWhenFeatureIsEnabled()
$features = [];
foreach (get_class_methods(Features::class) as $method) {
if (! str_starts_with($method, 'has') && $method !== 'enabled') {
$features[] = '\Hyde\Framework\Features::'.$method.'()';
$features[] = '\Hyde\Framework\Helpers\Features::'.$method.'()';
}
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Feature/DarkmodeFeatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace Tests\Feature;

use Hyde\Framework\Features;
use Hyde\Framework\Helpers\Features;
use Hyde\Framework\Models\MarkdownPage;
use Illuminate\Support\Facades\Config;
use Tests\TestCase;

/**
* @covers \Hyde\Framework\Features::darkmode
* @covers \Hyde\Framework\Features::hasDarkmode
* @covers \Hyde\Framework\Helpers\Features::darkmode
* @covers \Hyde\Framework\Helpers\Features::hasDarkmode
*/
class DarkmodeFeatureTest extends TestCase
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/MetadataHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Tests\Feature;

use Hyde\Framework\Meta;
use Hyde\Framework\Helpers\Meta;
use Tests\TestCase;

/**
* @covers \Hyde\Framework\Meta
* @covers \Hyde\Framework\Helpers\Meta
*/
class MetadataHelperTest extends TestCase
{
Expand Down