21
21
* @author Barry vd. Heuvel <
[email protected] >
22
22
* @see https://github.com/barryvdh/laravel-ide-helper
23
23
*/
24
-
24
+ <?php
25
+ $ s1 = ' ' ;
26
+ $ s2 = $ s1 . $ s1 ;
27
+ $ s3 = $ s1 . $ s2 ;
28
+ ?>
25
29
<?php foreach ($ namespaces_by_extends_ns as $ namespace => $ aliases ) : ?>
26
30
namespace <?= $ namespace === '__root ' ? '' : trim ($ namespace , '\\' ) ?> {
27
31
<?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 () ?> {
30
33
<?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 () ?> )
33
35
{<?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 ; ?>
36
38
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 () ?> ;
41
43
}
44
+
42
45
<?php endforeach ; ?>
43
46
}
44
47
<?php endforeach ; ?>
@@ -48,26 +51,27 @@ public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefau
48
51
49
52
<?php foreach ($ namespaces_by_alias_ns as $ namespace => $ aliases ) : ?>
50
53
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 ; ?>
62
65
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 ; ?>
71
75
}
72
76
73
77
<?php endforeach ; ?>
0 commit comments