Skip to content

Commit fe00e4c

Browse files
committed
underline code links in docs
1 parent 785adfd commit fe00e4c

11 files changed

Lines changed: 80 additions & 43 deletions

File tree

‎docs/ddd/collections.md‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# Collections
22

3-
A domain collection is a [traversable](https://secure.php.net/manual/en/class.traversable.php) and bound to
4-
`MsgPhp\Domain\DomainCollectionInterface`. Its purpose is to utilize a primitive iterable value. It may hold any type of
5-
element values.
3+
A domain collection is a [traversable] and bound to `MsgPhp\Domain\DomainCollectionInterface`. Its purpose is to utilize
4+
a primitive iterable value. It may hold any type of element values.
65

76
## API
87

98
### Extends
109

11-
- [`\Countable`](https://secure.php.net/manual/en/class.countable.php)
12-
- [`\IteratorAggregate`](https://secure.php.net/manual/en/class.iteratoraggregate.php)
10+
- [`\Countable`][countable]
11+
- [`\IteratorAggregate`][iterator-aggregate]
1312

1413
---
1514

@@ -128,3 +127,7 @@ $firstTwoIntsPlussed = $firstTwoInts->map(function (int $value): int {
128127
Domain collection based on _Doctrine Collections_.
129128

130129
- [Read more](../infrastructure/doctrine-collections.md#domain-collection)
130+
131+
[traversable]: https://secure.php.net/traversable
132+
[countable]: https://secure.php.net/countable
133+
[iterator-aggregate]: https://secure.php.net/iteratoraggregate

‎docs/ddd/entities.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# Entities
22

3-
Entity objects are provided per domain layer and usually follow a [POPO](https://stackoverflow.com/questions/41188002/what-does-the-term-plain-old-php-object-popo-exactly-mean)
4-
design.
3+
Entity objects are provided per domain layer and usually follow a [POPO] design.
54

6-
To simplify entity definitions common fields and features are provided in the form of PHP [traits](https://secure.php.net/manual/en/language.oop5.traits.php).
7-
Entity fields can be compared to a read-operation, whereas entity features represent a write-operation.
5+
To simplify entity definitions common fields and features are provided in the form of PHP [traits]. Entity fields can be
6+
compared to a read-operation, whereas entity features represent a write-operation.
87

98
They are defined in a dedicated namespace for discovery, respectively `Msgphp\Domain\Entity\Fields\` and
109
`MsgPhp\Domain\Entity\Features\`. Additionally more specific fields and features can be provided per domain layer.
@@ -51,3 +50,6 @@ Provides ability to toggle an entity its availability state.
5150
- Sets `$enabled` to `true`
5251
- `disable(): void`
5352
- Sets `$enabled` to `false`
53+
54+
[POPO]: https://stackoverflow.com/questions/41188002/what-does-the-term-plain-old-php-object-popo-exactly-mean
55+
[traits]: https://secure.php.net/traits

‎docs/ddd/identifiers.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Identifiers
22

3-
A domain identifier is a [string-ish](https://secure.php.net/manual/en/language.oop5.magic.php#object.tostring) value
4-
object and bound to `MsgPhp\Domain\DomainIdInterface`. Its purpose is to utilize a primitive identifier value.
3+
A domain identifier is a [string-able] value object and bound to `MsgPhp\Domain\DomainIdInterface`. Its purpose is to
4+
utilize a primitive identifier value.
55

66
## API
77

88
### Extends
99

10-
- [`\Serializable`](https://secure.php.net/manual/en/class.serializable.php)
11-
- [`\JsonSerializable`](https://secure.php.net/manual/en/class.jsonserializable.php)
10+
- [`\Serializable`][serializable]
11+
- [`\JsonSerializable`][json-serializable]
1212

1313
---
1414

@@ -83,3 +83,7 @@ $emptyId->isEmpty() ? null : $emptyId->toString(); // null
8383
Domain identifier based on UUID values.
8484

8585
- [Read more](../infrastructure/uuid.md)
86+
87+
[string-able]: https://secure.php.net/manual/en/language.oop5.magic.php#object.tostring
88+
[serializable]: https://secure.php.net/serializable
89+
[json-serializable]: https://secure.php.net/jsonserializable

‎docs/ddd/repositories.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ Repository trait based on in-memory persistence.
6363
- `__construct(string $class, DomainIdentityHelper $identityHelper, GlobalObjectMemory $memory = null, ObjectFieldAccessor $accessor = null)`
6464
- `$class`: The entity class this repository is tied to
6565
- `$identityHelper`: The domain identity helper. [Read more](identities.md).
66-
- `$memory`: Custom memory layer. By default the same global pool is used. See also [GlobalObjectMemory](https://msgphp.github.io/api/MsgPhp/Domain/Infra/InMemory/GlobalObjectMemory.html).
67-
- `$accessor`: Custom object field accessor. See also [GlobalObjectMemory](https://msgphp.github.io/api/MsgPhp/Domain/Infra/InMemory/ObjectFieldAccessor.html).
66+
- `$memory`: Custom memory layer. By default the same global pool is used. See also [`GlobalObjectMemory`][api-globalobjectmemory].
67+
- `$accessor`: Custom object field accessor. See also [`ObjectFieldAccessor`][api-objectfieldaccessor].
6868

6969
#### Basic example
7070

@@ -113,3 +113,6 @@ if ($repository->exists(1)) {
113113
Repository trait based on _Doctrine ORM_ persistence.
114114

115115
- [Read more](../infrastructure/doctrine-orm.md#domain-repository)
116+
117+
[api-globalobjectmemory]: https://msgphp.github.io/api/MsgPhp/Domain/Infra/InMemory/GlobalObjectMemory.html
118+
[api-objectfieldaccessor]: https://msgphp.github.io/api/MsgPhp/Domain/Infra/InMemory/ObjectFieldAccessor.html

‎docs/infrastructure/doctrine-collections.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Doctrine Collections
22

3-
An overview of available infrastructural code when using Doctrine's [Collections](http://www.doctrine-project.org/projects/collections.html).
3+
An overview of available infrastructural code when using Doctrine's [Collections][collections-project].
44

5-
- Requires [`doctrine/collections`](https://packagist.org/packages/doctrine/collections)
5+
- Requires [doctrine/collections]
66

77
## Domain collection
88

@@ -28,3 +28,6 @@ $collection = new DomainCollection(new ArrayCollection([1, 2, 3]));
2828

2929
$collection = DomainCollection::fromValue([1, 2, 3]);
3030
```
31+
32+
[collections-project]: http://www.doctrine-project.org/projects/collections.html
33+
[doctrine/collections]: https://packagist.org/packages/doctrine/collections

‎docs/infrastructure/doctrine-dbal.md‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
# Doctrine Database Abstraction Layer
22

3-
An overview of available infrastructural code when using Doctrine's [Database Abstraction Layer](http://www.doctrine-project.org/projects/dbal.html).
3+
An overview of available infrastructural code when using Doctrine's [Database Abstraction Layer][dbal-project].
44

5-
- Requires [`doctrine/dbal`](https://packagist.org/packages/doctrine/dbal)
5+
- Requires [doctrine/dbal]
66

77
## Domain identifier type
88

99
A translation between the database type and a [identifier](../ddd/identifiers.md) type in PHP is provided by
1010
`MsgPhp\Domain\Infra\Doctrine\DomainIdType`. Its purpose is to abstract the underlying data type of the identifier
1111
value.
1212

13-
The design is based on [late static binding](https://secure.php.net/manual/en/language.oop5.late-static-bindings.php),
14-
due the design of the Doctrine type system itself. Besides extending from the default [`Type`](http://www.doctrine-project.org/api/dbal/2.5/class-Doctrine.DBAL.Types.Type.html)
15-
implementation it can be used as a base type for custom identifiers (which in turn require custom types).
13+
The design is based on [late static bindings], due the design of the Doctrine type system itself. Besides extending from
14+
the default [`Type`][api-type] implementation it can be used as a base type for custom identifiers (which in turn require custom
15+
types).
1616

1717
- `static setClass(string $class): void`
1818
- `$class`: A sub class of `DomainIdInterface` to use as PHP value. If not set the [default identifier](../ddd/identifiers.md#msgphpdomaindomainid)
@@ -51,7 +51,7 @@ MyDomainIdType::setDataType(Type::GUID);
5151
```
5252

5353
To leverage the tailored [UUID identifier](../infrastructure/uuid.md#domain-identifier) use a data type from
54-
[`ramsey/uuid-doctrine`](https://packagist.org/packages/ramsey/uuid-doctrine) instead.
54+
[ramsey/uuid-doctrine] instead.
5555

5656
```php
5757
<?php
@@ -62,3 +62,9 @@ use Ramsey\Uuid\Doctrine\UuidType;
6262
MyDomainIdType::setClass(DomainUuid::class);
6363
MyDomainIdType::setDataType(UuidType::NAME);
6464
```
65+
66+
[dbal-project]: http://www.doctrine-project.org/projects/dbal.html
67+
[doctrine/dbal]: https://packagist.org/packages/doctrine/dbal
68+
[api-type]: http://www.doctrine-project.org/api/dbal/2.5/class-Doctrine.DBAL.Types.Type.html
69+
[late-static-bindings]: https://secure.php.net/manual/en/language.oop5.late-static-bindings.php
70+
[ramsey/uuid-doctrine]: https://packagist.org/packages/ramsey/uuid-doctrine

‎docs/infrastructure/doctrine-orm.md‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Doctrine Object Relational Mapper
22

3-
An overview of available infrastructural code when using Doctrine's [Object Relational Mapper](http://www.doctrine-project.org/projects/orm.html).
3+
An overview of available infrastructural code when using Doctrine's [Object Relational Mapper][orm-project].
44

5-
- Requires [`doctrine/orm`](https://packagist.org/packages/doctrine/orm)
5+
- Requires [doctrine/orm]
66

77
## Domain identity mapping
88

99
A Doctrine tailored [domain identity mapping](../ddd/identity-mapping.md) is provided by
10-
`MsgPhp\Domain\Infra\Doctrine\DomainIdentityMapping`. It uses Doctrine's [`EntityManagerInterface`](http://www.doctrine-project.org/api/orm/2.5/class-Doctrine.ORM.EntityManagerInterface.html)
11-
as underlying mapping.
10+
`MsgPhp\Domain\Infra\Doctrine\DomainIdentityMapping`. It uses Doctrine's [`EntityManagerInterface`][api-em] as
11+
underlying mapping.
1212

1313
- `__construct(EntityManagerInterface $em)`
1414
- `$em`: The entity manager to use
@@ -42,8 +42,8 @@ $mapping = new DomainIdentityMapping($em);
4242
## Domain repository
4343

4444
A Doctrine tailored [repository trait](../ddd/repositories.md) is provided by
45-
`MsgPhp\Domain\Infra\Doctrine\DomainEntityRepositoryTrait`. It uses Doctrine's [`EntityManagerInterface`](http://www.doctrine-project.org/api/orm/2.5/class-Doctrine.ORM.EntityManagerInterface.html)
46-
as underlying persistence layer.
45+
`MsgPhp\Domain\Infra\Doctrine\DomainEntityRepositoryTrait`. It uses Doctrine's [`EntityManagerInterface`][api-em] as
46+
underlying persistence layer.
4747

4848
- `__construct(string $class, EntityManagerInterface $em, DomainIdentityHelper $identityHelper = null)`
4949
- `$class`: The entity class this repository is tied to
@@ -102,7 +102,7 @@ if ($repository->exists($id = ['name' => ..., 'year' => ...])) {
102102
## Hydration
103103

104104
When working with [identifiers](../ddd/identifiers.md) and the corresponding [type](doctrine-dbal.md#domain-identifier-type)
105-
a problem might occur when hydrating scalar values, e.g. using [`getScalarResult()`](http://www.doctrine-project.org/api/orm/2.5/class-Doctrine.ORM.AbstractQuery.html#_getScalarResult);
105+
a problem might occur when hydrating scalar values, e.g. using [`Query::getScalarResult()`][api-query-getscalarresult];
106106
it would return instances of `MsgPhp\Domain\DomainIdInterface` that can only be casted to string as its (true) scalar
107107
value (due to `__toString()`). In case the underlying data type is e.g. `integer` we'll lose it.
108108

@@ -152,7 +152,7 @@ $query->getSingleResult(SingleScalarHydrator::NAME); // int(1)
152152
A Doctrine tailored entity reference loader in the form of an invokable object is provided by
153153
`MsgPhp\Domain\Infra\Doctrine\EntityReferenceLoader`. Its main purpose is to be used as a callable _reference loader_
154154
when working with the generic [entity aware factory](../ddd/factory/entity-aware.md#msgphpdomainfactoryentityawarefactory)
155-
in effort to get a lazy-loading reference object, managed by Doctrine. See also [`EntityManagerInterface::getReference()`](http://www.doctrine-project.org/api/orm/2.5/class-Doctrine.ORM.EntityManagerInterface.html#_getReference).
155+
in effort to get a lazy-loading reference object, managed by Doctrine. See also [`EntityManagerInterface::getReference()`][api-em-getreference].
156156

157157
- `__construct(EntityManagerInterface $em, array $classMapping = [], DomainIdentityHelper $identityHelper = null)`
158158
- `$em`: The entity manager to use
@@ -188,3 +188,9 @@ $loader = new EntityReferenceLoader($em);
188188
/** @var MyEntity|null $ref */
189189
$ref = $loader(MyEntity::class, 1); // no database hit
190190
```
191+
192+
[orm-project]: http://www.doctrine-project.org/projects/orm.html
193+
[doctrine/orm]: https://packagist.org/packages/doctrine/orm
194+
[api-em]: http://www.doctrine-project.org/api/orm/2.5/class-Doctrine.ORM.EntityManagerInterface.html
195+
[api-em-getreference]: http://www.doctrine-project.org/api/orm/2.5/class-Doctrine.ORM.EntityManagerInterface.html#_getReference
196+
[api-query-getscalarresult]: http://www.doctrine-project.org/api/orm/2.5/class-Doctrine.ORM.AbstractQuery.html#_getScalarResult

‎docs/infrastructure/symfony-console.md‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Symfony Console
22

3-
An overview of available infrastructural code when using [Symfony Console](https://symfony.com/doc/current/components/console.html).
3+
An overview of available infrastructural code when using [Symfony Console][console-project].
44

5-
- Requires [`symfony/console`](https://packagist.org/packages/symfony/console)
5+
- Requires [symfony/console]
66

77
## Context builder
88

@@ -16,14 +16,13 @@ context provided to an [object factory](../ddd/factory/object.md).
1616

1717
#### `configure(InputDefinition $definition): void`
1818

19-
Configure a command input definition. See also [`InputDefinition`](https://api.symfony.com/master/Symfony/Component/Console/Input/InputDefinition.html).
19+
Configure a command input definition. See also [`InputDefinition`][api-inputdefinition].
2020

2121
---
2222

2323
#### `getContext(InputInterface $input, StyleInterface $io): array`
2424

25-
Resolve the actual context from the console IO. See also [`InputInterface`](https://api.symfony.com/master/Symfony/Component/Console/Input/InputInterface.html)
26-
and [`StyleInterface`](https://api.symfony.com/master/Symfony/Component/Console/Style/StyleInterface.html).
25+
Resolve the actual context from the console IO. See also [`InputInterface`][api-inputinterface] and [`StyleInterface`][api-styleinterface].
2726

2827
### Implementations
2928

@@ -49,8 +48,7 @@ is given it will be asked interactively. If interaction is not possible an excep
4948
Per-element configuration can be provided by implementing a `MsgPhp\Domain\Infra\Console\ContextBuilder\ContextElementProviderInterface`.
5049

5150
- `getElement(string $class, string $method, string $argument): ?ContextElement`
52-
- Resolve a [`ContextElement`](https://msgphp.github.io/api/MsgPhp/Domain/Infra/Console/ContextBuilder/ContextElement.html)
53-
from a class/method/argument combination
51+
- Resolve a [`ContextElement`][api-contextelement] from a class/method/argument combination
5452

5553
##### Basic example
5654

@@ -116,3 +114,10 @@ class MyCommand extends Command
116114

117115
// $ bin/console my-command
118116
```
117+
118+
[console-project]: https://symfony.com/doc/current/components/console.html
119+
[symfony/console]: https://packagist.org/packages/symfony/console
120+
[api-inputdefinition]: https://api.symfony.com/master/Symfony/Component/Console/Input/InputDefinition.html
121+
[api-inputinterface]: https://api.symfony.com/master/Symfony/Component/Console/Input/InputInterface.html
122+
[api-styleinterface]: https://api.symfony.com/master/Symfony/Component/Console/Style/StyleInterface.html
123+
[api-contextelement]: https://msgphp.github.io/api/MsgPhp/Domain/Infra/Console/ContextBuilder/ContextElement.html

‎docs/infrastructure/uuid.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Universally Unique Identifier
22

3-
An overview of available infrastructural code when working with [UUID's](https://en.wikipedia.org/wiki/Universally_unique_identifier).
3+
An overview of available infrastructural code when working with [UUID's][uuid].
44

5-
- Requires [`ramsey/uuid`](https://packagist.org/packages/ramsey/uuid)
5+
- Requires [ramsey/uuid]
66

77
## Domain identifier
88

@@ -31,3 +31,6 @@ $id = new DomainId(Uuid::fromString('00000000-0000-0000-0000-000000000000')); //
3131

3232
$id = DomainId::fromValue('00000000-0000-0000-0000-000000000000');
3333
```
34+
35+
[uuid]: https://en.wikipedia.org/wiki/Universally_unique_identifier
36+
[ramsey/uuid]: https://packagist.org/packages/ramsey/uuid

‎docs/message-driven/cqrs.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Command Query Responsibility Segregation
22

3-
Commands are domain objects and provided per domain layer. They usually follow a [POPO](https://stackoverflow.com/questions/41188002/what-does-the-term-plain-old-php-object-popo-exactly-mean)
4-
design. Its purpose is to describe an action to be taken. For commands being messages they can be dispatched using any
5-
[message bus](message-bus.md).
3+
Commands are domain objects and provided per domain layer. They usually follow a [POPO] design. Its purpose is to
4+
describe an action to be taken. For commands being messages they can be dispatched using any [message bus](message-bus.md).
65

76
## Event-sourcing command handler
87

@@ -79,3 +78,5 @@ $bus = ...;
7978

8079
$bus->dispatch(new MyCommand());
8180
```
81+
82+
[POPO]: https://stackoverflow.com/questions/41188002/what-does-the-term-plain-old-php-object-popo-exactly-mean

0 commit comments

Comments
 (0)