mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-19 18:43:12 +00:00
Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b106f7ee85 | ||
|
|
d61d20357e | ||
|
|
e9283c40a2 | ||
|
|
12a0d7d54c | ||
|
|
9ef25f60e7 | ||
|
|
8dff6bb5ff | ||
|
|
53854ea7d9 | ||
|
|
1fa84a3b65 | ||
|
|
5e973967a7 | ||
|
|
8d00250cba | ||
|
|
877f5ed0a7 | ||
|
|
fafe264b3c | ||
|
|
108f6269c1 | ||
|
|
c488262f97 | ||
|
|
83e3f39b39 | ||
|
|
31979ed485 | ||
|
|
6d96f0bd1a |
+1
-3
@@ -6,9 +6,7 @@
|
|||||||
/.gitattributes export-ignore
|
/.gitattributes export-ignore
|
||||||
/.github export-ignore
|
/.github export-ignore
|
||||||
/.gitignore export-ignore
|
/.gitignore export-ignore
|
||||||
/.php-cs-fixer.cache export-ignore
|
/.php-cs-fixer* 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
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Git checkout
|
- name: Git checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Validate Composer configuration
|
- name: Validate Composer configuration
|
||||||
run: composer validate --strict
|
run: composer validate --strict
|
||||||
@@ -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@v5
|
- uses: stefanzweifel/git-auto-commit-action@v7
|
||||||
with:
|
with:
|
||||||
commit_message: normalize composer.json
|
commit_message: normalize composer.json
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
@@ -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@v5
|
- uses: stefanzweifel/git-auto-commit-action@v7
|
||||||
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]>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ jobs:
|
|||||||
name: P${{ matrix.php }} - Laravel${{ matrix.laravel }}
|
name: P${{ matrix.php }} - Laravel${{ matrix.laravel }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
path: src
|
path: src
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
php: [8.4, 8.3, 8.2]
|
php: [8.5, 8.4, 8.3, 8.2]
|
||||||
laravel: [~11.15, 12.x]
|
laravel: [~11.15, 12.x]
|
||||||
stability: [prefer-lowest, prefer-stable]
|
stability: [prefer-lowest, prefer-stable]
|
||||||
include:
|
include:
|
||||||
@@ -37,7 +37,7 @@ jobs:
|
|||||||
git config --global core.eol lf
|
git config --global core.eol lf
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.release.target_commitish }}
|
ref: ${{ github.event.release.target_commitish }}
|
||||||
|
|
||||||
@@ -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@v5
|
uses: stefanzweifel/git-auto-commit-action@v7
|
||||||
with:
|
with:
|
||||||
branch: ${{ github.event.release.target_commitish }}
|
branch: ${{ github.event.release.target_commitish }}
|
||||||
commit_message: Update CHANGELOG
|
commit_message: Update CHANGELOG
|
||||||
|
|||||||
@@ -1,5 +1,37 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## v3.6.0 - 2025-07-18
|
||||||
|
|
||||||
|
### What's Changed
|
||||||
|
|
||||||
|
* fix: Change AsArrayObject cast to be Laravel's ArrayObject by @wsamoht in https://github.com/barryvdh/laravel-ide-helper/pull/1675
|
||||||
|
* Add extends declaration for Macroable classes to fix missing inherited methods by @KentarouTakeda in https://github.com/barryvdh/laravel-ide-helper/pull/1674
|
||||||
|
* fix(meta): ignore aliases in the autoloader (Fixes #1671) by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1686
|
||||||
|
* feat(ModelsCommand): add support for the new Scope attribute by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1694
|
||||||
|
* fix type change for scope default float parameter by @nivseb in https://github.com/barryvdh/laravel-ide-helper/pull/1697
|
||||||
|
* Revert #1629 - *Allow adding custom Macroable classes* by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1707
|
||||||
|
* Configurable macro return type defaults by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1711
|
||||||
|
* docs(readme): add Laravel 12 support information by @SantosVilanculos in https://github.com/barryvdh/laravel-ide-helper/pull/1717
|
||||||
|
* Add multi-level directory support for translation files by @RosiersRobin in https://github.com/barryvdh/laravel-ide-helper/pull/1718
|
||||||
|
* Support `AsCollection::of($map)`, `AsCollection::using($class, $map)` by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1714
|
||||||
|
* fix: Fixed wrong doc for SoftDeletes `withTrashed` method by @eldair in https://github.com/barryvdh/laravel-ide-helper/pull/1688
|
||||||
|
* Support other OS on tests by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1715
|
||||||
|
* Fix tests on windows by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1720
|
||||||
|
* Bump stefanzweifel/git-auto-commit-action from 5 to 6 in the deps group by @dependabot[bot] in https://github.com/barryvdh/laravel-ide-helper/pull/1719
|
||||||
|
* Update .gitattributes - avoid all `.php-cs-fixer` files on vendor by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1708
|
||||||
|
* fix(ModelsCommand): use 'string' as realType for 'encrypted' casts by @pataar in https://github.com/barryvdh/laravel-ide-helper/pull/1698
|
||||||
|
* Trim strings and bump reflection docblock by @barryvdh in https://github.com/barryvdh/laravel-ide-helper/pull/1721
|
||||||
|
* Add magic *_exists properties by @erikn69 in https://github.com/barryvdh/laravel-ide-helper/pull/1712
|
||||||
|
|
||||||
|
### New Contributors
|
||||||
|
|
||||||
|
* @wsamoht made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1675
|
||||||
|
* @nivseb made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1697
|
||||||
|
* @SantosVilanculos made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1717
|
||||||
|
* @RosiersRobin made their first contribution in https://github.com/barryvdh/laravel-ide-helper/pull/1718
|
||||||
|
|
||||||
|
**Full Changelog**: https://github.com/barryvdh/laravel-ide-helper/compare/v3.5.5...v3.6.0
|
||||||
|
|
||||||
## v3.5.5 - 2025-02-21
|
## v3.5.5 - 2025-02-21
|
||||||
|
|
||||||
### What's Changed
|
### What's Changed
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ php artisan ide-helper:models -RW
|
|||||||
|
|
||||||
If you don't want the full _ide_helper.php file, you can run add `--write-eloquent-helper` to the model command to generate small version, which is required for the `@mixin \Eloquent` to be able to add the QueryBuilder methods.
|
If you don't want the full _ide_helper.php file, you can run add `--write-eloquent-helper` to the model command to generate small version, which is required for the `@mixin \Eloquent` to be able to add the QueryBuilder methods.
|
||||||
|
|
||||||
If you don't want to add all the phpdocs to your Models directly, you can use `--nowrite` to create a seperate file. The `--write-mixin` option can be used to only add a `@mixin` to your models, but add the generated phpdocs in a seperate file. This avoids having the results marked as duplicate.
|
If you don't want to add all the phpdocs to your Models directly, you can use `--nowrite` to create a separate file. The `--write-mixin` option can be used to only add a `@mixin` to your models, but add the generated phpdocs in a separate file. This avoids having the results marked as duplicate.
|
||||||
|
|
||||||
|
|
||||||
_Check out [this Laracasts video](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/15) for a quick introduction/explanation!_
|
_Check out [this Laracasts video](https://laracasts.com/series/how-to-be-awesome-in-phpstorm/episodes/15) for a quick introduction/explanation!_
|
||||||
@@ -210,11 +210,11 @@ Eloquent allows calling `where<Attribute>` on your models, e.g. `Post::whereTitl
|
|||||||
|
|
||||||
If for some reason it's undesired to have them generated (one for each column), you can disable this via config `write_model_magic_where` and setting it to `false`.
|
If for some reason it's undesired to have them generated (one for each column), you can disable this via config `write_model_magic_where` and setting it to `false`.
|
||||||
|
|
||||||
#### Magic `*_count` properties
|
#### Magic `*_count` and `*_exists` properties
|
||||||
|
|
||||||
You may use the [`::withCount`](https://laravel.com/docs/master/eloquent-relationships#counting-related-models) method to count the number results from a relationship without actually loading them. Those results are then placed in attributes following the `<columname>_count` convention.
|
You may use the [`::withCount`](https://laravel.com/docs/master/eloquent-relationships#counting-related-models) and [`::withExists`](https://laravel.com/docs/master/eloquent-relationships#other-aggregate-functions) methods to count the number results from a relationship without actually loading them. Those results are then placed in attributes following the `<columnname>_count` and `<columnname>_exists` convention.
|
||||||
|
|
||||||
By default, these attributes are generated in the phpdoc. You can turn them off by setting the config `write_model_relation_count_properties` to `false`.
|
By default, these attributes are generated in the phpdoc. You can turn them off by setting the config `write_model_relation_count_properties` and `write_model_relation_exists_properties` to `false`.
|
||||||
|
|
||||||
#### Generics annotations
|
#### Generics annotations
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^8.2",
|
"php": "^8.2",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"barryvdh/reflection-docblock": "^2.3",
|
"barryvdh/reflection-docblock": "^2.4",
|
||||||
"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",
|
||||||
|
|||||||
@@ -85,14 +85,16 @@ return [
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Write model relation count properties
|
| Write model relation count and exists properties
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Set to false to disable writing of relation count properties to model DocBlocks.
|
| Set to false to disable writing of relation count and exists properties
|
||||||
|
| to model DocBlocks.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'write_model_relation_count_properties' => true,
|
'write_model_relation_count_properties' => true,
|
||||||
|
'write_model_relation_exists_properties' => false,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -124,7 +124,6 @@ $reflection = new ReflectionClass($loader);
|
|||||||
$property = $reflection->hasProperty('paths')
|
$property = $reflection->hasProperty('paths')
|
||||||
? $reflection->getProperty('paths')
|
? $reflection->getProperty('paths')
|
||||||
: $reflection->getProperty('path');
|
: $reflection->getProperty('path');
|
||||||
$property->setAccessible(true);
|
|
||||||
|
|
||||||
$paths = Illuminate\Support\Arr::wrap($property->getValue($loader));
|
$paths = Illuminate\Support\Arr::wrap($property->getValue($loader));
|
||||||
|
|
||||||
|
|||||||
@@ -256,6 +256,8 @@ class Alias
|
|||||||
if ($fake !== $real) {
|
if ($fake !== $real) {
|
||||||
$this->addClass(get_class($fake));
|
$this->addClass(get_class($fake));
|
||||||
}
|
}
|
||||||
|
} catch (Throwable $throwable) {
|
||||||
|
// Ignore error
|
||||||
} finally {
|
} finally {
|
||||||
$facade::swap($real);
|
$facade::swap($real);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -114,6 +114,7 @@ class ModelsCommand extends Command
|
|||||||
|
|
||||||
protected $write_model_magic_where;
|
protected $write_model_magic_where;
|
||||||
protected $write_model_relation_count_properties;
|
protected $write_model_relation_count_properties;
|
||||||
|
protected $write_model_relation_exists_properties;
|
||||||
protected $properties = [];
|
protected $properties = [];
|
||||||
protected $methods = [];
|
protected $methods = [];
|
||||||
protected $write = false;
|
protected $write = false;
|
||||||
@@ -173,6 +174,8 @@ class ModelsCommand extends Command
|
|||||||
$this->write_model_external_builder_methods = $this->laravel['config']->get('ide-helper.write_model_external_builder_methods', true);
|
$this->write_model_external_builder_methods = $this->laravel['config']->get('ide-helper.write_model_external_builder_methods', true);
|
||||||
$this->write_model_relation_count_properties =
|
$this->write_model_relation_count_properties =
|
||||||
$this->laravel['config']->get('ide-helper.write_model_relation_count_properties', true);
|
$this->laravel['config']->get('ide-helper.write_model_relation_count_properties', true);
|
||||||
|
$this->write_model_relation_exists_properties =
|
||||||
|
$this->laravel['config']->get('ide-helper.write_model_relation_exists_properties', false);
|
||||||
|
|
||||||
$this->write = $this->write_mixin ? true : $this->write;
|
$this->write = $this->write_mixin ? true : $this->write;
|
||||||
//If filename is default and Write is not specified, ask what to do
|
//If filename is default and Write is not specified, ask what to do
|
||||||
@@ -410,9 +413,6 @@ 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';
|
||||||
@@ -420,6 +420,7 @@ 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';
|
||||||
@@ -583,6 +584,8 @@ class ModelsCommand extends Command
|
|||||||
'float', 'real', 'float4',
|
'float', 'real', 'float4',
|
||||||
'double', 'float8' => 'float',
|
'double', 'float8' => 'float',
|
||||||
|
|
||||||
|
'decimal', 'numeric' => 'numeric',
|
||||||
|
|
||||||
default => 'string',
|
default => 'string',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -822,6 +825,15 @@ class ModelsCommand extends Command
|
|||||||
// What kind of comments should be added to the relation count here?
|
// What kind of comments should be added to the relation count here?
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if ($this->write_model_relation_exists_properties) {
|
||||||
|
$this->setProperty(
|
||||||
|
Str::snake($method) . '_exists',
|
||||||
|
'bool|null',
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
// What kind of comments should be added to the relation count here?
|
||||||
|
);
|
||||||
|
}
|
||||||
} elseif (
|
} elseif (
|
||||||
$relationReturnType === 'morphTo' ||
|
$relationReturnType === 'morphTo' ||
|
||||||
(
|
(
|
||||||
@@ -877,7 +889,6 @@ class ModelsCommand extends Command
|
|||||||
|
|
||||||
if (in_array($relation, ['hasOne', 'hasOneThrough', 'morphOne'], true)) {
|
if (in_array($relation, ['hasOne', 'hasOneThrough', 'morphOne'], true)) {
|
||||||
$defaultProp = $reflectionObj->getProperty('withDefault');
|
$defaultProp = $reflectionObj->getProperty('withDefault');
|
||||||
$defaultProp->setAccessible(true);
|
|
||||||
|
|
||||||
return !$defaultProp->getValue($relationObj);
|
return !$defaultProp->getValue($relationObj);
|
||||||
}
|
}
|
||||||
@@ -887,7 +898,6 @@ class ModelsCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
$fkProp = $reflectionObj->getProperty('foreignKey');
|
$fkProp = $reflectionObj->getProperty('foreignKey');
|
||||||
$fkProp->setAccessible(true);
|
|
||||||
|
|
||||||
$enforceNullableRelation = $this->laravel['config']->get('ide-helper.enforce_nullable_relationships', true);
|
$enforceNullableRelation = $this->laravel['config']->get('ide-helper.enforce_nullable_relationships', true);
|
||||||
|
|
||||||
@@ -920,7 +930,6 @@ class ModelsCommand extends Command
|
|||||||
}
|
}
|
||||||
|
|
||||||
$fkProp = $reflectionObj->getProperty('foreignKey');
|
$fkProp = $reflectionObj->getProperty('foreignKey');
|
||||||
$fkProp->setAccessible(true);
|
|
||||||
|
|
||||||
foreach (Arr::wrap($fkProp->getValue($relationObj)) as $foreignKey) {
|
foreach (Arr::wrap($fkProp->getValue($relationObj)) as $foreignKey) {
|
||||||
if (isset($this->nullableColumns[$foreignKey])) {
|
if (isset($this->nullableColumns[$foreignKey])) {
|
||||||
@@ -1273,9 +1282,6 @@ class ModelsCommand extends Command
|
|||||||
*/
|
*/
|
||||||
protected function getAttributeTypes(Model $model, \ReflectionMethod $reflectionMethod): Collection
|
protected function getAttributeTypes(Model $model, \ReflectionMethod $reflectionMethod): Collection
|
||||||
{
|
{
|
||||||
// Private/protected ReflectionMethods require setAccessible prior to PHP 8.1
|
|
||||||
$reflectionMethod->setAccessible(true);
|
|
||||||
|
|
||||||
/** @var Attribute $attribute */
|
/** @var Attribute $attribute */
|
||||||
$attribute = $reflectionMethod->invoke($model);
|
$attribute = $reflectionMethod->invoke($model);
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ class Factories
|
|||||||
$factory = app(Factory::class);
|
$factory = app(Factory::class);
|
||||||
|
|
||||||
$definitions = (new ReflectionClass(Factory::class))->getProperty('definitions');
|
$definitions = (new ReflectionClass(Factory::class))->getProperty('definitions');
|
||||||
$definitions->setAccessible(true);
|
|
||||||
|
|
||||||
foreach ($definitions->getValue($factory) as $factory_target => $config) {
|
foreach ($definitions->getValue($factory) as $factory_target => $config) {
|
||||||
try {
|
try {
|
||||||
|
|||||||
+2
-2
@@ -178,7 +178,7 @@ class Method
|
|||||||
/**
|
/**
|
||||||
* Get the parameters for this method
|
* Get the parameters for this method
|
||||||
*
|
*
|
||||||
* @param bool $implode Wether to implode the array or not
|
* @param bool $implode Whether to implode the array or not
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getParams($implode = true)
|
public function getParams($implode = true)
|
||||||
@@ -208,7 +208,7 @@ class Method
|
|||||||
/**
|
/**
|
||||||
* Get the parameters for this method including default values
|
* Get the parameters for this method including default values
|
||||||
*
|
*
|
||||||
* @param bool $implode Wether to implode the array or not
|
* @param bool $implode Whether to implode the array or not
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function getParamsWithDefault($implode = true)
|
public function getParamsWithDefault($implode = true)
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use Barryvdh\LaravelIdeHelper\Macro;
|
|||||||
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
|
||||||
use Illuminate\Database\Query\Builder;
|
use Illuminate\Database\Query\Builder;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@@ -66,6 +67,22 @@ class AliasTest extends TestCase
|
|||||||
$this->assertNotNull($this->getAliasMacro($alias, EloquentBuilder::class, $macro));
|
$this->assertNotNull($this->getAliasMacro($alias, EloquentBuilder::class, $macro));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @covers ::detectFake
|
||||||
|
*/
|
||||||
|
public function testNoExceptionOnRequiredFakeParameters(): void
|
||||||
|
{
|
||||||
|
// Mock
|
||||||
|
$alias = new AliasMock();
|
||||||
|
|
||||||
|
// Prepare
|
||||||
|
$alias->setFacade(MockFacade::class);
|
||||||
|
$this->expectNotToPerformAssertions();
|
||||||
|
|
||||||
|
// Test
|
||||||
|
$alias->detectFake();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers ::detectTemplateNames
|
* @covers ::detectTemplateNames
|
||||||
*/
|
*/
|
||||||
@@ -118,4 +135,26 @@ class AliasMock extends Alias
|
|||||||
{
|
{
|
||||||
parent::detectMethods();
|
parent::detectMethods();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function detectFake()
|
||||||
|
{
|
||||||
|
parent::detectFake();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setFacade(string $facade)
|
||||||
|
{
|
||||||
|
$this->facade = $facade;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MockFacade extends Facade
|
||||||
|
{
|
||||||
|
protected static function getFacadeAccessor()
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function fake(string $test1, $test2 = null)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ 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
|
||||||
@@ -27,9 +26,4 @@ abstract class AbstractGeneratorCommand extends TestCase
|
|||||||
{
|
{
|
||||||
return [IdeHelperServiceProvider::class];
|
return [IdeHelperServiceProvider::class];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function assertMatchesMockedSnapshot()
|
|
||||||
{
|
|
||||||
$this->assertMatchesSnapshot($this->mockFilesystemOutput, new SnapshotPhpDriver());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ 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,10 +50,7 @@ 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()
|
$config->set('ide-helper.write_model_relation_exists_properties', true);
|
||||||
{
|
|
||||||
$this->assertMatchesSnapshot($this->mockFilesystemOutput, new SnapshotPhpDriver());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ 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
|
||||||
@@ -22,7 +20,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 mixed $cast_to_encrypted
|
* @property string $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,8 +7,6 @@ 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
|
||||||
@@ -44,8 +42,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ 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,8 +8,6 @@ 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
|
||||||
@@ -85,8 +83,6 @@ 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,8 +10,6 @@ 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
|
||||||
@@ -23,6 +21,7 @@ use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|||||||
* @property-read string $not_comment
|
* @property-read string $not_comment
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationHasMany HasMany relations.
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationHasMany HasMany relations.
|
||||||
* @property-read int|null $relation_has_many_count
|
* @property-read int|null $relation_has_many_count
|
||||||
|
* @property-read bool|null $relation_has_many_exists
|
||||||
* @property-read Simple|null $relationHasOne Others relations.
|
* @property-read Simple|null $relationHasOne Others relations.
|
||||||
* @property-read Model|\Eloquent $relationMorphTo MorphTo relations.
|
* @property-read Model|\Eloquent $relationMorphTo MorphTo relations.
|
||||||
* @property-write mixed $first_name Set the user's first name.
|
* @property-write mixed $first_name Set the user's first name.
|
||||||
|
|||||||
@@ -9,11 +9,10 @@ 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
|
||||||
|
* @property-read bool|null $relation_has_many_exists
|
||||||
* @method static SimpleCollection<int, static> all($columns = ['*'])
|
* @method static SimpleCollection<int, static> all($columns = ['*'])
|
||||||
* @method static SimpleCollection<int, static> get($columns = ['*'])
|
* @method static SimpleCollection<int, static> get($columns = ['*'])
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ 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
-4
@@ -13,8 +13,6 @@
|
|||||||
|
|
||||||
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
|
||||||
@@ -50,8 +48,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\DoesNotGenerateP
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
@@ -10,10 +10,9 @@ 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
|
||||||
|
* @property-read bool|null $regular_has_many_exists
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Dynamic newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Dynamic newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Dynamic newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Dynamic newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Dynamic query()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Dynamic query()
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ 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()
|
||||||
@@ -41,8 +39,6 @@ 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()
|
||||||
@@ -60,8 +56,6 @@ 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()
|
||||||
@@ -81,8 +75,6 @@ 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
-4
@@ -9,8 +9,6 @@ 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
|
||||||
@@ -46,8 +44,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ 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
|
||||||
@@ -44,8 +42,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
+2
-4
@@ -7,8 +7,6 @@ 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
|
||||||
@@ -44,8 +42,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property float $floatNotNullable
|
* @property float $floatNotNullable
|
||||||
* @property float|null $doubleNullable
|
* @property float|null $doubleNullable
|
||||||
* @property float $doubleNotNullable
|
* @property float $doubleNotNullable
|
||||||
* @property string|null $decimalNullable
|
* @property numeric|null $decimalNullable
|
||||||
* @property string $decimalNotNullable
|
* @property numeric $decimalNotNullable
|
||||||
* @property int|null $booleanNullable
|
* @property int|null $booleanNullable
|
||||||
* @property int $booleanNotNullable
|
* @property int $booleanNotNullable
|
||||||
* @property string|null $enumNullable
|
* @property string|null $enumNullable
|
||||||
|
|||||||
+2
-4
@@ -7,8 +7,6 @@ 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
|
||||||
@@ -44,8 +42,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
@@ -67,8 +67,6 @@ 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,8 +8,6 @@ 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
-4
@@ -13,8 +13,6 @@
|
|||||||
|
|
||||||
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
|
||||||
@@ -50,8 +48,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWi
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
+2
-4
@@ -8,8 +8,6 @@ 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
|
||||||
@@ -45,8 +43,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
+3
-4
@@ -9,8 +9,6 @@ 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
|
||||||
@@ -46,8 +44,8 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
@@ -84,6 +82,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
|||||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post> $posts
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, \Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post> $posts
|
||||||
* @property-read int|null $posts_count
|
* @property-read int|null $posts_count
|
||||||
|
* @property-read bool|null $posts_exists
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post null(string $unusedParam)
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|\Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWithForcedFqn\Models\Post null(string $unusedParam)
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ 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
|
||||||
@@ -52,8 +50,8 @@ use Illuminate\Support\Carbon;
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
@@ -90,6 +88,7 @@ use Illuminate\Support\Carbon;
|
|||||||
* @property Carbon|null $updated_at
|
* @property Carbon|null $updated_at
|
||||||
* @property-read Collection<int, Post> $posts
|
* @property-read Collection<int, Post> $posts
|
||||||
* @property-read int|null $posts_count
|
* @property-read int|null $posts_count
|
||||||
|
* @property-read bool|null $posts_exists
|
||||||
* @method static EloquentBuilder<static>|Post newModelQuery()
|
* @method static EloquentBuilder<static>|Post newModelQuery()
|
||||||
* @method static EloquentBuilder<static>|Post newQuery()
|
* @method static EloquentBuilder<static>|Post newQuery()
|
||||||
* @method static EloquentBuilder<static>|Post null(string $unusedParam)
|
* @method static EloquentBuilder<static>|Post null(string $unusedParam)
|
||||||
|
|||||||
+2
-4
@@ -13,8 +13,6 @@
|
|||||||
|
|
||||||
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
|
||||||
@@ -50,8 +48,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWi
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
@@ -45,8 +45,6 @@ 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()
|
||||||
@@ -60,8 +58,6 @@ 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
|
||||||
@@ -99,8 +95,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\GeneratePhpdocWi
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
@@ -9,13 +9,13 @@ 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
|
||||||
|
* @property-read bool|null $regular_belongs_to_many_exists
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection|Simple[] $regularHasMany
|
* @property-read \Illuminate\Database\Eloquent\Collection|Simple[] $regularHasMany
|
||||||
* @property-read int|null $regular_has_many_count
|
* @property-read int|null $regular_has_many_count
|
||||||
|
* @property-read bool|null $regular_has_many_exists
|
||||||
* @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()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple query()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple query()
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ 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,8 +7,6 @@ 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,8 +13,6 @@
|
|||||||
|
|
||||||
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,8 +24,6 @@ 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,8 +7,6 @@ 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
|
||||||
@@ -44,8 +42,8 @@ use Illuminate\Database\Eloquent\Model;
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ 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
|
||||||
{
|
{
|
||||||
@@ -34,24 +32,6 @@ 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, [
|
||||||
@@ -60,33 +40,6 @@ 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);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?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,8 +8,6 @@ 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,8 +7,6 @@ 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,8 +7,6 @@ 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,21 +9,24 @@ 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
|
||||||
|
* @property-read bool|null $relation_custom_pivot_using_same_accessor_exists
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationCustomPivotUsingSameAccessorAndClass
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationCustomPivotUsingSameAccessorAndClass
|
||||||
* @property-read int|null $relation_custom_pivot_using_same_accessor_and_class_count
|
* @property-read int|null $relation_custom_pivot_using_same_accessor_and_class_count
|
||||||
|
* @property-read bool|null $relation_custom_pivot_using_same_accessor_and_class_exists
|
||||||
* @property-read CustomPivot|null $customAccessor
|
* @property-read CustomPivot|null $customAccessor
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationWithCustomPivot
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationWithCustomPivot
|
||||||
* @property-read int|null $relation_with_custom_pivot_count
|
* @property-read int|null $relation_with_custom_pivot_count
|
||||||
|
* @property-read bool|null $relation_with_custom_pivot_exists
|
||||||
* @property-read DifferentCustomPivot|null $differentCustomAccessor
|
* @property-read DifferentCustomPivot|null $differentCustomAccessor
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationWithDifferentCustomPivot
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationWithDifferentCustomPivot
|
||||||
* @property-read int|null $relation_with_different_custom_pivot_count
|
* @property-read int|null $relation_with_different_custom_pivot_count
|
||||||
|
* @property-read bool|null $relation_with_different_custom_pivot_exists
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationWithDifferentCustomPivotUsingSameAccessor
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, ModelWithPivot> $relationWithDifferentCustomPivotUsingSameAccessor
|
||||||
* @property-read int|null $relation_with_different_custom_pivot_using_same_accessor_count
|
* @property-read int|null $relation_with_different_custom_pivot_using_same_accessor_count
|
||||||
|
* @property-read bool|null $relation_with_different_custom_pivot_using_same_accessor_exists
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithPivot newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithPivot newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithPivot newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithPivot newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithPivot query()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|ModelWithPivot query()
|
||||||
@@ -75,8 +78,6 @@ 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()
|
||||||
@@ -94,8 +95,6 @@ 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,8 +9,6 @@ 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()
|
||||||
@@ -48,8 +46,6 @@ 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
|
||||||
@@ -85,8 +81,8 @@ namespace Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\QueryScopes\Mode
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
@@ -215,8 +211,6 @@ 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()
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ class Test extends AbstractModelsCommand
|
|||||||
parent::getEnvironmentSetUp($app);
|
parent::getEnvironmentSetUp($app);
|
||||||
|
|
||||||
$app['config']->set('ide-helper.write_model_relation_count_properties', false);
|
$app['config']->set('ide-helper.write_model_relation_count_properties', false);
|
||||||
|
$app['config']->set('ide-helper.write_model_relation_exists_properties', false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test(): void
|
public function test(): void
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ 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
|
||||||
@@ -45,8 +43,8 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
|||||||
* @property float $float_not_nullable
|
* @property float $float_not_nullable
|
||||||
* @property float|null $double_nullable
|
* @property float|null $double_nullable
|
||||||
* @property float $double_not_nullable
|
* @property float $double_not_nullable
|
||||||
* @property string|null $decimal_nullable
|
* @property numeric|null $decimal_nullable
|
||||||
* @property string $decimal_not_nullable
|
* @property numeric $decimal_not_nullable
|
||||||
* @property int|null $boolean_nullable
|
* @property int|null $boolean_nullable
|
||||||
* @property int $boolean_not_nullable
|
* @property int $boolean_not_nullable
|
||||||
* @property string|null $enum_nullable
|
* @property string|null $enum_nullable
|
||||||
|
|||||||
+8
-6
@@ -8,8 +8,6 @@ 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
|
||||||
@@ -61,8 +59,6 @@ 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
|
||||||
@@ -132,33 +128,39 @@ 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
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToMany
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToMany
|
||||||
* @property-read int|null $relation_belongs_to_many_count
|
* @property-read int|null $relation_belongs_to_many_count
|
||||||
|
* @property-read bool|null $relation_belongs_to_many_exists
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToManyWithSub
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToManyWithSub
|
||||||
* @property-read int|null $relation_belongs_to_many_with_sub_count
|
* @property-read int|null $relation_belongs_to_many_with_sub_count
|
||||||
|
* @property-read bool|null $relation_belongs_to_many_with_sub_exists
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToManyWithSubAnother
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToManyWithSubAnother
|
||||||
* @property-read int|null $relation_belongs_to_many_with_sub_another_count
|
* @property-read int|null $relation_belongs_to_many_with_sub_another_count
|
||||||
|
* @property-read bool|null $relation_belongs_to_many_with_sub_another_exists
|
||||||
* @property-read AnotherModel $relationBelongsToSameNameAsColumn
|
* @property-read AnotherModel $relationBelongsToSameNameAsColumn
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationHasMany
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationHasMany
|
||||||
* @property-read int|null $relation_has_many_count
|
* @property-read int|null $relation_has_many_count
|
||||||
|
* @property-read bool|null $relation_has_many_exists
|
||||||
* @property-read Simple|null $relationHasOne
|
* @property-read Simple|null $relationHasOne
|
||||||
* @property-read Simple $relationHasOneWithDefault
|
* @property-read Simple $relationHasOneWithDefault
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationMorphMany
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationMorphMany
|
||||||
* @property-read int|null $relation_morph_many_count
|
* @property-read int|null $relation_morph_many_count
|
||||||
|
* @property-read bool|null $relation_morph_many_exists
|
||||||
* @property-read Simple|null $relationMorphOne
|
* @property-read Simple|null $relationMorphOne
|
||||||
* @property-read Model|\Eloquent $relationMorphTo
|
* @property-read Model|\Eloquent $relationMorphTo
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationMorphedByMany
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationMorphedByMany
|
||||||
* @property-read int|null $relation_morphed_by_many_count
|
* @property-read int|null $relation_morphed_by_many_count
|
||||||
|
* @property-read bool|null $relation_morphed_by_many_exists
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationSampleRelationType
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationSampleRelationType
|
||||||
* @property-read int|null $relation_sample_relation_type_count
|
* @property-read int|null $relation_sample_relation_type_count
|
||||||
|
* @property-read bool|null $relation_sample_relation_type_exists
|
||||||
* @property-read Model|\Eloquent $relationSampleToAnyMorphedRelationType
|
* @property-read Model|\Eloquent $relationSampleToAnyMorphedRelationType
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationSampleToAnyRelationType
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationSampleToAnyRelationType
|
||||||
* @property-read int|null $relation_sample_to_any_relation_type_count
|
* @property-read int|null $relation_sample_to_any_relation_type_count
|
||||||
|
* @property-read bool|null $relation_sample_to_any_relation_type_exists
|
||||||
* @property-read Simple $relationSampleToBadlyNamedNotManyRelation
|
* @property-read Simple $relationSampleToBadlyNamedNotManyRelation
|
||||||
* @property-read Simple $relationSampleToManyRelationType
|
* @property-read Simple $relationSampleToManyRelationType
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ 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
|
||||||
@@ -61,8 +59,6 @@ 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
|
||||||
@@ -132,33 +128,39 @@ 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
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToMany
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToMany
|
||||||
* @property-read int|null $relation_belongs_to_many_count
|
* @property-read int|null $relation_belongs_to_many_count
|
||||||
|
* @property-read bool|null $relation_belongs_to_many_exists
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToManyWithSub
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToManyWithSub
|
||||||
* @property-read int|null $relation_belongs_to_many_with_sub_count
|
* @property-read int|null $relation_belongs_to_many_with_sub_count
|
||||||
|
* @property-read bool|null $relation_belongs_to_many_with_sub_exists
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToManyWithSubAnother
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationBelongsToManyWithSubAnother
|
||||||
* @property-read int|null $relation_belongs_to_many_with_sub_another_count
|
* @property-read int|null $relation_belongs_to_many_with_sub_another_count
|
||||||
|
* @property-read bool|null $relation_belongs_to_many_with_sub_another_exists
|
||||||
* @property-read AnotherModel|null $relationBelongsToSameNameAsColumn
|
* @property-read AnotherModel|null $relationBelongsToSameNameAsColumn
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationHasMany
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationHasMany
|
||||||
* @property-read int|null $relation_has_many_count
|
* @property-read int|null $relation_has_many_count
|
||||||
|
* @property-read bool|null $relation_has_many_exists
|
||||||
* @property-read Simple|null $relationHasOne
|
* @property-read Simple|null $relationHasOne
|
||||||
* @property-read Simple $relationHasOneWithDefault
|
* @property-read Simple $relationHasOneWithDefault
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationMorphMany
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationMorphMany
|
||||||
* @property-read int|null $relation_morph_many_count
|
* @property-read int|null $relation_morph_many_count
|
||||||
|
* @property-read bool|null $relation_morph_many_exists
|
||||||
* @property-read Simple|null $relationMorphOne
|
* @property-read Simple|null $relationMorphOne
|
||||||
* @property-read Model|\Eloquent $relationMorphTo
|
* @property-read Model|\Eloquent $relationMorphTo
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationMorphedByMany
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationMorphedByMany
|
||||||
* @property-read int|null $relation_morphed_by_many_count
|
* @property-read int|null $relation_morphed_by_many_count
|
||||||
|
* @property-read bool|null $relation_morphed_by_many_exists
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationSampleRelationType
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationSampleRelationType
|
||||||
* @property-read int|null $relation_sample_relation_type_count
|
* @property-read int|null $relation_sample_relation_type_count
|
||||||
|
* @property-read bool|null $relation_sample_relation_type_exists
|
||||||
* @property-read Model|\Eloquent $relationSampleToAnyMorphedRelationType
|
* @property-read Model|\Eloquent $relationSampleToAnyMorphedRelationType
|
||||||
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationSampleToAnyRelationType
|
* @property-read \Illuminate\Database\Eloquent\Collection<int, Simple> $relationSampleToAnyRelationType
|
||||||
* @property-read int|null $relation_sample_to_any_relation_type_count
|
* @property-read int|null $relation_sample_to_any_relation_type_count
|
||||||
|
* @property-read bool|null $relation_sample_to_any_relation_type_exists
|
||||||
* @property-read Simple $relationSampleToBadlyNamedNotManyRelation
|
* @property-read Simple $relationSampleToBadlyNamedNotManyRelation
|
||||||
* @property-read Simple $relationSampleToManyRelationType
|
* @property-read Simple $relationSampleToManyRelationType
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|Simple newModelQuery()
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ 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
|
||||||
@@ -33,7 +31,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 mixed $cast_to_encrypted
|
* @property string $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,8 +8,6 @@ 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,11 +9,10 @@ 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
|
||||||
|
* @property-read bool|null $with_union_type_return_exists
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|UnionTypeModel newModelQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|UnionTypeModel newModelQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|UnionTypeModel newQuery()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|UnionTypeModel newQuery()
|
||||||
* @method static \Illuminate\Database\Eloquent\Builder<static>|UnionTypeModel query()
|
* @method static \Illuminate\Database\Eloquent\Builder<static>|UnionTypeModel query()
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ 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,6 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @mixin \Eloquent
|
* @mixin \Eloquent
|
||||||
* @mixin \Illuminate\Database\Eloquent\Builder
|
* @mixin \Illuminate\Database\Eloquent\Builder
|
||||||
* @mixin \Illuminate\Database\Query\Builder
|
* @mixin \Illuminate\Database\Query\Builder
|
||||||
|
|||||||
@@ -242,8 +242,6 @@ 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
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ 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
|
||||||
@@ -177,8 +175,6 @@ DOC;
|
|||||||
|
|
||||||
$output = <<<'DOC'
|
$output = <<<'DOC'
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Foundation\Application
|
* @return \Illuminate\Foundation\Application
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class SnapshotPhpDriver implements Driver
|
|||||||
{
|
{
|
||||||
public function serialize($data): string
|
public function serialize($data): string
|
||||||
{
|
{
|
||||||
return (string) $data;
|
return str_replace(["\r\n", "\r"], "\n", (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($expected, $this->serialize($actual));
|
Assert::assertSame(str_replace(["\r\n", "\r"], "\n", $expected), $this->serialize($actual));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class SnapshotTxtDriver implements Driver
|
|||||||
{
|
{
|
||||||
public function serialize($data): string
|
public function serialize($data): string
|
||||||
{
|
{
|
||||||
return (string) $data;
|
return str_replace(["\r\n", "\r"], "\n", (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($expected, $this->serialize($actual));
|
Assert::assertSame(str_replace(["\r\n", "\r"], "\n", $expected), $this->serialize($actual));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,6 +55,11 @@ 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();
|
||||||
@@ -66,6 +71,7 @@ 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