mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3d1998428e | ||
|
|
ef890b87ce | ||
|
|
232d7acf6f |
+3
-1
@@ -6,7 +6,9 @@
|
|||||||
/.gitattributes export-ignore
|
/.gitattributes export-ignore
|
||||||
/.github export-ignore
|
/.github export-ignore
|
||||||
/.gitignore export-ignore
|
/.gitignore export-ignore
|
||||||
/.php-cs-fixer* export-ignore
|
/.php-cs-fixer.cache export-ignore
|
||||||
|
/.php-cs-fixer.php export-ignore
|
||||||
|
/.php-cs-fixer.tests.cache export-ignore
|
||||||
/phpunit.xml.dist export-ignore
|
/phpunit.xml.dist export-ignore
|
||||||
/psalm-baseline.xml export-ignore
|
/psalm-baseline.xml export-ignore
|
||||||
/psalm.xml export-ignore
|
/psalm.xml export-ignore
|
||||||
|
|||||||
@@ -23,6 +23,6 @@ jobs:
|
|||||||
composer global require ergebnis/composer-normalize
|
composer global require ergebnis/composer-normalize
|
||||||
composer normalize
|
composer normalize
|
||||||
|
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v6
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
commit_message: normalize composer.json
|
commit_message: normalize composer.json
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ jobs:
|
|||||||
- run: composer fix-style
|
- run: composer fix-style
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
|
||||||
- uses: stefanzweifel/git-auto-commit-action@v6
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
commit_message: composer fix-style
|
commit_message: composer fix-style
|
||||||
commit_author: laravel-ide-helper <[email protected]>
|
commit_author: laravel-ide-helper <[email protected]>
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ jobs:
|
|||||||
release-notes: ${{ github.event.release.body }}
|
release-notes: ${{ github.event.release.body }}
|
||||||
|
|
||||||
- name: Commit updated CHANGELOG
|
- name: Commit updated CHANGELOG
|
||||||
uses: stefanzweifel/git-auto-commit-action@v6
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
branch: ${{ github.event.release.target_commitish }}
|
branch: ${{ github.event.release.target_commitish }}
|
||||||
commit_message: Update CHANGELOG
|
commit_message: Update CHANGELOG
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^8.2",
|
"php": "^8.2",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"barryvdh/reflection-docblock": "^2.4",
|
"barryvdh/reflection-docblock": "^2.3",
|
||||||
"composer/class-map-generator": "^1.0",
|
"composer/class-map-generator": "^1.0",
|
||||||
"illuminate/console": "^11.15 || ^12",
|
"illuminate/console": "^11.15 || ^12",
|
||||||
"illuminate/database": "^11.15 || ^12",
|
"illuminate/database": "^11.15 || ^12",
|
||||||
|
|||||||
@@ -410,6 +410,9 @@ class ModelsCommand extends Command
|
|||||||
$params = [];
|
$params = [];
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
|
case 'encrypted':
|
||||||
|
$realType = 'mixed';
|
||||||
|
break;
|
||||||
case 'boolean':
|
case 'boolean':
|
||||||
case 'bool':
|
case 'bool':
|
||||||
$realType = 'bool';
|
$realType = 'bool';
|
||||||
@@ -417,7 +420,6 @@ class ModelsCommand extends Command
|
|||||||
case 'decimal':
|
case 'decimal':
|
||||||
$realType = 'numeric';
|
$realType = 'numeric';
|
||||||
break;
|
break;
|
||||||
case 'encrypted':
|
|
||||||
case 'string':
|
case 'string':
|
||||||
case 'hashed':
|
case 'hashed':
|
||||||
$realType = 'string';
|
$realType = 'string';
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\GeneratorCommand;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\GeneratorCommand;
|
||||||
|
|
||||||
use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider;
|
use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider;
|
||||||
|
use Barryvdh\LaravelIdeHelper\Tests\SnapshotPhpDriver;
|
||||||
use Barryvdh\LaravelIdeHelper\Tests\TestCase;
|
use Barryvdh\LaravelIdeHelper\Tests\TestCase;
|
||||||
|
|
||||||
abstract class AbstractGeneratorCommand extends TestCase
|
abstract class AbstractGeneratorCommand extends TestCase
|
||||||
@@ -26,4 +27,9 @@ abstract class AbstractGeneratorCommand extends TestCase
|
|||||||
{
|
{
|
||||||
return [IdeHelperServiceProvider::class];
|
return [IdeHelperServiceProvider::class];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function assertMatchesMockedSnapshot()
|
||||||
|
{
|
||||||
|
$this->assertMatchesSnapshot($this->mockFilesystemOutput, new SnapshotPhpDriver());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
|||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand;
|
||||||
|
|
||||||
use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider;
|
use Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider;
|
||||||
|
use Barryvdh\LaravelIdeHelper\Tests\SnapshotPhpDriver;
|
||||||
use Barryvdh\LaravelIdeHelper\Tests\TestCase;
|
use Barryvdh\LaravelIdeHelper\Tests\TestCase;
|
||||||
|
|
||||||
abstract class AbstractModelsCommand extends TestCase
|
abstract class AbstractModelsCommand extends TestCase
|
||||||
@@ -51,4 +52,9 @@ abstract class AbstractModelsCommand extends TestCase
|
|||||||
// Don't override integer -> int for tests
|
// Don't override integer -> int for tests
|
||||||
$config->set('ide-helper.type_overrides', []);
|
$config->set('ide-helper.type_overrides', []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function assertMatchesMockedSnapshot()
|
||||||
|
{
|
||||||
|
$this->assertMatchesSnapshot($this->mockFilesystemOutput, new SnapshotPhpDriver());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ use Illuminate\Database\Eloquent\Casts\AsEnumCollection;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property \Illuminate\Support\Carbon $cast_to_date_serialization
|
* @property \Illuminate\Support\Carbon $cast_to_date_serialization
|
||||||
* @property \Illuminate\Support\Carbon $cast_to_datetime_serialization
|
* @property \Illuminate\Support\Carbon $cast_to_datetime_serialization
|
||||||
* @property \Illuminate\Support\Carbon $cast_to_custom_datetime
|
* @property \Illuminate\Support\Carbon $cast_to_custom_datetime
|
||||||
@@ -20,7 +22,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property \Carbon\CarbonImmutable $cast_to_immutable_custom_datetime
|
* @property \Carbon\CarbonImmutable $cast_to_immutable_custom_datetime
|
||||||
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime
|
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime
|
||||||
* @property int $cast_to_timestamp
|
* @property int $cast_to_timestamp
|
||||||
* @property string $cast_to_encrypted
|
* @property mixed $cast_to_encrypted
|
||||||
* @property array<array-key, mixed> $cast_to_encrypted_array
|
* @property array<array-key, mixed> $cast_to_encrypted_array
|
||||||
* @property \Illuminate\Support\Collection<array-key, mixed> $cast_to_encrypted_collection
|
* @property \Illuminate\Support\Collection<array-key, mixed> $cast_to_encrypted_collection
|
||||||
* @property array<array-key, mixed> $cast_to_encrypted_json
|
* @property array<array-key, mixed> $cast_to_encrypted_json
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AllowGlobDirecto
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ArrayCastsWithCo
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property array<int, string>|null $cast_to_array -- These three should not be duplicated
|
* @property array<int, string>|null $cast_to_array -- These three should not be duplicated
|
||||||
* @property array<int, string> $cast_to_json some-description
|
* @property array<int, string> $cast_to_json some-description
|
||||||
* @property \Illuminate\Support\Collection<int, string> $cast_to_collection some-description
|
* @property \Illuminate\Support\Collection<int, string> $cast_to_collection some-description
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $name
|
* @property string|null $name
|
||||||
* @property string|null $name_read
|
* @property string|null $name_read
|
||||||
@@ -83,6 +85,8 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property int $diverging_type_hinted_get_and_set
|
* @property int $diverging_type_hinted_get_and_set
|
||||||
* @property string|null $name
|
* @property string|null $name
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ use Illuminate\Database\Eloquent\Relations\HasOne;
|
|||||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string $both_same_name I'm a getter
|
* @property string $both_same_name I'm a getter
|
||||||
* @property string $both_without_getter_comment
|
* @property string $both_without_getter_comment
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property-read SimpleCollection<int, Simple> $relationHasMany
|
* @property-read SimpleCollection<int, Simple> $relationHasMany
|
||||||
* @property-read int|null $relation_has_many_count
|
* @property-read int|null $relation_has_many_count
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate\Model
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property \Carbon\CarbonImmutable|null $created_at
|
* @property \Carbon\CarbonImmutable|null $created_at
|
||||||
* @property \Carbon\CarbonImmutable|null $updated_at
|
* @property \Carbon\CarbonImmutable|null $updated_at
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|CustomDate newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|CustomDate newModelQuery()
|
||||||
|
|||||||
+2
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DoesNotGeneratePhpdocWithExternalEloquentBuilder\Models{
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DoesNotGeneratePhpdocWithExternalEloquentBuilder\Models{
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Dynamic> $regularHasMany
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Dynamic> $regularHasMany
|
||||||
* @property-read int|null $regular_has_many_count
|
* @property-read int|null $regular_has_many_count
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Dynamic newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Dynamic newModelQuery()
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\CustomSpace\ModelWithCustomNamespaceFactory factory($count = null, $state = [])
|
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\CustomSpace\ModelWithCustomNamespaceFactory factory($count = null, $state = [])
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithCustomNamespace newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithCustomNamespace newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithCustomNamespace newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithCustomNamespace newQuery()
|
||||||
@@ -39,6 +41,8 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Factories\ModelWithFactoryFactory factory($count = null, $state = [])
|
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Factories\ModelWithFactoryFactory factory($count = null, $state = [])
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithFactory newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithFactory newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithFactory newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithFactory newQuery()
|
||||||
@@ -56,6 +60,8 @@ declare(strict_types=1);
|
|||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Factories\ModelWithNestedFactoryFactory factory($count = null, $state = [])
|
* @method static \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Factories\Factories\ModelWithNestedFactoryFactory factory($count = null, $state = [])
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithNestedFactory newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithNestedFactory newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithNestedFactory newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithNestedFactory newQuery()
|
||||||
@@ -75,6 +81,8 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithoutFactory newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithoutFactory newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithoutFactory newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithoutFactory newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithoutFactory query()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithoutFactory query()
|
||||||
|
|||||||
+2
@@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhp
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhp
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $charNullable
|
* @property string|null $charNullable
|
||||||
* @property string $charNotNullable
|
* @property string $charNotNullable
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateBasicPhp
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
@@ -67,6 +67,8 @@ class WithCollection extends Model
|
|||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateMixinCollection\Models{
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateMixinCollection\Models{
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property-read \Illuminate\Support\Collection<int, string> $collection
|
* @property-read \Illuminate\Support\Collection<int, string> $collection
|
||||||
* @property-read \Illuminate\Support\Collection<\Illuminate\Support\Collection, \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateMixinCollection\NonModels\CollectionModel<\Illuminate\Support\Collection, \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateMixinCollection\NonModels\CollectionModel<int, \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateMixinCollection\NonModels\NonModel>>> $collection_with_nested_template
|
* @property-read \Illuminate\Support\Collection<\Illuminate\Support\Collection, \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateMixinCollection\NonModels\CollectionModel<\Illuminate\Support\Collection, \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateMixinCollection\NonModels\CollectionModel<int, \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateMixinCollection\NonModels\NonModel>>> $collection_with_nested_template
|
||||||
* @property-read \Illuminate\Support\Collection<int, \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateMixinCollection\NonModels\NonModel> $collection_with_non_model_template
|
* @property-read \Illuminate\Support\Collection<int, \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GenerateMixinCollection\NonModels\NonModel> $collection_with_non_model_template
|
||||||
|
|||||||
+2
@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static Builder<static>|Comment newModelQuery()
|
* @method static Builder<static>|Comment newModelQuery()
|
||||||
* @method static Builder<static>|Comment newQuery()
|
* @method static Builder<static>|Comment newQuery()
|
||||||
* @method static Builder<static>|Comment query()
|
* @method static Builder<static>|Comment query()
|
||||||
|
|||||||
+2
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Models{
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExternalEloquentBuilder\Models{
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
+2
@@ -8,6 +8,8 @@ use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithExte
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
+2
@@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ use Illuminate\Database\Query\Builder as QueryBuilder;
|
|||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property CastType $char_not_nullable
|
* @property CastType $char_not_nullable
|
||||||
|
|||||||
+2
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Models{
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithFqnInExternalFile\Models{
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ class Post extends Model
|
|||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithMixin\Models{
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithMixin\Models{
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property $someProp
|
* @property $someProp
|
||||||
* @method someMethod(string $method)
|
* @method someMethod(string $method)
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|FinalPost newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|FinalPost newModelQuery()
|
||||||
@@ -58,6 +60,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWi
|
|||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithMixin\Models{
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithMixin\Models{
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property $someProp
|
* @property $someProp
|
||||||
* @method someMethod(string $method)
|
* @method someMethod(string $method)
|
||||||
* @property int $id
|
* @property int $id
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
|||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection|Simple[] $regularBelongsToMany
|
* @property-read \Illuminate\Database\Eloquent\Collection|Simple[] $regularBelongsToMany
|
||||||
* @property-read int|null $regular_belongs_to_many_count
|
* @property-read int|null $regular_belongs_to_many_count
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use DateTime;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property-read int|null $attribute_return_type_int_or_null
|
* @property-read int|null $attribute_return_type_int_or_null
|
||||||
* @property-read array $attribute_returns_array
|
* @property-read array $attribute_returns_array
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Ignored\Models;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|NotIgnored newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|NotIgnored newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|NotIgnored newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|NotIgnored newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|NotIgnored query()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|NotIgnored query()
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Interfaces\Models{
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Interfaces\Models{
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|User newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|User newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|User query()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|User query()
|
||||||
|
|||||||
@@ -24,6 +24,8 @@ use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Cas
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts\CastedProperty $casted_property_with_return_type
|
* @property \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts\CastedProperty $casted_property_with_return_type
|
||||||
* @property \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts\CastedProperty $casted_property_with_return_docblock
|
* @property \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts\CastedProperty $casted_property_with_return_docblock
|
||||||
* @property \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts\CastedProperty $casted_property_with_return_docblock_fqn
|
* @property \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\LaravelCustomCasts\Casts\CastedProperty $casted_property_with_return_docblock_fqn
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\MagicWhere\Model
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\AbstractModelsCommand;
|
|||||||
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks\CustomMethod;
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks\CustomMethod;
|
||||||
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks\CustomProperty;
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks\CustomProperty;
|
||||||
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks\UnsetMethod;
|
use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Hooks\UnsetMethod;
|
||||||
|
use Illuminate\Filesystem\Filesystem;
|
||||||
|
use Mockery;
|
||||||
|
|
||||||
class Test extends AbstractModelsCommand
|
class Test extends AbstractModelsCommand
|
||||||
{
|
{
|
||||||
@@ -32,6 +34,24 @@ class Test extends AbstractModelsCommand
|
|||||||
|
|
||||||
public function test(): void
|
public function test(): void
|
||||||
{
|
{
|
||||||
|
$actualContent = null;
|
||||||
|
|
||||||
|
$mockFilesystem = Mockery::mock(Filesystem::class)->makePartial();
|
||||||
|
$mockFilesystem
|
||||||
|
->shouldReceive('get')
|
||||||
|
->andReturn(file_get_contents(__DIR__ . '/Models/Simple.php'))
|
||||||
|
->once();
|
||||||
|
$mockFilesystem
|
||||||
|
->shouldReceive('put')
|
||||||
|
->with(
|
||||||
|
Mockery::any(),
|
||||||
|
Mockery::capture($actualContent)
|
||||||
|
)
|
||||||
|
->andReturn(1) // Simulate we wrote _something_ to the file
|
||||||
|
->once();
|
||||||
|
|
||||||
|
$this->instance(Filesystem::class, $mockFilesystem);
|
||||||
|
|
||||||
$command = $this->app->make(ModelsCommand::class);
|
$command = $this->app->make(ModelsCommand::class);
|
||||||
|
|
||||||
$tester = $this->runCommand($command, [
|
$tester = $this->runCommand($command, [
|
||||||
@@ -40,6 +60,33 @@ class Test extends AbstractModelsCommand
|
|||||||
|
|
||||||
$this->assertSame(0, $tester->getStatusCode());
|
$this->assertSame(0, $tester->getStatusCode());
|
||||||
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
$this->assertStringContainsString('Written new phpDocBlock to', $tester->getDisplay());
|
||||||
$this->assertMatchesMockedSnapshot();
|
|
||||||
|
$expectedContent = <<<'PHP'
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Models;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @property int $id
|
||||||
|
* @property-read string $custom
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple custom($custom)
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newQuery()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple query()
|
||||||
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple whereId($value)
|
||||||
|
* @mixin \Eloquent
|
||||||
|
*/
|
||||||
|
class Simple extends Model
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
PHP;
|
||||||
|
|
||||||
|
$this->assertSame($expectedContent, $actualContent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\ModelHooks\Models;
|
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @property int $id
|
|
||||||
* @property-read string $custom
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple custom($custom)
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newQuery()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple query()
|
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple whereId($value)
|
|
||||||
* @mixin \Eloquent
|
|
||||||
*/
|
|
||||||
class Simple extends Model
|
|
||||||
{
|
|
||||||
}
|
|
||||||
@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property string $relation_morph_to_type
|
* @property string $relation_morph_to_type
|
||||||
* @property int $relation_morph_to_id
|
* @property int $relation_morph_to_id
|
||||||
* @property string|null $nullable_relation_morph_to_type
|
* @property string|null $nullable_relation_morph_to_type
|
||||||
|
|||||||
+2
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PHPStormNoInspec
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newQuery()
|
||||||
|
|||||||
+2
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\PHPStormNoInspec
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newQuery()
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ use Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Pivots\Di
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property-read DifferentCustomPivot|CustomPivot|null $pivot
|
* @property-read DifferentCustomPivot|CustomPivot|null $pivot
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationCustomPivotUsingSameAccessor
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationCustomPivotUsingSameAccessor
|
||||||
* @property-read int|null $relation_custom_pivot_using_same_accessor_count
|
* @property-read int|null $relation_custom_pivot_using_same_accessor_count
|
||||||
@@ -73,6 +75,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Piv
|
|||||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|CustomPivot newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|CustomPivot newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|CustomPivot newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|CustomPivot newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|CustomPivot query()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|CustomPivot query()
|
||||||
@@ -90,6 +94,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\Pivot\Models\Piv
|
|||||||
use Illuminate\Database\Eloquent\Relations\Pivot;
|
use Illuminate\Database\Eloquent\Relations\Pivot;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DifferentCustomPivot newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|DifferentCustomPivot newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DifferentCustomPivot newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|DifferentCustomPivot newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|DifferentCustomPivot query()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|DifferentCustomPivot query()
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static Builder<static>|Comment local() Scope using the 'Scope' attribute
|
* @method static Builder<static>|Comment local() Scope using the 'Scope' attribute
|
||||||
* @method static Builder<static>|Comment newModelQuery()
|
* @method static Builder<static>|Comment newModelQuery()
|
||||||
* @method static Builder<static>|Comment newQuery()
|
* @method static Builder<static>|Comment newQuery()
|
||||||
@@ -46,6 +48,8 @@ declare(strict_types=1);
|
|||||||
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\QueryScopes\Models;
|
namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\QueryScopes\Models;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
@@ -211,6 +215,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\QueryScopes\Mode
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|PostParent active()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|PostParent active()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|PostParent newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|PostParent newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|PostParent newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|PostParent newQuery()
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string|null $char_nullable
|
* @property string|null $char_nullable
|
||||||
* @property string $char_not_nullable
|
* @property string $char_not_nullable
|
||||||
|
|||||||
+6
@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property int $not_null_column_with_foreign_key_constraint
|
* @property int $not_null_column_with_foreign_key_constraint
|
||||||
* @property int $not_null_column_with_no_foreign_key_constraint
|
* @property int $not_null_column_with_no_foreign_key_constraint
|
||||||
@@ -59,6 +61,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property int $not_null_column_with_foreign_key_constraint
|
* @property int $not_null_column_with_foreign_key_constraint
|
||||||
* @property int $not_null_column_with_no_foreign_key_constraint
|
* @property int $not_null_column_with_no_foreign_key_constraint
|
||||||
@@ -128,6 +132,8 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|||||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property-read Simple $relationBelongsTo
|
* @property-read Simple $relationBelongsTo
|
||||||
* @property-read AnotherModel $relationBelongsToInAnotherNamespace
|
* @property-read AnotherModel $relationBelongsToInAnotherNamespace
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property int $not_null_column_with_foreign_key_constraint
|
* @property int $not_null_column_with_foreign_key_constraint
|
||||||
* @property int $not_null_column_with_no_foreign_key_constraint
|
* @property int $not_null_column_with_no_foreign_key_constraint
|
||||||
@@ -59,6 +61,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property int $not_null_column_with_foreign_key_constraint
|
* @property int $not_null_column_with_foreign_key_constraint
|
||||||
* @property int $not_null_column_with_no_foreign_key_constraint
|
* @property int $not_null_column_with_no_foreign_key_constraint
|
||||||
@@ -128,6 +132,8 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|||||||
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
use Illuminate\Database\Eloquent\Relations\MorphToMany;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property-read Simple|null $relationBelongsTo
|
* @property-read Simple|null $relationBelongsTo
|
||||||
* @property-read AnotherModel|null $relationBelongsToInAnotherNamespace
|
* @property-read AnotherModel|null $relationBelongsToInAnotherNamespace
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\SimpleCasts\Mode
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $cast_to_int
|
* @property int $cast_to_int
|
||||||
* @property int $cast_to_integer
|
* @property int $cast_to_integer
|
||||||
* @property float $cast_to_real
|
* @property float $cast_to_real
|
||||||
@@ -31,7 +33,7 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime
|
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime
|
||||||
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime_serialization
|
* @property \Carbon\CarbonImmutable $cast_to_immutable_datetime_serialization
|
||||||
* @property int $cast_to_timestamp
|
* @property int $cast_to_timestamp
|
||||||
* @property string $cast_to_encrypted
|
* @property mixed $cast_to_encrypted
|
||||||
* @property array<array-key, mixed> $cast_to_encrypted_array
|
* @property array<array-key, mixed> $cast_to_encrypted_array
|
||||||
* @property \Illuminate\Support\Collection<array-key, mixed> $cast_to_encrypted_collection
|
* @property \Illuminate\Support\Collection<array-key, mixed> $cast_to_encrypted_collection
|
||||||
* @property array<array-key, mixed> $cast_to_encrypted_json
|
* @property array<array-key, mixed> $cast_to_encrypted_json
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newQuery()
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||||||
use Illuminate\Database\Query\Builder;
|
use Illuminate\Database\Query\Builder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property-read string|int|null $foo
|
* @property-read string|int|null $foo
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, UnionTypeModel> $withUnionTypeReturn
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, UnionTypeModel> $withUnionTypeReturn
|
||||||
* @property-read int|null $with_union_type_return_count
|
* @property-read int|null $with_union_type_return_count
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ use Illuminate\Database\Eloquent\Builder;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @method static Builder<static>|Simple newModelQuery()
|
* @method static Builder<static>|Simple newModelQuery()
|
||||||
* @method static Builder<static>|Simple newQuery()
|
* @method static Builder<static>|Simple newQuery()
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
* @mixin \Illuminate\Database\Eloquent\Builder
|
* @mixin \Illuminate\Database\Eloquent\Builder
|
||||||
* @mixin \Illuminate\Database\Query\Builder
|
* @mixin \Illuminate\Database\Query\Builder
|
||||||
|
|||||||
+4
-2
@@ -242,11 +242,13 @@ class MacroTest extends TestCase
|
|||||||
$macro = new Macro($reflectionMethod, 'URL', new ReflectionClass(UrlGenerator::class), 'macroName');
|
$macro = new Macro($reflectionMethod, 'URL', new ReflectionClass(UrlGenerator::class), 'macroName');
|
||||||
$output = <<<'DOC'
|
$output = <<<'DOC'
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @param string $foo
|
* @param string $foo
|
||||||
* @param int $bar
|
* @param int $bar
|
||||||
* @return string
|
* @return string
|
||||||
* @see \Barryvdh\LaravelIdeHelper\Tests\UrlGeneratorMacroClass::__invoke()
|
* @see \Barryvdh\LaravelIdeHelper\Tests\UrlGeneratorMacroClass::__invoke()
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
DOC;
|
DOC;
|
||||||
$this->assertSame($output, $macro->getDocComment(''));
|
$this->assertSame($output, $macro->getDocComment(''));
|
||||||
|
|||||||
+15
-11
@@ -36,10 +36,12 @@ class MethodTest extends TestCase
|
|||||||
|
|
||||||
$output = <<<'DOC'
|
$output = <<<'DOC'
|
||||||
/**
|
/**
|
||||||
|
*
|
||||||
|
*
|
||||||
* @param string $last
|
* @param string $last
|
||||||
* @param string $first
|
* @param string $first
|
||||||
* @param string $middle
|
* @param string $middle
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
DOC;
|
DOC;
|
||||||
$this->assertSame($output, $method->getDocComment(''));
|
$this->assertSame($output, $method->getDocComment(''));
|
||||||
@@ -69,8 +71,8 @@ DOC;
|
|||||||
* @param array $values
|
* @param array $values
|
||||||
* @param array|string $uniqueBy
|
* @param array|string $uniqueBy
|
||||||
* @param array|null $update
|
* @param array|null $update
|
||||||
* @return int
|
* @return int
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
DOC;
|
DOC;
|
||||||
$this->assertSame($output, $method->getDocComment(''));
|
$this->assertSame($output, $method->getDocComment(''));
|
||||||
@@ -102,8 +104,8 @@ DOC;
|
|||||||
* @param mixed $operator
|
* @param mixed $operator
|
||||||
* @param mixed $value
|
* @param mixed $value
|
||||||
* @param string $boolean
|
* @param string $boolean
|
||||||
* @return \Illuminate\Database\Eloquent\Builder<static>
|
* @return \Illuminate\Database\Eloquent\Builder<static>
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
DOC;
|
DOC;
|
||||||
$this->assertSame($output, $method->getDocComment(''));
|
$this->assertSame($output, $method->getDocComment(''));
|
||||||
@@ -132,8 +134,8 @@ DOC;
|
|||||||
* @param string|array|\Illuminate\Contracts\Database\Query\Expression $columns
|
* @param string|array|\Illuminate\Contracts\Database\Query\Expression $columns
|
||||||
* @param string $boolean
|
* @param string $boolean
|
||||||
* @param bool $not
|
* @param bool $not
|
||||||
* @return \Illuminate\Database\Eloquent\Builder<static>
|
* @return \Illuminate\Database\Eloquent\Builder<static>
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
DOC;
|
DOC;
|
||||||
|
|
||||||
@@ -175,8 +177,10 @@ DOC;
|
|||||||
|
|
||||||
$output = <<<'DOC'
|
$output = <<<'DOC'
|
||||||
/**
|
/**
|
||||||
* @return \Illuminate\Foundation\Application
|
*
|
||||||
* @static
|
*
|
||||||
|
* @return \Illuminate\Foundation\Application
|
||||||
|
* @static
|
||||||
*/
|
*/
|
||||||
DOC;
|
DOC;
|
||||||
|
|
||||||
@@ -204,8 +208,8 @@ DOC;
|
|||||||
* @template TValue
|
* @template TValue
|
||||||
* @param (\Closure(): TValue)|list<string> $columns
|
* @param (\Closure(): TValue)|list<string> $columns
|
||||||
* @param (\Closure(): TValue)|null $callback
|
* @param (\Closure(): TValue)|null $callback
|
||||||
* @return TModel|TValue
|
* @return TModel|TValue
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
DOC;
|
DOC;
|
||||||
$this->assertSame($output, $method->getDocComment(''));
|
$this->assertSame($output, $method->getDocComment(''));
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class SnapshotPhpDriver implements Driver
|
|||||||
{
|
{
|
||||||
public function serialize($data): string
|
public function serialize($data): string
|
||||||
{
|
{
|
||||||
return str_replace(["\r\n", "\r"], "\n", (string) $data);
|
return (string) $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function extension(): string
|
public function extension(): string
|
||||||
@@ -21,6 +21,6 @@ class SnapshotPhpDriver implements Driver
|
|||||||
|
|
||||||
public function match($expected, $actual)
|
public function match($expected, $actual)
|
||||||
{
|
{
|
||||||
Assert::assertSame(str_replace(["\r\n", "\r"], "\n", $expected), $this->serialize($actual));
|
Assert::assertSame($expected, $this->serialize($actual));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class SnapshotTxtDriver implements Driver
|
|||||||
{
|
{
|
||||||
public function serialize($data): string
|
public function serialize($data): string
|
||||||
{
|
{
|
||||||
return str_replace(["\r\n", "\r"], "\n", (string) $data);
|
return (string) $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function extension(): string
|
public function extension(): string
|
||||||
@@ -21,6 +21,6 @@ class SnapshotTxtDriver implements Driver
|
|||||||
|
|
||||||
public function match($expected, $actual)
|
public function match($expected, $actual)
|
||||||
{
|
{
|
||||||
Assert::assertSame(str_replace(["\r\n", "\r"], "\n", $expected), $this->serialize($actual));
|
Assert::assertSame($expected, $this->serialize($actual));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,11 +55,6 @@ abstract class TestCase extends BaseTestCase
|
|||||||
$this->assertMatchesSnapshot($actualContent, new SnapshotTxtDriver());
|
$this->assertMatchesSnapshot($actualContent, new SnapshotTxtDriver());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function assertMatchesMockedSnapshot()
|
|
||||||
{
|
|
||||||
$this->assertMatchesSnapshot($this->mockFilesystemOutput, new SnapshotPhpDriver());
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function mockFilesystem()
|
protected function mockFilesystem()
|
||||||
{
|
{
|
||||||
$mockFilesystem = Mockery::mock(Filesystem::class)->makePartial();
|
$mockFilesystem = Mockery::mock(Filesystem::class)->makePartial();
|
||||||
@@ -71,7 +66,6 @@ abstract class TestCase extends BaseTestCase
|
|||||||
Mockery::any()
|
Mockery::any()
|
||||||
)
|
)
|
||||||
->andReturnUsing(function ($path, $contents) {
|
->andReturnUsing(function ($path, $contents) {
|
||||||
$contents = str_replace(["\r\n", "\r"], "\n", $contents);
|
|
||||||
$this->mockFilesystemOutput .= $contents;
|
$this->mockFilesystemOutput .= $contents;
|
||||||
|
|
||||||
return strlen($contents);
|
return strlen($contents);
|
||||||
|
|||||||
Reference in New Issue
Block a user