Skip to content

Commit

Permalink
Adding tryNew to all URI related classes which already have a new method
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Dec 21, 2024
1 parent 08cfc6c commit 6a2fb0a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Contracts/UriAccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

use Psr\Http\Message\UriInterface as Psr7UriInterface;

/**
* @method self when(callable|bool $condition, callable $onSuccess, ?callable $onFail = null) conditionally return a new instance
*/
interface UriAccess
{
public function getUri(): UriInterface|Psr7UriInterface;
Expand Down
3 changes: 3 additions & 0 deletions Contracts/UriComponentInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use JsonSerializable;
use Stringable;

/**
* @method static when(callable|bool $condition, callable $onSuccess, ?callable $onFail = null) conditionally return a new instance
*/
interface UriComponentInterface extends JsonSerializable, Stringable
{
/**
Expand Down
1 change: 1 addition & 0 deletions Contracts/UriInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* @method string|null getUsername() returns the user component of the URI.
* @method string|null getPassword() returns the scheme-specific information about how to gain authorization to access the resource.
* @method array toComponents() returns an associative array containing all the URI components.
* @method self when(callable|bool $condition, callable $onSuccess, ?callable $onFail = null) conditionally return a new instance
*/
interface UriInterface extends JsonSerializable, Stringable
{
Expand Down

0 comments on commit 6a2fb0a

Please sign in to comment.