-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrector.php
More file actions
38 lines (32 loc) · 1.26 KB
/
Copy pathrector.php
File metadata and controls
38 lines (32 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
declare(strict_types=1);
use Rector\Config\RectorConfig;
use Rector\Set\ValueObject\SetList;
use RectorLaravel\Set\LaravelLevelSetList;
use RectorLaravel\Set\LaravelSetList;
return RectorConfig::configure()
// حدد المجلدات التي سيتم فحصها
->withPaths([
__DIR__.'/app',
__DIR__.'/config',
__DIR__.'/database',
__DIR__.'/routes',
__DIR__.'/tests',
])
// تخطي مجلدات معينة أو ملفات لا تريد لمسها
->withSkip([
__DIR__.'/bootstrap/cache',
__DIR__.'/storage',
])
->withSets([
// 1. الترقية لإصدار لارافيل 11
LaravelLevelSetList::UP_TO_LARAVEL_110,
// 2. تحسين جودة كود لارافيل (مثل استخدام الـ Collections بشكل أفضل)
LaravelSetList::LARAVEL_CODE_QUALITY,
// 3. قواعد PHP العامة لتحسين الجودة (مثل تبسيط الـ if-statements)
SetList::CODE_QUALITY,
// 4. حذف الكود الذي لا يتم استخدامه تلقائياً
SetList::DEAD_CODE,
])
// تفعيل خاصية إضافة الـ Type Hints تلقائياً (احترافي جداً)
->withTypeCoverageLevel(0);