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

HydePHP v1.0.0 - Release Candidate Four #565

Merged
merged 10 commits into from
Mar 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Merge pull request #1254 from hydephp/remove-deprecated-code
Remove `RouteKey::normalize` method deprecated in v1.0.0-RC.2 hydephp/develop@10d0144
  • Loading branch information
github-actions committed Mar 12, 2023
commit c138399d35b9f467f89d9e1b1a97bada291cd750
7 changes: 3 additions & 4 deletions src/Foundation/Facades/Routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Hyde\Foundation\Kernel\RouteCollection;
use Hyde\Hyde;
use Hyde\Support\Models\Route;
use Hyde\Support\Models\RouteKey;
use Illuminate\Support\Facades\Facade;

/**
Expand All @@ -28,18 +27,18 @@ public static function getFacadeRoot(): RouteCollection

public static function exists(string $routeKey): bool
{
return static::getFacadeRoot()->has(RouteKey::normalize($routeKey));
return static::getFacadeRoot()->has($routeKey);
}

public static function get(string $routeKey): ?Route
{
return static::getFacadeRoot()->get(RouteKey::normalize($routeKey));
return static::getFacadeRoot()->get($routeKey);
}

/** @throws \Hyde\Framework\Exceptions\RouteNotFoundException */
public static function getOrFail(string $routeKey): Route
{
return static::getFacadeRoot()->getRoute(RouteKey::normalize($routeKey));
return static::getFacadeRoot()->getRoute($routeKey);
}

/** @return \Hyde\Foundation\Kernel\RouteCollection<\Hyde\Support\Models\Route> */
Expand Down
8 changes: 1 addition & 7 deletions src/Support/Models/RouteKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static function make(string $key): self

public function __construct(string $key)
{
$this->key = self::normalize($key);
$this->key = $key;
}

public function __toString(): string
Expand All @@ -43,12 +43,6 @@ public function get(): string
return $this->key;
}

/** @deprecated v1.0.0-RC.2 - This method will be removed before v1.0.0 */
public static function normalize(string $string): string
{
return $string;
}

/** @param class-string<\Hyde\Pages\Concerns\HydePage> $pageClass */
public static function fromPage(string $pageClass, string $identifier): self
{
Expand Down
7 changes: 0 additions & 7 deletions tests/Unit/RouteKeyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@ public function testCast()
$this->assertSame('foo', (string) new RouteKey('foo'));
}

public function testNormalize()
{
$this->assertSame('foo', RouteKey::normalize('foo'));
$this->assertSame('foo/bar', RouteKey::normalize('foo/bar'));
$this->assertSame('foo.bar', RouteKey::normalize('foo.bar'));
}

public function testConstructorValuesAreNormalized()
{
$this->assertEquals(new RouteKey('foo'), new RouteKey('foo'));
Expand Down