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 Two #563

Merged
merged 7 commits into from
Mar 10, 2023
Prev Previous commit
Next Next commit
Merge pull request #1241 from hydephp/remove-support-for-dot-notation…
…-in-route-key-normalization

Remove RouteKey normalization for dot notation support hydephp/develop@37fb7a0
  • Loading branch information
github-actions committed Mar 8, 2023
commit bcc5f3a81c92b97687d7ea0acce5360179db6697
4 changes: 2 additions & 2 deletions src/Support/Models/RouteKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
namespace Hyde\Support\Models;

use Stringable;
use function str_replace;
use function unslash;

/**
Expand Down Expand Up @@ -44,9 +43,10 @@ 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 str_replace('.', '/', $string);
return $string;
}

/** @param class-string<\Hyde\Pages\Concerns\HydePage> $pageClass */
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/RouteKeyTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@ 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'));
$this->assertSame('foo.bar', RouteKey::normalize('foo.bar'));
}

public function testConstructorValuesAreNormalized()
{
$this->assertEquals(new RouteKey('foo'), new RouteKey('foo'));
$this->assertEquals(new RouteKey('foo/bar'), new RouteKey('foo/bar'));
$this->assertEquals(new RouteKey('foo/bar'), new RouteKey('foo.bar'));
$this->assertEquals(new RouteKey('foo.bar'), new RouteKey('foo.bar'));
}

public function testStaticConstructorValuesAreNormalized()
{
$this->assertEquals(RouteKey::make('foo'), RouteKey::make('foo'));
$this->assertEquals(RouteKey::make('foo/bar'), RouteKey::make('foo/bar'));
$this->assertEquals(RouteKey::make('foo/bar'), RouteKey::make('foo.bar'));
$this->assertEquals(RouteKey::make('foo.bar'), RouteKey::make('foo.bar'));
}

public function testFromPage()
Expand Down