Skip to content

Commit

Permalink
Merge pull request #14 from patchlevel/upgrade-to-stable-version
Browse files Browse the repository at this point in the history
upgrade to stable version
  • Loading branch information
DanielBadura authored Dec 20, 2021
2 parents 85e60b2 + 1193ee8 commit 0d7c913
Show file tree
Hide file tree
Showing 11 changed files with 746 additions and 249 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/coding-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ name: "Check Coding Standard"

on:
pull_request:
branches:
- "master"
push:
branches:
- "master"
- "[0-9]+.[0-9]+.x"

jobs:
static-analysis-coding-standard:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
push:
branches:
- "master"
- "[0-9]+.[0-9]+.x"

jobs:
static-analysis-phpstan:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
push:
branches:
- "master"
- "[0-9]+.[0-9]+.x"

jobs:
phpunit:
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/psalm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ name: "Static Analysis by Psalm"

on:
pull_request:
branches:
- "master"
push:
branches:
- "master"
- "[0-9]+.[0-9]+.x"

jobs:
static-analysis-psalm:
Expand Down
29 changes: 5 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,19 @@ composer require patchlevel/event-sourcing-bundle

## configuration

### Add the event bus to the symfony messenger config:
```
framework:
messenger:
buses:
event.bus:
default_middleware: allow_no_handlers
```

### Set the database connection
```
doctrine:
dbal:
connections:
eventstore:
url: '%env(EVENTSTORE_URL)%'
```

### Define your aggregates with class namespace and the table name

Class `App\Domain\Profile\Profile` is from the [libraries example](https://github.com/patchlevel/event-sourcing#define-aggregates) and is using the table name `profile`

```
patchlevel_event_sourcing:
connection:
url: '%env(EVENTSTORE_URL)%'
store:
dbal_connection: eventstore
type: dbal_multi_table
type: multi_table
aggregates:
profile:
class: App\Domain\Profile\Profile
message_bus: event.bus
```

### Define which repository the aggregates is using
Expand All @@ -57,7 +39,7 @@ services:
...
App\Infrastructure\EventSourcing\Repository\ProfileRepository:
arguments:
$repository: '@event_sourcing.profile_repository'
$repository: '@event_sourcing.repository.profile'
```

### Enable migrations
Expand Down Expand Up @@ -92,8 +74,7 @@ and enter the id from the cache service.
patchlevel_event_sourcing:
snapshot_stores:
default:
type: psr6
id: event_sourcing.cache
service: event_sourcing.cache
```

Finally you have to tell the aggregate that it should use this snapshot store.
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
"php": "^7.4|^8.0",
"ext-json": "^7.4|^8.0",
"doctrine/dbal": "^3.1.4",
"patchlevel/event-sourcing": "1.0.0-rc1",
"patchlevel/event-sourcing": "^1.0.0",
"psr/simple-cache": "^1.0.1",
"symfony/messenger": "^4.4.18|^5.1.10",
"symfony/dependency-injection": "^4.4.18|^5.1.10",
"symfony/http-kernel": "^4.4.18|^5.1.10",
"symfony/config": "^4.4.18|^5.1.10"
"symfony/config": "^4.4.18|^5.1.10",
"symfony/console": "^4.4.18|^5.1.10"
},
"require-dev": {
"ext-pdo_sqlite": "^7.4|^8.0",
Expand Down
Loading

0 comments on commit 0d7c913

Please sign in to comment.