* Fixes 992 (class names in phpdoc where using imported names incorrectly when writing to external file).
Disabled using imported name in external file, except for the models own name.
* Added missing declare strict types
Ensures they're always ordered / processed independent of the
environment. `ClassMapGenerator::createMap` uses symfony/finder which
itself supports sorting but this isn't used from the `ClassMapGenerator`.
Fixes https://github.com/barryvdh/laravel-ide-helper/issues/885
* Make writing relation count properties optional
* Clean up description
* Add test for write_model_magic_where=false
* Add test for write_model_relation_count_properties=false
* Fixed#565 by using the imported class name if present. Fixed a bug where cast type was not properly added when the return type was found via phpdoc.
* Fixed errors with phpdocumentor/type-resolver:1.0
* Generate noinspections PHPStorm tags
* Add comments about PHPStorm noinspection tags
* Fix line to long warnings
* Add tests for PHPStorm noinspection
Co-authored-by: Michał Zgliński <[email protected]>
These two methods are already regular methods on the trait, there's no
need to add them and additionally they're not static, so their
definition was changed for the worse.
The other methods are magic so it's fine to keep them.
Fixes https://github.com/barryvdh/laravel-ide-helper/issues/917
* Add custom collection support for get and all methods
* Only add get and all when using custom collection
* Use static instead of class name
* Add missing custom collection test with relation
* Use class reference over string
Co-Authored-By: Markus Podar <[email protected]>
* Fix when using class reference
Co-authored-by: Markus Podar <[email protected]>
* Add ignored_models as config option
* Add README.md entry
* Add tests
* Change name of test class
* Add Ignored to the return values from the mocked filesystem
* Improve test speed by adding prestissimo
* Revert "Improve test speed by adding prestissimo"
This reverts commit 246a9f2a78.
If the property name matches the foreign key name
creating a BelongsTo relation triggers an undefined
property error. Disabling constraints prevents
accessing the property and thus prevents the error.
Laravel 5.8 introduced a feature to support a custom date class via
`Date::use()`, see https://github.com/laravel/framework/pull/25320
When e.g. using `Date::use(CarbonImmutable)` in a project, it means
all date casts are not returning `\Illuminate\Support\Carbon` anymore
but `\Carbon\CarbonImmutable`, which means all the generated type hints
for dates are now wrong.
This change tries to be still backwards compatible with Laravel < 5.8
which do not have the Date facade.
* x to Many relationships are detected via a `Many` keyword in the relationship object class name
* reason: example: `belongsTo` was incorrectly recognized as `belongsToMany`
* adds `@property-read int|null $x2Many_relationship_method_name_count` model class docBlock comment
* when model makes use of `withCount` or `loadCount` there is a property on the resource `$instance->relationship_method_count` that states the count of related models
* can be `NULL` when `withCount` or `loadCount` aren't used