-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from young-steveo/update-cabinet-events
Update cabinet events
- Loading branch information
Showing
32 changed files
with
420 additions
and
154 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Arcanum\Cabinet\Event; | ||
|
||
interface CabinetEvent | ||
{ | ||
/** | ||
* Get the service name. | ||
* | ||
* @return class-string | ||
*/ | ||
public function serviceName(): string; | ||
|
||
/** | ||
* Get the service. | ||
* | ||
* Will return null if the service is not yet resolved. | ||
*/ | ||
public function service(): object|null; | ||
} |
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,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Arcanum\Cabinet\Event; | ||
|
||
final class ServiceRequested extends \Arcanum\Echo\Event implements CabinetEvent | ||
{ | ||
/** | ||
* @param class-string $service | ||
*/ | ||
public function __construct(private string $service) | ||
{ | ||
} | ||
|
||
/** | ||
* Get the service name. | ||
* | ||
* @return class-string | ||
*/ | ||
public function serviceName(): string | ||
{ | ||
return $this->service; | ||
} | ||
|
||
/** | ||
* Get the service. | ||
* | ||
* Will return null if the service is not yet resolved. | ||
*/ | ||
public function service(): object|null | ||
{ | ||
return null; | ||
} | ||
} |
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
Oops, something went wrong.