Skip to content

Commit a7fc73e

Browse files
barryvdhlaravel-ide-helper
and
laravel-ide-helper
authored
Format IDE helper (#1638)
* Format IDE helper * composer fix-style * Format IDE helper * composer fix-style --------- Co-authored-by: laravel-ide-helper <[email protected]>
1 parent f343efa commit a7fc73e

File tree

1 file changed

+34
-30
lines changed

1 file changed

+34
-30
lines changed

resources/views/helper.php

+34-30
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,27 @@
2121
* @author Barry vd. Heuvel <[email protected]>
2222
* @see https://github.com/barryvdh/laravel-ide-helper
2323
*/
24-
24+
<?php
25+
$s1 = ' ';
26+
$s2 = $s1 . $s1;
27+
$s3 = $s1 . $s2;
28+
?>
2529
<?php foreach ($namespaces_by_extends_ns as $namespace => $aliases) : ?>
2630
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() ?>)
34+
<?= trim($method->getDocComment($s2)) . "\n{$s2}" ?>public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
3335
{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
34-
//Method inherited from <?= $method->getDeclaringClass() ?>
35-
<?php endif; ?>
36+
<?= "\n" . $s3?>//Method inherited from <?= $method->getDeclaringClass() ?>
37+
<?php endif; ?>
3638

37-
<?php if ($method->isInstanceCall()) : ?>
38-
/** @var <?=$method->getRoot()?> $instance */
39-
<?php endif?>
40-
<?= $method->shouldReturn() ? 'return ' : '' ?><?= $method->getRootMethodCall() ?>;
39+
<?php if ($method->isInstanceCall()) : ?>
40+
<?= $s3 ?>/** @var <?=$method->getRoot()?> $instance */
41+
<?php endif?>
42+
<?= $s3 . ($method->shouldReturn() ? 'return ' : '') ?><?= $method->getRootMethodCall() ?>;
4143
}
44+
4245
<?php endforeach; ?>
4346
}
4447
<?php endforeach; ?>
@@ -48,26 +51,27 @@ public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefau
4851

4952
<?php foreach ($namespaces_by_alias_ns as $namespace => $aliases) : ?>
5053
namespace <?= $namespace === '__root' ? '' : trim($namespace, '\\') ?> {
51-
<?php foreach ($aliases as $alias) : ?>
52-
<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
53-
<?= $alias->getPhpDocTemplates(' ') ?>
54-
<?php endif?>
55-
<?= $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
56-
<?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; ?>
54+
<?php foreach ($aliases as $alias) : ?>
55+
<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
56+
<?= "\n" . $alias->getPhpDocTemplates($s1) . "\n" ?>
57+
<?php endif?>
58+
<?= $s1 . $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() === '\Illuminate\Database\Eloquent') : ?>
59+
<?php foreach ($alias->getMethods() as $method) : ?>
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

63-
<?php if ($method->isInstanceCall()) : ?>
64-
/** @var <?=$method->getRoot()?> $instance */
65-
<?php endif?>
66-
<?= $method->shouldReturn() ? 'return ' : '' ?><?= $method->getRootMethodCall() ?>;
67-
}
68-
<?php endforeach; ?>
69-
<?php endif; ?>}
70-
<?php endforeach; ?>
66+
<?php if ($method->isInstanceCall()) : ?>
67+
<?= $s3 ?>/** @var <?=$method->getRoot()?> $instance */
68+
<?php endif?>
69+
<?= $s3 . ($method->shouldReturn() ? 'return ' : '') ?><?= $method->getRootMethodCall() ?>;
70+
<?= $s2 ?>}
71+
72+
<?php endforeach; ?>
73+
<?php endif; ?>}
74+
<?php endforeach; ?>
7175
}
7276

7377
<?php endforeach; ?>

0 commit comments

Comments
 (0)