mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 10:07:12 +00:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4c2f68f14a | ||
|
|
a11dd14ee5 |
@@ -233,12 +233,7 @@ class MetaCommand extends Command
|
||||
],
|
||||
[
|
||||
'class' => ['\Illuminate\Support\Facades\Route', '\Illuminate\Support\Facades\Auth', 'Illuminate\Foundation\Auth\Access\Authorizable'],
|
||||
'method' => ['can', 'cannot', 'cant'],
|
||||
'argumentSet' => 'auth',
|
||||
],
|
||||
[
|
||||
'class' => ['Illuminate\Contracts\Auth\Access\Authorizable'],
|
||||
'method' => ['can'],
|
||||
'method' => ['can', 'cannot'],
|
||||
'argumentSet' => 'auth',
|
||||
],
|
||||
[
|
||||
@@ -313,13 +308,7 @@ class MetaCommand extends Command
|
||||
{
|
||||
if (!isset($this->templateCache[$name])) {
|
||||
$file = __DIR__ . '/../../php-templates/' . basename($name) . '.php';
|
||||
try {
|
||||
$value = $this->files->requireOnce($file) ?: [];
|
||||
} catch (\Throwable $e) {
|
||||
$value = [];
|
||||
$this->warn('Cannot load template for ' . $name . ': ' . $e->getMessage());
|
||||
}
|
||||
|
||||
$value = $this->files->requireOnce($file) ?: [];
|
||||
if (!$value instanceof Collection) {
|
||||
$value = collect($value);
|
||||
}
|
||||
|
||||
@@ -819,14 +819,10 @@ class ModelsCommand extends Command
|
||||
$relation === 'morphTo'
|
||||
)
|
||||
) {
|
||||
$matches = [];
|
||||
$returnType = $this->getReturnTypeFromDocBlock($reflection);
|
||||
preg_match('/MorphTo<(.+?)(?:,|>)/i', $returnType, $matches);
|
||||
|
||||
// Model isn't specified because relation is polymorphic
|
||||
$this->setProperty(
|
||||
$method,
|
||||
$matches[1] ?? $this->getClassNameInDestinationFile($model, Model::class) . '|\Eloquent',
|
||||
$this->getClassNameInDestinationFile($model, Model::class) . '|\Eloquent',
|
||||
true,
|
||||
null,
|
||||
$comment,
|
||||
|
||||
Reference in New Issue
Block a user