Update excel migration with sets() method (#2861)
This commit is contained in:
parent
ab52991dc6
commit
0aedef4902
|
|
@ -14,8 +14,30 @@ in `src/`, you can run the migration like so:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
composer require rector/rector --dev
|
composer require rector/rector --dev
|
||||||
vendor/bin/rector process src --set phpexcel-to-phpspreadsheet
|
|
||||||
composer remove rector/rector
|
# this creates rector.php config
|
||||||
|
vendor/bin/rector init
|
||||||
|
```
|
||||||
|
|
||||||
|
Add `PHPOfficeSetList` set to `rector.php`
|
||||||
|
|
||||||
|
```php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Rector\Config\RectorConfig;
|
||||||
|
use Rector\PHPOffice\Set\PHPOfficeSetList;
|
||||||
|
|
||||||
|
return static function (RectorConfig $rectorConfig): void {
|
||||||
|
$rectorConfig->sets([
|
||||||
|
PHPOfficeSetList::PHPEXCEL_TO_PHPSPREADSHEET
|
||||||
|
]);
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
And run Rector on your code:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
vendor/bin/rector process src
|
||||||
```
|
```
|
||||||
|
|
||||||
For more details, see
|
For more details, see
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue