1 | <?php |
||
11 | class SlugThemAll extends Command |
||
12 | { |
||
13 | /** @var string */ |
||
14 | protected $signature = 'slug-them:all'; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $description = "Slug'em all, them models"; |
||
18 | |||
19 | /** @var \App\MigrationCreator */ |
||
20 | protected $creator; |
||
21 | |||
22 | /** @var \Illuminate\Database\Migrations\Migrator */ |
||
23 | protected $migrator; |
||
24 | |||
25 | /** @var \Illuminate\Support\Composer */ |
||
26 | protected $composer; |
||
27 | |||
28 | public function __construct(MigrationCreator $creator, Migrator $migrator, Composer $composer) |
||
35 | |||
36 | /** |
||
37 | * @todo - add option for paths/namespaces (filename) to check for the models |
||
38 | * @todo - add option for auto generating slugs for all the migrated tables |
||
39 | */ |
||
40 | public function handle() |
||
65 | |||
66 | /** |
||
67 | * Find all them classes in app/ & app/Models. |
||
68 | * |
||
69 | * @return \Illuminate\Support\Collection |
||
70 | */ |
||
71 | protected function collectClasses() |
||
84 | |||
85 | /** |
||
86 | * Filter only HasSlug trait holders. |
||
87 | * |
||
88 | * @param string $class |
||
89 | * @return \Illuminate\Database\Eloquent\Model|null |
||
90 | */ |
||
91 | public function filterSluggable($class) |
||
102 | |||
103 | /** |
||
104 | * Get SlugOptions and learn what the slug column name, aye? |
||
105 | * Then do the all-fired job to check column's existence. |
||
106 | * |
||
107 | * @param \Illuminate\Database\Eloquent\Model $sluggable |
||
108 | * @return array|null |
||
109 | */ |
||
110 | public function rejectExistingColumns($sluggable) |
||
121 | |||
122 | /** |
||
123 | * Create the migration file. |
||
124 | * |
||
125 | * @param \Illuminate\Support\Collection $columns |
||
126 | * @return string |
||
127 | */ |
||
128 | protected function create($columns) |
||
140 | } |
||
141 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..