mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
fix: add @template TModel of static for Eloquent (#1631)
* fix: add @template TModel of static for Eloquent * fix: use `===` instead of `==` --------- Co-authored-by: Yifan Zhao <[email protected]>
This commit is contained in:
@@ -23,7 +23,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
<?php foreach ($namespaces_by_extends_ns as $namespace => $aliases) : ?>
|
<?php foreach ($namespaces_by_extends_ns as $namespace => $aliases) : ?>
|
||||||
namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
|
namespace <?= $namespace === '__root' ? '' : trim($namespace, '\\') ?> {
|
||||||
<?php foreach ($aliases as $alias) : ?>
|
<?php foreach ($aliases as $alias) : ?>
|
||||||
<?= trim($alias->getDocComment(' ')) ?>
|
<?= trim($alias->getDocComment(' ')) ?>
|
||||||
<?= $alias->getClassType() ?> <?= $alias->getExtendsClass() ?> {
|
<?= $alias->getClassType() ?> <?= $alias->getExtendsClass() ?> {
|
||||||
@@ -47,9 +47,12 @@ namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
|
|||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
<?php foreach ($namespaces_by_alias_ns as $namespace => $aliases) : ?>
|
<?php foreach ($namespaces_by_alias_ns as $namespace => $aliases) : ?>
|
||||||
namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
|
namespace <?= $namespace === '__root' ? '' : trim($namespace, '\\') ?> {
|
||||||
<?php foreach ($aliases as $alias) : ?>
|
<?php foreach ($aliases as $alias) : ?>
|
||||||
<?= $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() == '\Illuminate\Database\Eloquent') : ?>
|
<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
|
||||||
|
/** @template TModel of static */
|
||||||
|
<?php endif?>
|
||||||
|
<?= $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
|
||||||
<?php foreach ($alias->getMethods() as $method) : ?>
|
<?php foreach ($alias->getMethods() as $method) : ?>
|
||||||
<?= trim($method->getDocComment(' ')) ?>
|
<?= trim($method->getDocComment(' ')) ?>
|
||||||
public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
|
public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
|
||||||
|
|||||||
Reference in New Issue
Block a user