Skip to content

Commit

Permalink
refactor(architecture): separates projects in modules
Browse files Browse the repository at this point in the history
  • Loading branch information
matiux committed Oct 20, 2021
1 parent c17f267 commit 41b6927
Show file tree
Hide file tree
Showing 161 changed files with 454 additions and 502 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/check-dependencies.yml
@@ -0,0 +1,27 @@
name: "Check dependencies"

on: ["pull_request", "push"]

jobs:
check-dependencies:
name: "Check dependencies"
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
26 changes: 26 additions & 0 deletions .github/workflows/static-analysis.yml
@@ -0,0 +1,26 @@
name: "Static analysis"

on: ["pull_request", "push"]

jobs:
static-analysis:
name: "static analysis"
runs-on: ubuntu-latest

steps:
- name: "checkout"
uses: "actions/checkout@v2"

- name: "installing PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.0"
ini-values: memory_limit=-1
tools: composer:v2, cs2pr
extensions: bcmath, mbstring, intl, sodium, json

- name: "installing dependencies"
run: "composer update --no-interaction --no-progress"

- name: "running static analysis ( psalm )"
run: "vendor/bin/psalm --output-format=github --shepherd --stats"
2 changes: 2 additions & 0 deletions composer.json
Expand Up @@ -46,6 +46,8 @@
},
"autoload-dev": {
"psr-4": {
"Tests\\Unit\\DDDStarterPack\\": "tests/Unit/DDDStarterPack/",
"Tests\\Integration\\DDDStarterPack\\": "tests/Integration/DDDStarterPack/",
"Tests\\DDDStarterPack\\": "tests/DDDStarterPack/",
"Tests\\Learning\\": "tests/Learning/",
"Tests\\Support\\": "tests/Support/",
Expand Down
Empty file added doc/aggregate.md
Empty file.
Empty file added doc/command.md
Empty file.
Empty file added doc/data_transformer.md
Empty file.
Empty file added doc/event.md
Empty file.
Empty file added doc/excpetion.md
Empty file.
Empty file added doc/message.md
Empty file.
Empty file added doc/service.md
Empty file.
Empty file added doc/util.md
Empty file.
2 changes: 1 addition & 1 deletion psalm.xml
Expand Up @@ -12,7 +12,7 @@
<directory name="tests"/>
<ignoreFiles>
<directory name="vendor"/>
<directory name="src/Matiux/DDDStarterPack/Infrastructure/Application/Message/RabbitMQ"/>
<directory name="src/Matiux/DDDStarterPack/Message/Infrastructure/RabbitMQ"/>
</ignoreFiles>
</projectFiles>
<plugins>
Expand Down
19 changes: 15 additions & 4 deletions readme.md
@@ -1,6 +1,12 @@
DDD Starter Pack
=====

![check dependencies](https://github.com/matiux/ddd-starter-pack/actions/workflows/check-dependencies.yml/badge.svg)
![test](https://github.com/matiux/ddd-starter-pack/actions/workflows/test.yml/badge.svg)
[![codecov](https://codecov.io/gh/matiux/ddd-starter-pack/branch/develop/graph/badge.svg)](https://codecov.io/gh/matiux/ddd-starter-pack)
[![type coverage](https://shepherd.dev/github/matiux/ddd-starter-pack/coverage.svg)](https://shepherd.dev/github/matiux/ddd-starter-pack)
[![psalm level](https://shepherd.dev/github/matiux/ddd-starter-pack/level.svg)](https://shepherd.dev/github/matiux/ddd-starter-pack)

Questa libreria contiene "concetti" per lo sviluppo di micro servizi basati su architettura esagonale e DDD.

* Ramo v2: PHP < 8.0
Expand All @@ -24,11 +30,16 @@ composer install
## test
Eseguire l'alias `test`

#### Concetti sviluppati
#### Moduli

* [Domain](doc/domain.md)
* [Application](doc/application.md)
* [Infrastructure](doc/infrastructure.md)
* [Aggregate](doc/aggregate.md)
* [Command](doc/command.md)
* [Data transformer](doc/data_transformer.md)
* [Event](doc/event.md)
* [Exception](doc/excpetion.md)
* [Message](doc/message.md)
* [Service](doc/service.md)
* [Util](doc/util.md)

#### TODO
* Prendere spunto da questi progetti per la gestione degli eventi nei modelli di dominio
Expand Down
4 changes: 1 addition & 3 deletions scripts/git-hooks/pre-commit-functions.sh
Expand Up @@ -32,7 +32,6 @@ check_psalm() {

if [[ "$STATUS" -eq 0 ]]; then
echo -e "\e[42mPHP Static Analysis is OK\e[m"
./dc badge "static analysis" passed psalm
return 0 # true
fi

Expand All @@ -50,12 +49,11 @@ check_psalm() {
check_phpunit() {

# Esecuzione dei tests con phpunit
./dc phpunit --testdox --exclude-group learning -vvv
./dc phpunit --testdox --colors=always --exclude-group learning -vvv
STATUS=$?

if [[ "$STATUS" -eq 0 ]]; then
echo -e "\e[42mPHP Unit Tests Suite is OK\e[m"
./dc badge test passed phpunit
return 0 # true
fi

Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate;
namespace DDDStarterPack\Aggregate\Domain;

use Exception;
use InvalidArgumentException;
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate;
namespace DDDStarterPack\Aggregate\Domain;

use Countable;
use Iterator;
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate;
namespace DDDStarterPack\Aggregate\Domain;

interface EntityId
{
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate;
namespace DDDStarterPack\Aggregate\Domain;

/**
* @template T of BasicEntityId
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate;
namespace DDDStarterPack\Aggregate\Domain;

use DateTimeImmutable;

Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate;
namespace DDDStarterPack\Aggregate\Domain;

use DateTime;

Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate\Repository\Filter;
namespace DDDStarterPack\Aggregate\Domain\Repository\Filter;

use InvalidArgumentException;

Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate\Repository\Filter;
namespace DDDStarterPack\Aggregate\Domain\Repository\Filter;

/**
* @template T
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate\Repository\Filter;
namespace DDDStarterPack\Aggregate\Domain\Repository\Filter;

use InvalidArgumentException;
use LogicException;
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate\Repository\Filter;
namespace DDDStarterPack\Aggregate\Domain\Repository\Filter;

interface PaginationFilterParamsApplierKeys
{
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate\Repository\Filter;
namespace DDDStarterPack\Aggregate\Domain\Repository\Filter;

interface SortingFilterParamsApplierKeys
{
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate\Repository;
namespace DDDStarterPack\Aggregate\Domain\Repository;

/**
* @template E
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate\Repository\Paginator;
namespace DDDStarterPack\Aggregate\Domain\Repository\Paginator;

use ArrayIterator;
use ArrayObject;
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Aggregate\Repository\Paginator;
namespace DDDStarterPack\Aggregate\Domain\Repository\Paginator;

use Countable;
use Iterator;
Expand Down
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace DDDStarterPack\Infrastructure\Domain\Aggregate\Doctrine;
namespace DDDStarterPack\Aggregate\Infrastructure\Doctrine;

use DDDStarterPack\Domain\Aggregate\BasicEntityId;
use DDDStarterPack\Domain\Aggregate\EntityId;
use DDDStarterPack\Aggregate\Domain\BasicEntityId;
use DDDStarterPack\Aggregate\Domain\EntityId;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Types\GuidType;

Expand Down
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace DDDStarterPack\Infrastructure\Domain\Aggregate\Doctrine\Repository;
namespace DDDStarterPack\Aggregate\Infrastructure\Doctrine\Repository;

use DDDStarterPack\Domain\Aggregate\Repository\Filter\FilterParams;
use DDDStarterPack\Domain\Aggregate\Repository\Paginator\Paginator;
use DDDStarterPack\Aggregate\Domain\Repository\Filter\FilterParams;
use DDDStarterPack\Aggregate\Domain\Repository\Paginator\Paginator;
use Doctrine\ORM\QueryBuilder;
use Webmozart\Assert\Assert;

Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Infrastructure\Domain\Aggregate\Doctrine\Repository;
namespace DDDStarterPack\Aggregate\Infrastructure\Doctrine\Repository;

use Doctrine\ORM\QueryBuilder;
use Webmozart\Assert\Assert;
Expand Down
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Infrastructure\Domain\Aggregate\Doctrine\Repository;
namespace DDDStarterPack\Aggregate\Infrastructure\Doctrine\Repository;

use Doctrine\Bundle\DoctrineBundle\Registry;
use Doctrine\ORM\EntityManagerInterface;
Expand Down
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace DDDStarterPack\Infrastructure\Domain\Aggregate\Doctrine\Repository\Filter;
namespace DDDStarterPack\Aggregate\Infrastructure\Doctrine\Repository\Filter;

use DDDStarterPack\Domain\Aggregate\Repository\Filter\FilterParams;
use DDDStarterPack\Domain\Aggregate\Repository\Filter\FilterParamsApplier;
use DDDStarterPack\Aggregate\Domain\Repository\Filter\FilterParams;
use DDDStarterPack\Aggregate\Domain\Repository\Filter\FilterParamsApplier;
use Doctrine\ORM\QueryBuilder;

/**
Expand Down
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace DDDStarterPack\Infrastructure\Domain\Aggregate\Doctrine\Repository\Filter;
namespace DDDStarterPack\Aggregate\Infrastructure\Doctrine\Repository\Filter;

use DDDStarterPack\Domain\Aggregate\Repository\Filter\FilterParams;
use DDDStarterPack\Aggregate\Domain\Repository\Filter\FilterParams;
use Doctrine\ORM\QueryBuilder;

abstract class DoctrineGenericPaginationApplier extends DoctrineFilterParamsApplier
Expand Down
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace DDDStarterPack\Infrastructure\Domain\Aggregate\Doctrine\Repository\Filter;
namespace DDDStarterPack\Aggregate\Infrastructure\Doctrine\Repository\Filter;

use DDDStarterPack\Domain\Aggregate\Repository\Filter\FilterParams;
use DDDStarterPack\Aggregate\Domain\Repository\Filter\FilterParams;
use Doctrine\ORM\QueryBuilder;
use LogicException;

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace DDDStarterPack\Domain\Command;
namespace DDDStarterPack\Command;

use DateTimeImmutable;

Expand Down
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace DDDStarterPack\Application\DataTransformer;
namespace DDDStarterPack\DataTransformer\Application;

use DDDStarterPack\Application\DataTransformer\Type\CollectionDataTransformer;
use DDDStarterPack\Application\DataTransformer\Type\DataTransformer;
use DDDStarterPack\DataTransformer\Application\Type\CollectionDataTransformer;
use DDDStarterPack\DataTransformer\Application\Type\DataTransformer;

/**
* @template I
Expand Down

0 comments on commit 41b6927

Please sign in to comment.