mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
* composer require --dev friendsofphp/php-cs-fixer:^2 * php-cs-fixer: ignore cache and custom local config file * php-cs-fixer: initial config * php-cs-fixer: replace commands in composer * php-cs-fixer: add PSR12 "as good as it currently gets" * php-cs-fixer: apply PSR12 to codebase * tests: add workaround to keep unused imports for snapshot testing * php-cs-fixer: apply no_unused_imports * php-cs-fixer: apply array_syntax short * php-cs-fixer: apply single_quote * php-cs-fixer: switch ordered_imports sort_algorithm to alpha Let's be opinionated here for consistency * php-cs-fixer: split between non-tests and tests and share config * php-cs-fixer: apply declare_strict_types for tests * php-cs-fixer: apply fully_qualified_strict_types * php-cs-fixer: apply space_after_semicolon * php-cs-fixer: apply trailing_comma_in_multiline_array * php-cs-fixer: apply trim_array_spaces * php-cs-fixer: apply unary_operator_spaces * php-cs-fixer: apply whitespace_after_comma_in_array * php-cs-fixer: apply native_function_invocation * php-cs-fixer: apply concat_space * grumphp: reflect we're using phpcsfixer now * composer remove --dev squizlabs/php_codesniffer * gha: simplify fix-style approach Not really necessary to remove packages and then manually prevent unrelated commits creeping in Co-authored-by: Barry vd. Heuvel <[email protected]>
47 lines
1.2 KiB
PHP
47 lines
1.2 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqn\Models;
|
|
|
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqn\Casts\CastType;
|
|
use Eloquent;
|
|
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
|
use Illuminate\Database\Eloquent\Collection;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
use Illuminate\Database\Query\Builder as QueryBuilder;
|
|
use Illuminate\Support\Carbon;
|
|
|
|
class Post extends Model
|
|
{
|
|
use SoftDeletes;
|
|
|
|
/**
|
|
* Special hack to avoid code style fixer removing unused imports
|
|
* which play a role when generating the snapshot
|
|
*/
|
|
private $hack = [
|
|
Carbon::class,
|
|
Collection::class,
|
|
Eloquent::class,
|
|
EloquentBuilder::class,
|
|
QueryBuilder::class,
|
|
];
|
|
|
|
protected $casts = [
|
|
'char_not_nullable' => CastType::class,
|
|
];
|
|
|
|
public function posts(): HasMany
|
|
{
|
|
return $this->hasMany(Post::class);
|
|
}
|
|
|
|
public function scopeNull($query, string $unusedParam)
|
|
{
|
|
return $query;
|
|
}
|
|
}
|