mirror of
https://github.com/rectorphp/rector.git
synced 2024-05-31 08:20:53 +00:00
remove old docs file
This commit is contained in:
parent
824b5c7f9b
commit
9a39eb02a3
|
@ -1,41 +0,0 @@
|
|||
# How to Use Prefixed Service In Custom Rule
|
||||
|
||||
Since `rector/rector` version 0.11, it is not possible to use service that previously not prefixed in previous version, for example, you have the following custom rector rule with `Symplify\PackageBuilder\Strings\StringFormatConverter` dependency:
|
||||
|
||||
```php
|
||||
use Symplify\PackageBuilder\Strings\StringFormatConverter;
|
||||
|
||||
final class UnderscoreToCamelCaseVariableNameRector extends AbstractRector
|
||||
{
|
||||
public function __construct(StringFormatConverter $stringFormatter)
|
||||
{
|
||||
// ...
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
For above example, the `Symplify\PackageBuilder\Strings\StringFormatConverter` is no longer exists, you can consume via require --dev it:
|
||||
|
||||
```bash
|
||||
composer require --dev symplify/package-builder
|
||||
```
|
||||
|
||||
After that, you need to register the `symplify/package-builder`'s src to service in `rector.php`:
|
||||
|
||||
```php
|
||||
<?php
|
||||
// rector.php
|
||||
|
||||
use Symplify\PackageBuilder\Strings\StringFormatConverter;
|
||||
|
||||
return static function (ContainerConfigurator $containerConfigurator): void {
|
||||
// ...
|
||||
|
||||
$services = $containerConfigurator->services();
|
||||
$services->set(StringFormatConverter::class);
|
||||
|
||||
// ...
|
||||
};
|
||||
```
|
||||
|
||||
Now, the `Symplify\PackageBuilder\Strings\StringFormatConverter` service will be detected again.
|
Loading…
Reference in New Issue
Block a user