-
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.
- Loading branch information
Showing
12 changed files
with
186 additions
and
30 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
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,53 @@ | ||
<?php | ||
|
||
/* | ||
* cqrs (https://github.com/phpgears/cqrs). | ||
* CQRS base. | ||
* | ||
* @license MIT | ||
* @link https://github.com/phpgears/cqrs | ||
* @author Julián Gutiérrez <juliangut@gmail.com> | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Gears\CQRS; | ||
|
||
use Gears\DTO\ScalarPayloadBehaviour; | ||
use Gears\Immutability\ImmutabilityBehaviour; | ||
|
||
/** | ||
* Abstract empty immutable serializable query. | ||
*/ | ||
abstract class AbstractEmptyQuery implements Query | ||
{ | ||
use ImmutabilityBehaviour, ScalarPayloadBehaviour { | ||
ScalarPayloadBehaviour::__call insteadof ImmutabilityBehaviour; | ||
} | ||
|
||
/** | ||
* AbstractEmptyQuery constructor. | ||
*/ | ||
final protected function __construct() | ||
{ | ||
$this->assertImmutable(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function getQueryType(): string | ||
{ | ||
return \get_called_class(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
* | ||
* @return string[] | ||
*/ | ||
final protected function getAllowedInterfaces(): array | ||
{ | ||
return [Query::class]; | ||
} | ||
} |
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
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,32 @@ | ||
<?php | ||
|
||
/* | ||
* cqrs (https://github.com/phpgears/cqrs). | ||
* CQRS base. | ||
* | ||
* @license MIT | ||
* @link https://github.com/phpgears/cqrs | ||
* @author Julián Gutiérrez <juliangut@gmail.com> | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Gears\CQRS\Tests\Stub; | ||
|
||
use Gears\CQRS\AbstractEmptyQuery; | ||
|
||
/** | ||
* Abstract empty query stub class. | ||
*/ | ||
class AbstractEmptyQueryStub extends AbstractEmptyQuery | ||
{ | ||
/** | ||
* Instantiate command. | ||
* | ||
* @return self | ||
*/ | ||
public static function instance(): self | ||
{ | ||
return new self(); | ||
} | ||
} |