Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependencies/Upgrade #44

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ jobs:
strategy:
matrix:
php-version:
- 7.4
- 8.0
- 8.1

steps:
- name: Checkout source code
Expand Down Expand Up @@ -48,7 +47,7 @@ jobs:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
fail_ci_if_error: true
fail_ci_if_error: false

- name: Static Code analysys
run: composer analyse
run: composer analyse
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "othercode/complex-heart",
"name": "premiervirtual/complex-heart",
"description": "Domain driven design tools.",
"type": "library",
"license": "MIT",
Expand All @@ -11,20 +11,20 @@
],
"minimum-stability": "stable",
"require": {
"php": "^7.4|^8.0",
"php": "^8.1",
"ext-json": "*",
"ramsey/uuid": "^4.1",
"nesbot/carbon": "^2.40",
"illuminate/collections": "^8.20",
"spatie/data-transfer-object": "^2.6",
"ramsey/uuid": "^4.7",
"nesbot/carbon": "^2.71",
"lambdish/phunctional": "^2.1",
"doctrine/instantiator": "^1.4"
"doctrine/instantiator": "^2.0",
"laravel/framework": "^10.33",
"spatie/laravel-data": "^4.5"
},
"require-dev": {
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^9.3",
"fakerphp/faker": "^1.9.1",
"phpstan/phpstan": "^0.12.64"
"mockery/mockery": "^1.6",
"phpunit/phpunit": "^10.0",
"fakerphp/faker": "^v1.23",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
Expand Down
36 changes: 17 additions & 19 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<clover outputFile="./coverage.xml"/>
</report>
</coverage>
<testsuites>
<testsuite name="unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<logging/>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" colors="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd" cacheDirectory=".phpunit.cache">
<coverage>
<report>
<clover outputFile="./coverage.xml"/>
</report>
</coverage>
<testsuites>
<testsuite name="unit">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<logging/>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
7 changes: 4 additions & 3 deletions src/Application/DTO/DTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

namespace OtherCode\ComplexHeart\Application\DTO;

use Spatie\DataTransferObject\DataTransferObject;

use Spatie\LaravelData\Data;

/**
* Class DTO
Expand All @@ -16,7 +17,7 @@
* @author Unay Santisteban <[email protected]>
* @package OtherCode\ComplexHeart\Application\DTO
*/
abstract class DTO extends DataTransferObject
abstract class DTO extends Data
{

}
}
12 changes: 11 additions & 1 deletion src/Domain/Traits/HasInvariants.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ trait HasInvariants
*/
final public static function invariants(): array
{
if (empty(static::$_invariantsCache[static::class])) {
if (array_key_exists(static::class, static::$_invariantsCache) === false) {
$invariants = [];

foreach (get_class_methods(static::class) as $invariant) {
Expand Down Expand Up @@ -91,6 +91,10 @@ final public static function invariants(): array
*/
private function check(callable $filter = null, callable $onFail = null): void
{
if ($this->skipChecking()) {
return;
}

$violations = [];

$invariants = filter(
Expand Down Expand Up @@ -132,4 +136,10 @@ private function check(callable $filter = null, callable $onFail = null): void
$onFail($violations);
}
}

private function skipChecking(): bool
{
$key = 'COMPLEX_HEARTH_SKIP_INVARIANTS_CHECKING';
return (bool)($_ENV[$key] ?? getenv($key));
}
}
1 change: 1 addition & 0 deletions src/Domain/ValueObjects/ArrayValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ public function offsetExists($offset): bool
* @param mixed $offset
* @return mixed|null
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return $this->offsetExists($offset)
Expand Down
Loading