generated from glhd/laravel-package-template
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
371 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
src/Exceptions/ParentParametersCannotBeInferredException.php
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Glhd\Gretel\Exceptions; | ||
|
||
use InvalidArgumentException; | ||
|
||
class UnresolvableParentException extends InvalidArgumentException | ||
{ | ||
public function __construct($value, string $route) | ||
{ | ||
$message = is_string($value) | ||
? "Unable to find parent '{$value}' for route '{$route}'" | ||
: $this->invalidTypeMessage($value, $route); | ||
|
||
parent::__construct($message); | ||
} | ||
|
||
protected function invalidTypeMessage($value, string $route): string | ||
{ | ||
$got = is_object($value) | ||
? get_class($value) | ||
: gettype($value); | ||
|
||
return "Unable to resolve parent for route '{$route}'. Expected a route name or a RouteBreadcrumb object, but got '{$got}' instead."; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace Glhd\Gretel\Support\Facades; | ||
|
||
use Closure; | ||
use Glhd\Gretel\Registry; | ||
use Glhd\Gretel\Routing\RouteBreadcrumb; | ||
use Illuminate\Routing\Route; | ||
use Illuminate\Support\Facades\Facade; | ||
|
||
/** | ||
* @method static Registry handleMissingBreadcrumbs(Closure $callback) | ||
* @method static Registry throwOnMissingBreadcrumbs(bool $throw = true) | ||
* @method static Registry handleMisconfiguredBreadcrumbs(Closure $callback) | ||
* @method static Registry throwOnMisconfiguredBreadcrumbs(bool $throw = true) | ||
* @method static RouteBreadcrumb|null get(Route|string $route) | ||
* @method static RouteBreadcrumb getOrFail(Route|string $route) | ||
*/ | ||
class Gretel extends Facade | ||
{ | ||
protected static function getFacadeAccessor(): string | ||
{ | ||
return Registry::class; | ||
} | ||
} |
Oops, something went wrong.