Skip to content

Commit

Permalink
General Updates and Refactoring (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaEstes authored Oct 21, 2023
0 parents commit fdb4188
Show file tree
Hide file tree
Showing 11 changed files with 178 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/Tests export-ignore
/phpunit.xml.dist export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
composer.lock
phpunit.xml
vendor/
12 changes: 12 additions & 0 deletions Command/CommandMessageHandlerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SonsOfPHP\Component\Cqrs\Command;

use SonsOfPHP\Component\Cqrs\MessageHandlerInterface;

/**
* @author Joshua Estes <joshua@sonsofphp.com>
*/
interface CommandMessageHandlerInterface extends MessageHandlerInterface {}
12 changes: 12 additions & 0 deletions Command/CommandMessageInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SonsOfPHP\Component\Cqrs\Command;

use SonsOfPHP\Component\Cqrs\MessageInterface;

/**
* @author Joshua Estes <joshua@sonsofphp.com>
*/
interface CommandMessageInterface extends MessageInterface {}
19 changes: 19 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright 2022 Joshua Estes

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
10 changes: 10 additions & 0 deletions MessageHandlerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace SonsOfPHP\Component\Cqrs;

/**
* @author Joshua Estes <joshua@sonsofphp.com>
*/
interface MessageHandlerInterface {}
12 changes: 12 additions & 0 deletions MessageInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SonsOfPHP\Component\Cqrs;

/**
* Both Command and Queries implement this.
*
* @author Joshua Estes <joshua@sonsofphp.com>
*/
interface MessageInterface {}
12 changes: 12 additions & 0 deletions Query/QueryMessageHandlerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SonsOfPHP\Component\Cqrs\Query;

use SonsOfPHP\Component\Cqrs\MessageHandlerInterface;

/**
* @author Joshua Estes <joshua@sonsofphp.com>
*/
interface QueryMessageHandlerInterface extends MessageHandlerInterface {}
12 changes: 12 additions & 0 deletions Query/QueryMessageInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

declare(strict_types=1);

namespace SonsOfPHP\Component\Cqrs\Query;

use SonsOfPHP\Component\Cqrs\MessageInterface;

/**
* @author Joshua Estes <joshua@sonsofphp.com>
*/
interface QueryMessageInterface extends MessageInterface {}
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Sons of PHP - CQRS
==================

Helps you to implement the Command and Query Responsibility Segregation pattern.

## Learn More

* [Documentation][docs]
* [Contributing][contributing]
* [Report Issues][issues] and [Submit Pull Requests][pull-requests] in the
[Mother Repository][mother-repo]
* Get Help & Support using [Discussions][discussions] or [Discord][discord]

[discussions]: https://github.com/orgs/SonsOfPHP/discussions
[mother-repo]: https://github.com/SonsOfPHP/sonsofphp
[contributing]: https://docs.sonsofphp.com/contributing/
[docs]: https://docs.sonsofphp.com/components/cqrs/
[issues]: https://github.com/SonsOfPHP/sonsofphp/issues?q=is%3Aopen+is%3Aissue+label%3ACQRS
[pull-requests]: https://github.com/SonsOfPHP/sonsofphp/pulls?q=is%3Aopen+is%3Apr+label%3ACQRS
[discord]: https://discord.gg/sdVxNhFqND
62 changes: 62 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"name": "sonsofphp/cqrs",
"type": "library",
"description": "CQRS Component",
"keywords": [
"cqrs",
"symfony",
"command",
"query",
"event sourcing"
],
"homepage": "https://github.com/SonsOfPHP/cqrs",
"license": "MIT",
"authors": [
{
"name": "Joshua Estes",
"email": "joshua@sonsofphp.com"
}
],
"support": {
"issues": "https://github.com/SonsOfPHP/sonsofphp/issues",
"forum": "https://github.com/orgs/SonsOfPHP/discussions",
"docs": "https://docs.sonsofphp.com",
"chat": "https://discord.gg/sdVxNhFqND"
},
"autoload": {
"psr-4": {
"SonsOfPHP\\Component\\Cqrs\\": ""
},
"exclude-from-classmap": [
"/Tests/"
]
},
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": ">=8.1"
},
"require-dev": {
"symfony/messenger": "^5|^6"
},
"suggest": {
"sonsofphp/event-sourcing": "Use with event sourcing",
"sonsofphp/cqrs-symfony": "Adds more functionality to the CQRS Component"
},
"extra": {
"sort-packages": true,
"branch-alias": {
"dev-main": "0.3.x-dev"
}
},
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/JoshuaEstes"
},
{
"type": "tidelift",
"url": "https://tidelift.com/subscription/pkg/packagist-sonsofphp-sonsofphp"
}
]
}

0 comments on commit fdb4188

Please sign in to comment.