|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +use Rector\Config\RectorConfig; |
| 6 | +use Sylius\SyliusRector\Rector\Class_\AddInterfaceToClassExtendingTypeRector; |
| 7 | +use Sylius\SyliusRector\Rector\Class_\AddTraitToClassExtendingTypeRector; |
| 8 | + |
| 9 | +return static function (RectorConfig $rectorConfig): void { |
| 10 | + $rectorConfig->ruleWithConfiguration(AddInterfaceToClassExtendingTypeRector::class, [ |
| 11 | + 'Sylius\Component\Core\Model\Address' => [ |
| 12 | + 'Sylius\B2BKit\Entity\AddressInterface', |
| 13 | + ], |
| 14 | + 'Sylius\Component\Core\Model\Customer' => [ |
| 15 | + 'Sylius\B2BKit\Entity\CustomerInterface', |
| 16 | + ], |
| 17 | + 'Sylius\Component\Customer\Model\CustomerGroup' => [ |
| 18 | + 'Sylius\B2BKit\Entity\CustomerGroupInterface', |
| 19 | + ], |
| 20 | + 'Sylius\Component\Core\Model\Order' => [ |
| 21 | + 'Sylius\B2BKit\Entity\OrderInterface', |
| 22 | + ], |
| 23 | + 'Sylius\Component\Core\Model\ShopUser' => [ |
| 24 | + 'Sylius\B2BKit\Entity\ShopUserInterface', |
| 25 | + ], |
| 26 | + ]); |
| 27 | + $rectorConfig->ruleWithConfiguration(AddTraitToClassExtendingTypeRector::class, [ |
| 28 | + 'Sylius\Component\Core\Model\Address' => [ |
| 29 | + 'Sylius\B2BKit\Entity\AddressAwareTrait', |
| 30 | + ], |
| 31 | + 'Sylius\Component\Core\Model\Customer' => [ |
| 32 | + 'Sylius\B2BKit\Entity\CustomerAwareTrait', |
| 33 | + ], |
| 34 | + 'Sylius\Component\Customer\Model\CustomerGroup' => [ |
| 35 | + 'Sylius\B2BKit\Entity\CustomerGroupAwareTrait', |
| 36 | + ], |
| 37 | + 'Sylius\Component\Core\Model\Order' => [ |
| 38 | + 'Sylius\B2BKit\Entity\OrderAwareTrait', |
| 39 | + ], |
| 40 | + 'Sylius\Component\Core\Model\ShopUser' => [ |
| 41 | + 'Sylius\B2BKit\Entity\ShopUserAwareTrait', |
| 42 | + ], |
| 43 | + ]); |
| 44 | +}; |
0 commit comments