mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
[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:
@@ -39,8 +39,8 @@ jobs:
|
|||||||
- name: Execute Unit Tests
|
- name: Execute Unit Tests
|
||||||
run: composer test
|
run: composer test
|
||||||
|
|
||||||
check-style:
|
fix-style:
|
||||||
name: Check Code Style
|
name: Fix Code Style
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
env:
|
env:
|
||||||
@@ -55,10 +55,20 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
php-version: 7.4
|
php-version: 7.4
|
||||||
coverage: none
|
coverage: none
|
||||||
|
tools: composer:v2
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
composer remove phpro/grumphp vimeo/psalm --no-update --dev
|
composer remove phpro/grumphp vimeo/psalm --no-update --dev
|
||||||
composer update --prefer-dist --no-suggest --no-progress
|
composer update --prefer-dist --no-suggest --no-progress
|
||||||
|
|
||||||
- run: composer check-style
|
- run: composer fix-style
|
||||||
|
continue-on-error: true
|
||||||
|
|
||||||
|
# Revert modifications so they don't get commited 💥
|
||||||
|
- run: git checkout -- composer.json
|
||||||
|
|
||||||
|
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||||
|
with:
|
||||||
|
commit_message: composer fix-style
|
||||||
|
commit_author: laravel-ide-helper <[email protected]>
|
||||||
|
|||||||
+2
-2
@@ -64,8 +64,8 @@
|
|||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"analyze": "psalm",
|
"analyze": "psalm",
|
||||||
"check-style": "phpcs -p --standard=PSR12 src/",
|
"check-style": "phpcs -p --standard=PSR12 config/ resources/ src/ tests/ '--ignore=*__snapshots_*'",
|
||||||
"fix-style": "phpcbf -p --standard=PSR12 src/",
|
"fix-style": "phpcbf -p --standard=PSR12 config/ resources/ src/ tests/ '--ignore=*__snapshots_*'",
|
||||||
"test": "phpunit",
|
"test": "phpunit",
|
||||||
"test-regenerate": "phpunit -d --update-snapshots"
|
"test-regenerate": "phpunit -d --update-snapshots"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ return array(
|
|||||||
'include_helpers' => false,
|
'include_helpers' => false,
|
||||||
|
|
||||||
'helper_files' => array(
|
'helper_files' => array(
|
||||||
base_path().'/vendor/laravel/framework/src/Illuminate/Support/helpers.php',
|
base_path() . '/vendor/laravel/framework/src/Illuminate/Support/helpers.php',
|
||||||
),
|
),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
+30
-33
@@ -20,66 +20,63 @@
|
|||||||
* @see https://github.com/barryvdh/laravel-ide-helper
|
* @see https://github.com/barryvdh/laravel-ide-helper
|
||||||
*/
|
*/
|
||||||
|
|
||||||
<?php foreach($namespaces_by_extends_ns as $namespace => $aliases): ?>
|
<?php foreach ($namespaces_by_extends_ns as $namespace => $aliases) : ?>
|
||||||
<?php if ($namespace == '\Illuminate\Database\Eloquent'): continue; endif; ?>
|
<?php if ($namespace == '\Illuminate\Database\Eloquent') :
|
||||||
|
continue;
|
||||||
|
endif; ?>
|
||||||
namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
|
namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
|
||||||
<?php foreach($aliases as $alias): ?>
|
<?php foreach ($aliases as $alias) : ?>
|
||||||
|
<?= trim($alias->getDocComment(' ')) ?>
|
||||||
<?= trim($alias->getDocComment(' ')) ?>
|
<?= $alias->getClassType() ?> <?= $alias->getExtendsClass() ?> {
|
||||||
<?= $alias->getClassType() ?> <?= $alias->getExtendsClass() ?> {
|
<?php foreach ($alias->getMethods() as $method) : ?>
|
||||||
<?php foreach($alias->getMethods() as $method): ?>
|
<?= trim($method->getDocComment(' ')) ?>
|
||||||
|
|
||||||
<?= trim($method->getDocComment(' ')) ?>
|
|
||||||
public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
|
public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
|
||||||
{<?php if($method->getDeclaringClass() !== $method->getRoot()): ?>
|
{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
|
||||||
|
|
||||||
//Method inherited from <?= $method->getDeclaringClass() ?>
|
//Method inherited from <?= $method->getDeclaringClass() ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($method->isInstanceCall()):?>
|
<?php if ($method->isInstanceCall()) :?>
|
||||||
/** @var <?=$method->getRoot()?> $instance */
|
/** @var <?=$method->getRoot()?> $instance */
|
||||||
<?php endif?>
|
<?php endif?>
|
||||||
<?= $method->shouldReturn() ? 'return ': '' ?><?= $method->getRootMethodCall() ?>;
|
<?= $method->shouldReturn() ? 'return ' : '' ?><?= $method->getRootMethodCall() ?>;
|
||||||
}
|
}
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
}
|
}
|
||||||
<?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, '\\') ?> {
|
namespace <?= $namespace == '__root' ? '' : trim($namespace, '\\') ?> {
|
||||||
<?php foreach($aliases as $alias): ?>
|
<?php foreach ($aliases as $alias) : ?>
|
||||||
|
<?= $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() == '\Illuminate\Database\Eloquent') : ?>
|
||||||
<?= $alias->getClassType() ?> <?= $alias->getShortName() ?> extends <?= $alias->getExtends() ?> {<?php if ($alias->getExtendsNamespace() == '\Illuminate\Database\Eloquent'): ?>
|
<?php foreach ($alias->getMethods() as $method) : ?>
|
||||||
<?php foreach($alias->getMethods() as $method): ?>
|
<?= trim($method->getDocComment(' ')) ?>
|
||||||
<?= trim($method->getDocComment(' ')) ?>
|
|
||||||
public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
|
public static function <?= $method->getName() ?>(<?= $method->getParamsWithDefault() ?>)
|
||||||
{<?php if($method->getDeclaringClass() !== $method->getRoot()): ?>
|
{<?php if ($method->getDeclaringClass() !== $method->getRoot()) : ?>
|
||||||
|
|
||||||
//Method inherited from <?= $method->getDeclaringClass() ?>
|
//Method inherited from <?= $method->getDeclaringClass() ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($method->isInstanceCall()):?>
|
<?php if ($method->isInstanceCall()) :?>
|
||||||
/** @var <?=$method->getRoot()?> $instance */
|
/** @var <?=$method->getRoot()?> $instance */
|
||||||
<?php endif?>
|
<?php endif?>
|
||||||
<?= $method->shouldReturn() ? 'return ': '' ?><?= $method->getRootMethodCall() ?>;
|
<?= $method->shouldReturn() ? 'return ' : '' ?><?= $method->getRootMethodCall() ?>;
|
||||||
}
|
}
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php endif; ?>}
|
<?php endif; ?>}
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
}
|
}
|
||||||
|
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
<?php if($helpers): ?>
|
<?php if ($helpers) : ?>
|
||||||
namespace {
|
namespace {
|
||||||
<?= $helpers ?>
|
<?= $helpers ?>
|
||||||
}
|
}
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if($include_fluent): ?>
|
<?php if ($include_fluent) : ?>
|
||||||
namespace Illuminate\Support {
|
namespace Illuminate\Support {
|
||||||
/**
|
/**
|
||||||
* Methods commonly used in migrations
|
* Methods commonly used in migrations
|
||||||
@@ -106,7 +103,7 @@ namespace Illuminate\Support {
|
|||||||
}
|
}
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
|
||||||
<?php foreach ($factories as $factory): ?>
|
<?php foreach ($factories as $factory) : ?>
|
||||||
namespace <?=$factory->getNamespaceName()?> {
|
namespace <?=$factory->getNamespaceName()?> {
|
||||||
/**
|
/**
|
||||||
* @method \Illuminate\Database\Eloquent\Collection|<?=$factory->getShortName()?>[]|<?=$factory->getShortName()?> create($attributes = [])
|
* @method \Illuminate\Database\Eloquent\Collection|<?=$factory->getShortName()?>[]|<?=$factory->getShortName()?> create($attributes = [])
|
||||||
|
|||||||
@@ -10,22 +10,22 @@ namespace PHPSTORM_META {
|
|||||||
* @author Barry vd. Heuvel <[email protected]>
|
* @author Barry vd. Heuvel <[email protected]>
|
||||||
* @see https://github.com/barryvdh/laravel-ide-helper
|
* @see https://github.com/barryvdh/laravel-ide-helper
|
||||||
*/
|
*/
|
||||||
<?php foreach ($methods as $method): ?>
|
<?php foreach ($methods as $method) : ?>
|
||||||
override(<?= $method ?>, map([
|
override(<?= $method ?>, map([
|
||||||
'' => '@',
|
'' => '@',
|
||||||
<?php foreach($bindings as $abstract => $class): ?>
|
<?php foreach ($bindings as $abstract => $class) : ?>
|
||||||
'<?= $abstract ?>' => \<?= $class ?>::class,
|
'<?= $abstract ?>' => \<?= $class ?>::class,
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
]));
|
]));
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
<?php if (count($factories)): ?>
|
<?php if (count($factories)) : ?>
|
||||||
override(\factory(0), map([
|
override(\factory(0), map([
|
||||||
'' => '@FactoryBuilder',
|
'' => '@FactoryBuilder',
|
||||||
<?php foreach($factories as $factory): ?>
|
<?php foreach ($factories as $factory) : ?>
|
||||||
'<?= $factory->getName() ?>' => \<?= $factory->getName() ?>FactoryBuilder::class,
|
'<?= $factory->getName() ?>' => \<?= $factory->getName() ?>FactoryBuilder::class,
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
]));
|
]));
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
override(\Illuminate\Support\Arr::add(0), type(0));
|
override(\Illuminate\Support\Arr::add(0), type(0));
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomCollection\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomCollection\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomCollection;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomCollection;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomCollection\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomCollection\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdoc\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdoc\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdoc;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdoc;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdoc\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdoc\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocCamel\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocCamel\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocCamel;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocCamel;
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocCamel\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocCamel\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocFinal\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocFinal\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocFinal;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocFinal;
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocFinal\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhpdocFinal\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqn\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqn\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqn;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqn;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqn\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqn\Models;
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Builders;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Getter\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Getter\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Getter;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Getter;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Getter\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Getter\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Ignored\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Ignored\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Ignored\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Ignored\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Ignored;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Ignored;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Ignored\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Ignored\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Interfaces\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Interfaces\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Interfaces;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Interfaces;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts;
|
||||||
|
|
||||||
@@ -39,7 +41,7 @@ class Test extends AbstractModelsCommand
|
|||||||
$mockFilesystem = Mockery::mock(Filesystem::class);
|
$mockFilesystem = Mockery::mock(Filesystem::class);
|
||||||
$mockFilesystem
|
$mockFilesystem
|
||||||
->shouldReceive('get')
|
->shouldReceive('get')
|
||||||
->andReturn(file_get_contents(__DIR__.'/Models/CustomCast.php'))
|
->andReturn(file_get_contents(__DIR__ . '/Models/CustomCast.php'))
|
||||||
->once();
|
->once();
|
||||||
$mockFilesystem
|
$mockFilesystem
|
||||||
->shouldReceive('put')
|
->shouldReceive('put')
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\MagicWhere\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\MagicWhere\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\MagicWhere;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\MagicWhere;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\MagicWhere\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\MagicWhere\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PHPStormNoInspection\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PHPStormNoInspection\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PHPStormNoInspection;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PHPStormNoInspection;
|
||||||
|
|
||||||
@@ -6,6 +8,7 @@ use Barryvdh\LaravelIdeHelper\Console\ModelsCommand;
|
|||||||
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand;
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand;
|
||||||
use Illuminate\Filesystem\Filesystem;
|
use Illuminate\Filesystem\Filesystem;
|
||||||
use Mockery;
|
use Mockery;
|
||||||
|
|
||||||
use function file_get_contents;
|
use function file_get_contents;
|
||||||
|
|
||||||
class Test extends AbstractModelsCommand
|
class Test extends AbstractModelsCommand
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PHPStormNoInspection\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PHPStormNoInspection\Models;
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PHPStormNoInspection\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PHPStormNoInspection\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\RelationCountProperties\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\RelationCountProperties\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\RelationCountProperties;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\RelationCountProperties;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\RelationCountProperties\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\RelationCountProperties\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\ModelsOtherNamespace;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\ModelsOtherNamespace;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Relations\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ResetAndSmartReset\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ResetAndSmartReset\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ResetAndSmartReset;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ResetAndSmartReset;
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ResetAndSmartReset\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ResetAndSmartReset\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ResetAndSmartReset\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ResetAndSmartReset\Models;
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ResetAndSmartReset\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ResetAndSmartReset\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SoftDeletes\Models;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class ExampleTest extends TestCase
|
|||||||
*/';
|
*/';
|
||||||
$this->assertSame($output, $method->getDocComment(''));
|
$this->assertSame($output, $method->getDocComment(''));
|
||||||
$this->assertSame('setName', $method->getName());
|
$this->assertSame('setName', $method->getName());
|
||||||
$this->assertSame('\\'.ExampleClass::class, $method->getDeclaringClass());
|
$this->assertSame('\\' . ExampleClass::class, $method->getDeclaringClass());
|
||||||
$this->assertSame('$last, $first, ...$middle', $method->getParams(true));
|
$this->assertSame('$last, $first, ...$middle', $method->getParams(true));
|
||||||
$this->assertSame(['$last', '$first', '...$middle'], $method->getParams(false));
|
$this->assertSame(['$last', '$first', '...$middle'], $method->getParams(false));
|
||||||
$this->assertSame('$last, $first = \'Barry\', ...$middle', $method->getParamsWithDefault(true));
|
$this->assertSame('$last, $first = \'Barry\', ...$middle', $method->getParamsWithDefault(true));
|
||||||
@@ -68,7 +68,7 @@ class ExampleTest extends TestCase
|
|||||||
*/';
|
*/';
|
||||||
$this->assertSame($output, $method->getDocComment(''));
|
$this->assertSame($output, $method->getDocComment(''));
|
||||||
$this->assertSame('with', $method->getName());
|
$this->assertSame('with', $method->getName());
|
||||||
$this->assertSame('\\'.Builder::class, $method->getDeclaringClass());
|
$this->assertSame('\\' . Builder::class, $method->getDeclaringClass());
|
||||||
$this->assertSame('$relations', $method->getParams(true));
|
$this->assertSame('$relations', $method->getParams(true));
|
||||||
$this->assertSame(['$relations'], $method->getParams(false));
|
$this->assertSame(['$relations'], $method->getParams(false));
|
||||||
$this->assertSame('$relations', $method->getParamsWithDefault(true));
|
$this->assertSame('$relations', $method->getParamsWithDefault(true));
|
||||||
|
|||||||
+3
-1
@@ -1,4 +1,6 @@
|
|||||||
<?php declare(strict_types=1);
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests;
|
namespace Barryvdh\LaravelIdeHelper\Tests;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user