|
4 | 4 |
|
5 | 5 | use Nextcloud\Rector\Rector\AnnotationToAttributeRector; |
6 | 6 | use Nextcloud\Rector\Rector\ReplaceFetchAllMethodCallRector; |
7 | | -use Nextcloud\Rector\Rector\ReplaceIConfigWithIUserConfigRector; |
| 7 | +use Nextcloud\Rector\Rector\ReplaceInjectedMethodCallRector; |
8 | 8 | use Nextcloud\Rector\Set\NextcloudSets; |
| 9 | +use Nextcloud\Rector\ValueObject\ReplaceInjectedMethodCall; |
9 | 10 | use Rector\Config\RectorConfig; |
10 | 11 | use Rector\Php80\ValueObject\AnnotationToAttribute; |
11 | 12 |
|
12 | 13 | return static function (RectorConfig $rectorConfig): void { |
13 | | - $rectorConfig->sets([NextcloudSets::NEXTCLOUD_29]); |
| 14 | + $rectorConfig->sets([NextcloudSets::NEXTCLOUD_32]); |
14 | 15 | $rectorConfig->rule(ReplaceFetchAllMethodCallRector::class); |
15 | | - $rectorConfig->rule(ReplaceIConfigWithIUserConfigRector::class); |
| 16 | + $rectorConfig->ruleWithConfiguration( |
| 17 | + ReplaceInjectedMethodCallRector::class, |
| 18 | + [ |
| 19 | + new ReplaceInjectedMethodCall( |
| 20 | + 'OCP\IConfig', |
| 21 | + 'OCP\IUserConfig', |
| 22 | + 'userConfig', |
| 23 | + [ |
| 24 | + 'getAllUserValues' => 'getAllValues', |
| 25 | + 'getUserKeys' => 'getKeys', |
| 26 | + 'getUserValue' => 'getValueString', |
| 27 | + 'getUserValueForUsers' => 'getValuesByUsers', |
| 28 | + 'getUsersForUserValue' => 'searchUsersByValueString', |
| 29 | + 'setUserValue' => 'setValueString', |
| 30 | + 'deleteUserValue' => 'deleteUserConfig', |
| 31 | + 'deleteAllUserValues' => 'deleteAllUserConfig', |
| 32 | + 'deleteAppFromAllUsers' => 'deleteApp', |
| 33 | + ], |
| 34 | + ), |
| 35 | + ], |
| 36 | + ); |
16 | 37 | $rectorConfig->ruleWithConfiguration( |
17 | 38 | AnnotationToAttributeRector::class, |
18 | 39 | [ |
|
0 commit comments