Skip to content
This repository was archived by the owner on Feb 6, 2020. It is now read-only.

Commit f8780cb

Browse files
committed
Minor edits to migration document.
- Added punctuation. - Clarifications to text.
1 parent d6310a8 commit f8780cb

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

doc/book/migration.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ To prepare this for version 3, we need to do the following:
11581158
`factories` and `aliases`.
11591159
- We need to implement a `validate()` method.
11601160
- We need to update the `validatePlugin()` method to proxy to `validate()`.
1161-
- We need to add a `$sharedByDefault` property (if `$shareByDefault` is present)
1161+
- We need to add a `$sharedByDefault` property (if `$shareByDefault` is present).
11621162

11631163
Doing so, we get the following result:
11641164

@@ -1227,17 +1227,19 @@ Things to note about the above:
12271227
being generated, and these are mapped to `InvokableFactory` instances. This
12281228
means you can also fetch your plugins by their FQCN.
12291229
- There are also factory entries for the canonicalized FQCN of each factory,
1230-
which will be used in v2.
1230+
which will be used in v2. (Canonicalization in v2 strips non-alphanumeric
1231+
characters, and casts to lowercase.)
12311232
- `validatePlugin()` continues to throw the old exception
12321233

12331234
The above will now work in both version 2 and version 3.
12341235

12351236
### Migration testing
12361237

1237-
To test your changes, create a new `MigrationTest` case that uses the
1238-
`CommonPluginManagerTrait`. Override the `getPluginManager()` to return an
1239-
instance of your plugin manager and override `getV2InvalidPluginException()`
1240-
to return the classname of the exception your `validatePlugin()` method throws:
1238+
To test your changes, create a new `MigrationTest` case that uses
1239+
`Zend\ServiceManager\Test\CommonPluginManagerTrait`. Override
1240+
`getPluginManager()` to return an instance of your plugin manager, and override
1241+
`getV2InvalidPluginException()` to return the classname of the exception your
1242+
`validatePlugin()` method throws:
12411243

12421244
```php
12431245
use MyNamespace\ObserverInterface;
@@ -1270,10 +1272,10 @@ class MigrationTest extends TestCase
12701272

12711273
This will check that:
12721274

1273-
- You have set the `$instanceOf` property
1274-
- `$shareByDefault` and `$sharedByDefault` match, if present
1275-
- That requesting an invalid plugin throws the right exception
1276-
- That all your aliases resolve
1275+
- You have set the `$instanceOf` property.
1276+
- `$shareByDefault` and `$sharedByDefault` match, if present.
1277+
- That requesting an invalid plugin throws the right exception.
1278+
- That all your aliases resolve.
12771279

12781280

12791281
### Post migration

0 commit comments

Comments
 (0)