helper.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?= '<?php' ?>
  2. <?php
  3. /**
  4. * @var \Barryvdh\LaravelIdeHelper\Alias[][] $namespaces_by_alias_ns
  5. * @var \Barryvdh\LaravelIdeHelper\Alias[][] $namespaces_by_extends_ns
  6. * @var bool $include_fluent
  7. * @var string $helpers
  8. */
  9. ?>
  10. // @formatter:off
  11. // phpcs:ignoreFile
  12. /**
  13. * A helper file for Laravel, to provide autocomplete information to your IDE
  14. * Generated for Laravel <?= $version ?>.
  15. *
  16. * This file should not be included in your code, only analyzed by your IDE!
  17. *
  18. * @author Barry vd. Heuvel <barryvdh@gmail.com>
  19. * @see https://github.com/barryvdh/laravel-ide-helper
  20. */
  21. <?php foreach ($namespaces_by_extends_ns as $namespace => $aliases) : ?>
  22. <?php if ($namespace == '\Illuminate\Database\Eloquent') :
  23. continue;
  24. endif; ?>
  25. namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
  26. <?php foreach ($aliases as $alias) : ?>
  27. <?= trim($alias->getDocComment(' ')) ?>
  28. <?= $alias->getClassType() ?> <?= $alias->getExtendsClass() ?> {
  29. <?php foreach ($alias->getMethods() as $method) : ?>
  30. <?= trim($method->getDocComment(' ')) ?>
  31. public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
  32. {<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
  33. //Method inherited from <?= $method->getDeclaringClass() ?>
  34. <?php endif; ?>
  35. <?php if ($method->isInstanceCall()) : ?>
  36. /** @var <?=$method->getRoot()?> $instance */
  37. <?php endif?>
  38. <?= $method->shouldReturn() ? 'return ' : '' ?><?= $method->getRootMethodCall() ?>;
  39. }
  40. <?php endforeach; ?>
  41. }
  42. <?php endforeach; ?>
  43. }
  44. <?php endforeach; ?>
  45. <?php foreach ($namespaces_by_alias_ns as $namespace => $aliases) : ?>
  46. namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
  47. <?php foreach ($aliases as $alias) : ?>
  48. <?= $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() == '\Illuminate\Database\Eloquent') : ?>
  49. <?php foreach ($alias->getMethods() as $method) : ?>
  50. <?= trim($method->getDocComment(' ')) ?>
  51. public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
  52. {<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
  53. //Method inherited from <?= $method->getDeclaringClass() ?>
  54. <?php endif; ?>
  55. <?php if ($method->isInstanceCall()) : ?>
  56. /** @var <?=$method->getRoot()?> $instance */
  57. <?php endif?>
  58. <?= $method->shouldReturn() ? 'return ' : '' ?><?= $method->getRootMethodCall() ?>;
  59. }
  60. <?php endforeach; ?>
  61. <?php endif; ?>}
  62. <?php endforeach; ?>
  63. }
  64. <?php endforeach; ?>
  65. <?php if ($helpers) : ?>
  66. namespace {
  67. <?= $helpers ?>
  68. }
  69. <?php endif; ?>
  70. <?php if ($include_fluent) : ?>
  71. namespace Illuminate\Support {
  72. /**
  73. * Methods commonly used in migrations
  74. *
  75. * @method Fluent after(string $column) Add the after modifier
  76. * @method Fluent charset(string $charset) Add the character set modifier
  77. * @method Fluent collation(string $collation) Add the collation modifier
  78. * @method Fluent comment(string $comment) Add comment
  79. * @method Fluent default($value) Add the default modifier
  80. * @method Fluent first() Select first row
  81. * @method Fluent index(string $name = null) Add the in dex clause
  82. * @method Fluent on(string $table) `on` of a foreign key
  83. * @method Fluent onDelete(string $action) `on delete` of a foreign key
  84. * @method Fluent onUpdate(string $action) `on update` of a foreign key
  85. * @method Fluent primary() Add the primary key modifier
  86. * @method Fluent references(string $column) `references` of a foreign key
  87. * @method Fluent nullable(bool $value = true) Add the nullable modifier
  88. * @method Fluent unique(string $name = null) Add unique index clause
  89. * @method Fluent unsigned() Add the unsigned modifier
  90. * @method Fluent useCurrent() Add the default timestamp value
  91. * @method Fluent change() Add the change modifier
  92. */
  93. class Fluent {}
  94. }
  95. <?php endif ?>
  96. <?php foreach ($factories as $factory) : ?>
  97. namespace <?=$factory->getNamespaceName()?> {
  98. /**
  99. * @method \Illuminate\Database\Eloquent\Collection|<?=$factory->getShortName()?>[]|<?=$factory->getShortName()?> create($attributes = [])
  100. * @method \Illuminate\Database\Eloquent\Collection|<?=$factory->getShortName()?>[]|<?=$factory->getShortName()?> make($attributes = [])
  101. */
  102. class <?=$factory->getShortName()?>FactoryBuilder extends \Illuminate\Database\Eloquent\FactoryBuilder {}
  103. }
  104. <?php endforeach; ?>