Skip to content

Commit

Permalink
Move internal helper classes to new internal support namespace
Browse files Browse the repository at this point in the history
By placing experimental or internal classes within a dedicated namespace like Hyde\Support\Internal, we make it clear to other developers that these classes are not part of the stable public API. It also allows us to organize our codebase more effectively, making it easier to maintain and evolve over time. It also gives us more freedom to create more helper classes like this, without increasing the maintenance burden.
  • Loading branch information
caendesilva committed Apr 25, 2024
1 parent c38b6c2 commit 78e9b0d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 21 deletions.
8 changes: 4 additions & 4 deletions packages/framework/src/Console/Commands/RouteListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

namespace Hyde\Console\Commands;

use Hyde\Console\Concerns\Command;
use Hyde\Hyde;
use Hyde\Pages\InMemoryPage;
use Hyde\Support\Models\Route;
use Hyde\Support\Models\RouteList;
use Hyde\Support\Models\RouteListItem;
use Hyde\Console\Concerns\Command;
use Hyde\Support\Internal\RouteList;
use Hyde\Support\Internal\RouteListItem;

use function file_exists;
use function sprintf;
use function file_exists;

/**
* Display the list of site routes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,20 @@

declare(strict_types=1);

namespace Hyde\Support\Models;
namespace Hyde\Support\Internal;

use Hyde\Hyde;
use Hyde\Support\Models\Route;
use Illuminate\Contracts\Support\Arrayable;

use function array_keys;
use function array_map;
use function collect;
use function str_replace;
use function ucwords;
use function array_map;
use function array_keys;
use function str_replace;

/**
* @internal This class is experimental and is subject to change.
*
* @experimental This class is experimental and is subject to change.
* @internal This class is internal and should not be depended on outside the HydePHP framework code.
*/
class RouteList implements Arrayable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@

declare(strict_types=1);

namespace Hyde\Support\Models;
namespace Hyde\Support\Internal;

use Hyde\Hyde;
use Hyde\Pages\InMemoryPage;
use Hyde\Support\Models\Route;
use Illuminate\Contracts\Support\Arrayable;

use function class_basename;
use function str_starts_with;

/**
* @internal This class is experimental and is subject to change.
*
* @experimental This class is experimental and is subject to change.
* @internal This class is internal and should not be depended on outside the HydePHP framework code.
*/
class RouteListItem implements Arrayable
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
namespace Hyde\Framework\Testing\Feature\Commands;

use Hyde\Hyde;
use Hyde\Testing\TestCase;
use Hyde\Pages\InMemoryPage;
use Hyde\Support\Models\Route;
use Hyde\Testing\TestCase;

/**
* @covers \Hyde\Console\Commands\RouteListCommand
* @covers \Hyde\Support\Models\RouteListItem
* @covers \Hyde\Support\Internal\RouteListItem
*
* @see \Hyde\Framework\Testing\Feature\RouteListTest
*/
Expand Down
8 changes: 4 additions & 4 deletions packages/framework/tests/Feature/RouteListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
namespace Hyde\Framework\Testing\Feature;

use Hyde\Hyde;
use Hyde\Testing\TestCase;
use Hyde\Pages\InMemoryPage;
use Hyde\Support\Models\Route;
use Hyde\Support\Models\RouteList;
use Hyde\Testing\TestCase;
use Hyde\Support\Internal\RouteList;

/**
* @covers \Hyde\Support\Models\RouteList
* @covers \Hyde\Support\Models\RouteListItem
* @covers \Hyde\Support\Internal\RouteList
* @covers \Hyde\Support\Internal\RouteListItem
*/
class RouteListTest extends TestCase
{
Expand Down

0 comments on commit 78e9b0d

Please sign in to comment.