Skip to content

Commit a0b7513

Browse files
committed
Format IDE helper
1 parent f343efa commit a0b7513

File tree

1 file changed

+69
-65
lines changed

1 file changed

+69
-65
lines changed

resources/views/helper.php

Lines changed: 69 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -13,114 +13,118 @@
1313
// phpcs:ignoreFile
1414

1515
/**
16-
* A helper file for Laravel, to provide autocomplete information to your IDE
17-
* Generated for Laravel <?= app()->version() ?>.
18-
*
19-
* This file should not be included in your code, only analyzed by your IDE!
20-
*
21-
* @author Barry vd. Heuvel <[email protected]>
22-
* @see https://github.com/barryvdh/laravel-ide-helper
23-
*/
24-
16+
* A helper file for Laravel, to provide autocomplete information to your IDE
17+
* Generated for Laravel <?= app()->version() ?>.
18+
*
19+
* This file should not be included in your code, only analyzed by your IDE!
20+
*
21+
* @author Barry vd. Heuvel <[email protected]>
22+
* @see https://github.com/barryvdh/laravel-ide-helper
23+
*/
24+
<?php
25+
$s1 = ' ';
26+
$s2 = $s1.$s1;
27+
$s3 = $s1.$s2;
28+
?>
2529
<?php foreach ($namespaces_by_extends_ns as $namespace => $aliases) : ?>
26-
namespace <?= $namespace === '__root' ? '' : trim($namespace, '\\') ?> {
30+
namespace <?= $namespace === '__root' ? '' : trim($namespace, '\\') ?> {
2731
<?php foreach ($aliases as $alias) : ?>
28-
<?= trim($alias->getDocComment(' ')) ?>
29-
<?= $alias->getClassType() ?> <?= $alias->getExtendsClass() ?> {
32+
<?php echo trim($alias->getDocComment($s1)) ."\n{$s1}" . $alias->getClassType() ?> <?= $alias->getExtendsClass() ?> {
3033
<?php foreach ($alias->getMethods() as $method) : ?>
31-
<?= trim($method->getDocComment(' ')) ?>
32-
public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
33-
{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
34-
//Method inherited from <?= $method->getDeclaringClass() ?>
35-
<?php endif; ?>
34+
<?= trim($method->getDocComment($s2)) ."\n{$s2}" ?>public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
35+
{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
36+
<?= "\n".$s3?>//Method inherited from <?= $method->getDeclaringClass() ?>
37+
<?php endif; ?>
3638

3739
<?php if ($method->isInstanceCall()) : ?>
38-
/** @var <?=$method->getRoot()?> $instance */
40+
<?= $s3 ?>/** @var <?=$method->getRoot()?> $instance */
3941
<?php endif?>
40-
<?= $method->shouldReturn() ? 'return ' : '' ?><?= $method->getRootMethodCall() ?>;
41-
}
42+
<?= $s3 . ($method->shouldReturn() ? 'return ' : '') ?><?= $method->getRootMethodCall() ?>;
43+
}
44+
4245
<?php endforeach; ?>
43-
}
46+
}
4447
<?php endforeach; ?>
45-
}
48+
}
4649

4750
<?php endforeach; ?>
4851

4952
<?php foreach ($namespaces_by_alias_ns as $namespace => $aliases) : ?>
50-
namespace <?= $namespace === '__root' ? '' : trim($namespace, '\\') ?> {
53+
namespace <?= $namespace === '__root' ? '' : trim($namespace, '\\') ?> {
5154
<?php foreach ($aliases as $alias) : ?>
5255
<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
53-
<?= $alias->getPhpDocTemplates(' ') ?>
56+
<?= "\n".$alias->getPhpDocTemplates($s1) ."\n" ?>
5457
<?php endif?>
55-
<?= $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
58+
<?= $s1. $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
5659
<?php foreach ($alias->getMethods() as $method) : ?>
57-
<?= trim($method->getDocComment(' ')) ?>
58-
public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
59-
{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
60-
//Method inherited from <?= $method->getDeclaringClass() ?>
61-
<?php endif; ?>
60+
<?= $s2 . trim($method->getDocComment($s2))."\n" ?>
61+
<?= $s2 ?>public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
62+
<?= $s2?>{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
63+
<?= $s2 ?>//Method inherited from <?= $method->getDeclaringClass() ?>
64+
<?php endif; ?>
6265

6366
<?php if ($method->isInstanceCall()) : ?>
64-
/** @var <?=$method->getRoot()?> $instance */
67+
<?= $s3 ?>/** @var <?=$method->getRoot()?> $instance */
6568
<?php endif?>
66-
<?= $method->shouldReturn() ? 'return ' : '' ?><?= $method->getRootMethodCall() ?>;
67-
}
69+
<?= $s3 . ($method->shouldReturn() ? 'return ' : '') ?><?= $method->getRootMethodCall() ?>;
70+
<?= $s2 ?>}
71+
6872
<?php endforeach; ?>
6973
<?php endif; ?>}
7074
<?php endforeach; ?>
71-
}
75+
}
7276

7377
<?php endforeach; ?>
7478

7579
<?php foreach($real_time_facades as $name): ?>
76-
<?php $nested = explode('\\', str_replace('\\' . class_basename($name), '', $name)); ?>
77-
namespace <?php echo implode('\\', $nested); ?> {
80+
<?php $nested = explode('\\', str_replace('\\' . class_basename($name), '', $name)); ?>
81+
namespace <?php echo implode('\\', $nested); ?> {
7882
/**
79-
* @mixin <?= str_replace('Facades', '', $name) ?>
80-
*/
83+
* @mixin <?= str_replace('Facades', '', $name) ?>
84+
*/
8185
class <?= class_basename($name) ?> extends <?= str_replace('Facades', '', $name) ?> {}
82-
}
86+
}
8387
<?php endforeach; ?>
8488

8589
<?php if ($helpers) : ?>
86-
namespace {
90+
namespace {
8791
<?= $helpers ?>
88-
}
92+
}
8993
<?php endif; ?>
9094

9195
<?php if ($include_fluent) : ?>
92-
namespace Illuminate\Support {
96+
namespace Illuminate\Support {
9397
/**
94-
* Methods commonly used in migrations
95-
*
96-
* @method Fluent after(string $column) Add the after modifier
97-
* @method Fluent charset(string $charset) Add the character set modifier
98-
* @method Fluent collation(string $collation) Add the collation modifier
99-
* @method Fluent comment(string $comment) Add comment
100-
* @method Fluent default($value) Add the default modifier
101-
* @method Fluent first() Select first row
102-
* @method Fluent index(string $name = null) Add the in dex clause
103-
* @method Fluent on(string $table) `on` of a foreign key
104-
* @method Fluent onDelete(string $action) `on delete` of a foreign key
105-
* @method Fluent onUpdate(string $action) `on update` of a foreign key
106-
* @method Fluent primary() Add the primary key modifier
107-
* @method Fluent references(string $column) `references` of a foreign key
108-
* @method Fluent nullable(bool $value = true) Add the nullable modifier
109-
* @method Fluent unique(string $name = null) Add unique index clause
110-
* @method Fluent unsigned() Add the unsigned modifier
111-
* @method Fluent useCurrent() Add the default timestamp value
112-
* @method Fluent change() Add the change modifier
113-
*/
98+
* Methods commonly used in migrations
99+
*
100+
* @method Fluent after(string $column) Add the after modifier
101+
* @method Fluent charset(string $charset) Add the character set modifier
102+
* @method Fluent collation(string $collation) Add the collation modifier
103+
* @method Fluent comment(string $comment) Add comment
104+
* @method Fluent default($value) Add the default modifier
105+
* @method Fluent first() Select first row
106+
* @method Fluent index(string $name = null) Add the in dex clause
107+
* @method Fluent on(string $table) `on` of a foreign key
108+
* @method Fluent onDelete(string $action) `on delete` of a foreign key
109+
* @method Fluent onUpdate(string $action) `on update` of a foreign key
110+
* @method Fluent primary() Add the primary key modifier
111+
* @method Fluent references(string $column) `references` of a foreign key
112+
* @method Fluent nullable(bool $value = true) Add the nullable modifier
113+
* @method Fluent unique(string $name = null) Add unique index clause
114+
* @method Fluent unsigned() Add the unsigned modifier
115+
* @method Fluent useCurrent() Add the default timestamp value
116+
* @method Fluent change() Add the change modifier
117+
*/
114118
class Fluent {}
115-
}
119+
}
116120
<?php endif ?>
117121

118122
<?php foreach ($factories as $factory) : ?>
119-
namespace <?=$factory->getNamespaceName()?> {
123+
namespace <?=$factory->getNamespaceName()?> {
120124
/**
121125
* @method \Illuminate\Database\Eloquent\Collection|<?=$factory->getShortName()?>[]|<?=$factory->getShortName()?> create($attributes = [])
122126
* @method \Illuminate\Database\Eloquent\Collection|<?=$factory->getShortName()?>[]|<?=$factory->getShortName()?> make($attributes = [])
123127
*/
124128
class <?=$factory->getShortName()?>FactoryBuilder extends \Illuminate\Database\Eloquent\FactoryBuilder {}
125-
}
129+
}
126130
<?php endforeach; ?>

0 commit comments

Comments
 (0)