Skip to content

Commit

Permalink
feat: Update of dependencies and Code standard
Browse files Browse the repository at this point in the history
  • Loading branch information
zoilomora committed Jul 28, 2020
1 parent 15f3051 commit f39ea23
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 34 deletions.
42 changes: 21 additions & 21 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "pccomponentes/simple-state-machine",
"description": "Simple State Machine",
"license": "MIT",
"type": "library",
"authors": [
{
"name": "Zoilo Mora",
"email": "[email protected]"
"name": "pccomponentes/simple-state-machine",
"description": "Simple State Machine",
"license": "MIT",
"type": "library",
"authors": [
{
"name": "Zoilo Mora",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"PcComponentes\\SimpleStateMachine\\": "src/"
}
},
"require": {
"php": "^7.4",
"pccomponentes/ddd": "^2.0"
},
"require-dev": {
"pccomponentes/coding-standard": "^1.1"
}
],
"autoload": {
"psr-4": {
"PcComponentes\\SimpleStateMachine\\": "src/"
}
},
"require": {
"php": "^7.4",
"pccomponentes/ddd": "^1.2"
},
"require-dev": {
"pccomponentes/coding-standard": "^1.0"
}
}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ services:
build: .
volumes:
- .:/var/app
- ~/.composer:/.composer
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" ?>
<ruleset name="Project rules">
<file>src</file>
<rule ref="vendor/pccomponentes/coding-standard/PccomponentesCodingStandard/ruleset.xml" />
<rule ref="vendor/pccomponentes/coding-standard/src/ruleset.xml" />
</ruleset>
10 changes: 3 additions & 7 deletions src/StatusChangeNotAllowedException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@

namespace PcComponentes\SimpleStateMachine;

use Pccomponentes\Ddd\Domain\Model\ValueObject\StringValueObject;
use Pccomponentes\Ddd\Domain\Model\ValueObject\Uuid;
use PcComponentes\Ddd\Domain\Model\ValueObject\StringValueObject;
use PcComponentes\Ddd\Domain\Model\ValueObject\Uuid;

interface StatusChangeNotAllowedException
{
public static function from(
Uuid $id,
StringValueObject $currentStatus,
StringValueObject $newStatus
): self;
public static function from(Uuid $id, StringValueObject $currentStatus, StringValueObject $newStatus): self;
}
11 changes: 6 additions & 5 deletions src/StatusMachine.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

namespace PcComponentes\SimpleStateMachine;

use Pccomponentes\Ddd\Domain\Model\ValueObject\StringValueObject;
use Pccomponentes\Ddd\Domain\Model\ValueObject\Uuid;
use PcComponentes\Ddd\Domain\Model\ValueObject\StringValueObject;
use PcComponentes\Ddd\Domain\Model\ValueObject\Uuid;

trait StatusMachine
{
Expand Down Expand Up @@ -32,7 +32,8 @@ private function canChangeStatus(StringValueObject $status): bool
{
return \in_array(
$status->value(),
$this->currentAllowedStatusChanges()
$this->currentAllowedStatusChanges(),
true,
);
}

Expand All @@ -52,8 +53,8 @@ private function assertValidClassException(string $class): void
\sprintf(
'The %s class does not implement the %s interface',
$class,
StatusChangeNotAllowedException::class
)
StatusChangeNotAllowedException::class,
),
);
}
}
Expand Down

0 comments on commit f39ea23

Please sign in to comment.