[PHPCS] Extend to check/fix all source code and turn GHA into auto-commit fixer (#1003)

* phpcs: enable also for config, resources and tests

* composer fix-style

* vendor/bin/phpunit -d --update-snapshots

* gha: instead of checking the style, fix and auto-commit it 💪
This commit is contained in:
Markus Podar
2020-08-10 10:22:48 +02:00
committed by GitHub
parent 4b459d3e82
commit ba95d18ef5
74 changed files with 249 additions and 119 deletions
+30 -33
View File
@@ -20,66 +20,63 @@
* @see https://github.com/barryvdh/laravel-ide-helper
*/
<?php foreach($namespaces_by_extends_ns as $namespace => $aliases): ?>
<?php if ($namespace == '\Illuminate\Database\Eloquent'): continue; endif; ?>
<?php foreach ($namespaces_by_extends_ns as $namespace => $aliases) : ?>
<?php if ($namespace == '\Illuminate\Database\Eloquent') :
continue;
endif; ?>
namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
<?php foreach($aliases as $alias): ?>
<?= trim($alias->getDocComment(' ')) ?>
<?= $alias->getClassType() ?> <?= $alias->getExtendsClass() ?> {
<?php foreach($alias->getMethods() as $method): ?>
<?= trim($method->getDocComment(' ')) ?>
<?php foreach ($aliases as $alias) : ?>
<?= trim($alias->getDocComment(' ')) ?>
<?= $alias->getClassType() ?> <?= $alias->getExtendsClass() ?> {
<?php foreach ($alias->getMethods() as $method) : ?>
<?= trim($method->getDocComment(' ')) ?>
public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
{<?php if($method->getDeclaringClass() !== $method->getRoot()): ?>
{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
//Method inherited from <?= $method->getDeclaringClass() ?>
<?php endif; ?>
<?php endif; ?>
<?php if($method->isInstanceCall()):?>
<?php if ($method->isInstanceCall()) :?>
/** @var <?=$method->getRoot()?> $instance */
<?php endif?>
<?= $method->shouldReturn() ? 'return ': '' ?><?= $method->getRootMethodCall() ?>;
<?= $method->shouldReturn() ? 'return ' : '' ?><?= $method->getRootMethodCall() ?>;
}
<?php endforeach; ?>
}
<?php endforeach; ?>
<?php endforeach; ?>
}
<?php endforeach; ?>
<?php foreach($namespaces_by_alias_ns as $namespace => $aliases): ?>
<?php foreach ($namespaces_by_alias_ns as $namespace => $aliases) : ?>
namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
<?php foreach($aliases as $alias): ?>
<?= $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() == '\Illuminate\Database\Eloquent'): ?>
<?php foreach($alias->getMethods() as $method): ?>
<?= trim($method->getDocComment(' ')) ?>
<?php foreach ($aliases as $alias) : ?>
<?= $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() == '\Illuminate\Database\Eloquent') : ?>
<?php foreach ($alias->getMethods() as $method) : ?>
<?= trim($method->getDocComment(' ')) ?>
public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
{<?php if($method->getDeclaringClass() !== $method->getRoot()): ?>
{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
//Method inherited from <?= $method->getDeclaringClass() ?>
<?php endif; ?>
<?php endif; ?>
<?php if($method->isInstanceCall()):?>
<?php if ($method->isInstanceCall()) :?>
/** @var <?=$method->getRoot()?> $instance */
<?php endif?>
<?= $method->shouldReturn() ? 'return ': '' ?><?= $method->getRootMethodCall() ?>;
<?= $method->shouldReturn() ? 'return ' : '' ?><?= $method->getRootMethodCall() ?>;
}
<?php endforeach; ?>
<?php endif; ?>}
<?php endforeach; ?>
<?php endforeach; ?>
<?php endif; ?>}
<?php endforeach; ?>
}
<?php endforeach; ?>
<?php if($helpers): ?>
<?php if ($helpers) : ?>
namespace {
<?= $helpers ?>
<?= $helpers ?>
}
<?php endif; ?>
<?php if($include_fluent): ?>
<?php if ($include_fluent) : ?>
namespace Illuminate\Support {
/**
* Methods commonly used in migrations
@@ -106,7 +103,7 @@ namespace Illuminate\Support {
}
<?php endif ?>
<?php foreach ($factories as $factory): ?>
<?php foreach ($factories as $factory) : ?>
namespace <?=$factory->getNamespaceName()?> {
/**
* @method \Illuminate\Database\Eloquent\Collection|<?=$factory->getShortName()?>[]|<?=$factory->getShortName()?> create($attributes = [])
+8 -8
View File
@@ -10,22 +10,22 @@ namespace PHPSTORM_META {
* @author Barry vd. Heuvel <[email protected]>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
<?php foreach ($methods as $method): ?>
<?php foreach ($methods as $method) : ?>
override(<?= $method ?>, map([
'' => '@',
<?php foreach($bindings as $abstract => $class): ?>
<?php foreach ($bindings as $abstract => $class) : ?>
'<?= $abstract ?>' => \<?= $class ?>::class,
<?php endforeach; ?>
<?php endforeach; ?>
]));
<?php endforeach; ?>
<?php if (count($factories)): ?>
override(\factory(0), map([
<?php if (count($factories)) : ?>
override(\factory(0), map([
'' => '@FactoryBuilder',
<?php foreach($factories as $factory): ?>
<?php foreach ($factories as $factory) : ?>
'<?= $factory->getName() ?>' => \<?= $factory->getName() ?>FactoryBuilder::class,
<?php endforeach; ?>
]));
<?php endforeach; ?>
]));
<?php endif; ?>
override(\Illuminate\Support\Arr::add(0), type(0));