Skip to content

Commit 0aedef4

Browse files
authored
Update excel migration with sets() method (#2861)
1 parent ab52991 commit 0aedef4

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

docs/topics/migration-from-PHPExcel.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,30 @@ in `src/`, you can run the migration like so:
1414

1515
```sh
1616
composer require rector/rector --dev
17-
vendor/bin/rector process src --set phpexcel-to-phpspreadsheet
18-
composer remove rector/rector
17+
18+
# this creates rector.php config
19+
vendor/bin/rector init
20+
```
21+
22+
Add `PHPOfficeSetList` set to `rector.php`
23+
24+
```php
25+
declare(strict_types=1);
26+
27+
use Rector\Config\RectorConfig;
28+
use Rector\PHPOffice\Set\PHPOfficeSetList;
29+
30+
return static function (RectorConfig $rectorConfig): void {
31+
$rectorConfig->sets([
32+
PHPOfficeSetList::PHPEXCEL_TO_PHPSPREADSHEET
33+
]);
34+
};
35+
```
36+
37+
And run Rector on your code:
38+
39+
```sh
40+
vendor/bin/rector process src
1941
```
2042

2143
For more details, see

0 commit comments

Comments
 (0)