Skip to content

Commit eab3d3f

Browse files
committed
Merge branch 'refactor-sync'
2 parents bc8039d + 9ad702b commit eab3d3f

File tree

83 files changed

+1990
-1690
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1990
-1690
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"require": {
1717
"php": ">=7.4",
1818
"composer-runtime-api": "^2.2",
19-
"lkrms/dice": "^4.1.9",
19+
"lkrms/dice": "^4.1.10",
2020
"psr/container": "^2",
2121
"psr/event-dispatcher": "^1",
2222
"psr/http-client": "^1",
@@ -36,7 +36,7 @@
3636
"php-http/psr7-integration-tests": "^1.3",
3737
"phpstan/extension-installer": "^1",
3838
"phpstan/phpdoc-parser": "^1",
39-
"phpstan/phpstan": "^1",
39+
"phpstan/phpstan": "^1.11",
4040
"phpstan/phpstan-deprecation-rules": "^1",
4141
"phpstan/phpstan-phpunit": "^1",
4242
"phpunit/phpunit": "^9",

composer.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/Builders.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ $opt = Option::build() // or `$opt = (new OptionBuilder())` if `Option` doesn't
7676
->type(OptionType::VALUE)
7777
->valueType(ValueType::STRING)
7878
->description('Write output to <FILE>')
79-
->go();
79+
->build();
8080
```

docs/Sync.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ performs one or more [sync operations][SyncOperation] on supported [entity
77
classes][SyncEntityInterface] to propagate data to and from a backend.
88

99
For a provider to perform sync operations on entities of a given type, it must
10-
also implement the entity's provider interface. Aside from entities in
11-
namespaces registered with a [class resolver][SyncClassResolverInterface], the
12-
provider interface is assumed to be:
10+
also implement the entity's provider interface, which--aside from entities in
11+
namespaces with a registered [class resolver][SyncClassResolverInterface]--has
12+
the following name:
1313

1414
```
1515
<entity-namespace>\Provider\<entity>Provider
@@ -31,21 +31,21 @@ vendor/bin/sli generate sync provider --magic --op 'get,get-list' 'Acme\Sync\Use
3131

3232
To map entity classes to different provider interfaces (or multiple entities to
3333
one interface, perhaps), you can provide a [SyncClassResolverInterface][] to the
34-
entity store when registering a namespace. See [Sync::namespace()][namespace]
35-
for details and [this test fixture][SyncClassResolver.php] for a working example
36-
that would map `Acme\Sync\Entity\User` to `Acme\Sync\Contract\ProvidesUser`.
34+
entity store when registering a namespace. See [registerNamespace()][] for
35+
details and [this test fixture][SyncClassResolver.php] for a working example
36+
that maps `Acme\Sync\Entity\User` to `Acme\Sync\Contract\ProvidesUser`.
3737

3838
#### Operations
3939

4040
To perform a sync operation on an [entity][SyncEntityInterface], a
4141
[SyncProviderInterface][] must implement its provider interface and either:
4242

4343
1. return a closure for the [SyncOperation][] and entity via
44-
[getDefinition()][getDefinition], or
44+
[getDefinition()][], or
4545
2. declare a method for the operation using the naming convention below.
4646

4747
In either case, the signature for the implemented operation must be as follows.
48-
The first value passed is always the current [SyncContextInterface] and
48+
The first value passed is always the current [SyncContextInterface][] and
4949
**optional** arguments may be accepted after mandatory parameters.
5050

5151
| Operation[^op] | Closure signature | Equivalent method[^1] | Alternative method[^2] |
@@ -59,7 +59,7 @@ The first value passed is always the current [SyncContextInterface] and
5959
| `UPDATE_LIST` | `fn(SyncContextInterface $ctx, iterable $entities, ...$args): iterable` | `update<EntityPlural>` | `updateList_<Entity>` |
6060
| `DELETE_LIST` | `fn(SyncContextInterface $ctx, iterable $entities, ...$args): iterable` | `delete<EntityPlural>` | `deleteList_<Entity>` |
6161

62-
[^op]: See [SyncOperation].
62+
[^op]: See [SyncOperation][].
6363
[^1]:
6464
Method names must match either the singular or plural form of the entity's
6565
unqualified name.
@@ -69,23 +69,23 @@ The first value passed is always the current [SyncContextInterface] and
6969
Method names must match the entity's unqualified name.
7070

7171
[^3]:
72-
See [SyncContextInterface::withFilter()][withFilter] for filter argument
72+
See [SyncContextInterface::withFilter()][] for filter argument
7373
recommendations, including recognised signatures.
7474

75-
[getDefinition]:
75+
[getDefinition()]:
7676
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncProviderInterface.html#_getDefinition
77+
[registerNamespace()]:
78+
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncStoreInterface.html#_registerNamespace
79+
[SyncClassResolver.php]: ../tests/fixtures/Toolkit/Sync/SyncClassResolver.php
80+
[SyncClassResolverInterface]:
81+
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncClassResolverInterface.html
82+
[SyncContextInterface::withFilter()]:
83+
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncContextInterface.html#_withFilter
7784
[SyncContextInterface]:
7885
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncContextInterface.html
7986
[SyncEntityInterface]:
8087
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncEntityInterface.html
81-
[SyncProviderInterface]:
82-
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncProviderInterface.html
83-
[SyncClassResolverInterface]:
84-
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncClassResolverInterface.html
8588
[SyncOperation]:
8689
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncOperation.html
87-
[withFilter]:
88-
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncContextInterface.html#_withFilter
89-
[namespace]:
90-
https://salient-labs.github.io/toolkit/Salient.Sync.SyncStore.html#_namespace
91-
[SyncClassResolver.php]: ../tests/fixtures/Toolkit/Sync/SyncClassResolver.php
90+
[SyncProviderInterface]:
91+
https://salient-labs.github.io/toolkit/Salient.Contract.Sync.SyncProviderInterface.html

0 commit comments

Comments
 (0)