helper.php 4.7 KB

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