Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: barryvdh/laravel-ide-helper
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.0.0
Choose a base ref
...
head repository: barryvdh/laravel-ide-helper
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.1.0
Choose a head ref
  • 13 commits
  • 33 files changed
  • 14 contributors

Commits on Mar 11, 2024

  1. Add pivot class property (#1518)

    * Add pivot class property
    
    * Add test for pivot class properties
    
    * Fix failed test for pivot class properties
    
    * Update CHANGELOG.md
    
    * Fix failed test
    d3v2a authored Mar 11, 2024
    Copy the full SHA
    ac7e186 View commit details

Commits on Apr 1, 2024

  1. Fix return value of scopes from parent class (#1366)

    sforward authored Apr 1, 2024
    Copy the full SHA
    6338abb View commit details

Commits on Jul 12, 2024

  1. Improved attribute handling with types and Attribute support (#1567)

    * Add `AllowDynamicProperties` Attribute to cooperate with php8.2 deprecation
    
    * lint snapshot
    
    * Fix collection attribute typing
    
    * Update CHANGELOG.md
    
    * Update CHANGELOG.md
    
    * Update CHANGELOG.md
    
    * Update composer.json
    
    * Fix collectino with template types WIP
    
    * Add `AllowDynamicProperties` Attribute to cooperate with php8.2 deprecation
    
    * Fix collection attribute typing
    
    * Update CHANGELOG.md
    
    * Update CHANGELOG.md
    
    * Update composer.json
    
    * composer fix-style
    
    * Fix tests
    
    * Fix tests
    
    * composer fix-style
    
    * Fix collectino with complex template types{
    
    * Delete phpactor
    
    * Install from scrumble repo
    
    * Implemented correct attribute handling
    
    * composer fix-style
    
    * Revert "Install from scrumble repo"
    
    This reverts commit 3f1057a.
    
    * Re-add barryvdh links
    
    * Revert "Update composer.json"
    
    This reverts commit 98252fe.
    
    * Fix pivot test
    
    * Correct CHANGELOG.md with attribute merge request
    
    * More clear PhpDocTypeParser filename and clarified directory according to PSR12
    
    ---------
    
    Co-authored-by: GeoSot <geo.sotis@gmail.com>
    Co-authored-by: laravel-ide-helper <laravel-ide-helper@users.noreply.github.com>
    Co-authored-by: Luukdewaaier <54863704+Luukdewaaier@users.noreply.github.com>
    Co-authored-by: Luuk de Weijer <luuk@scrumble.nl>
    5 people authored Jul 12, 2024
    Copy the full SHA
    c6509b6 View commit details
  2. composer fix-style (#1558)

    mfn authored Jul 12, 2024
    Copy the full SHA
    0cf178a View commit details
  3. Update CHANGELOG.md

    barryvdh authored Jul 12, 2024
    Copy the full SHA
    a157391 View commit details
  4. Improve config file (#1564)

    * Improve config file
    
    - Terminate all descriptions with a dot .
    - Update outdated descriptions
    - Add missing examples
    
    * Fix capitalizations
    spawnia authored Jul 12, 2024
    Copy the full SHA
    67c00c0 View commit details
  5. feat: add support for AsEnumCollection casts (#1557)

    * Adding support for casting to AsEnumCollection
    
    * Adding missing string to advanced_casts table for enum_collection
    
    * Added to snapshots and ArrayCastsWithComment
    
    * Update CHANGELOG.md
    
    * Reverted automated whitespace, strict changes
    
    * Updated test snapshots, tests passing
    
    * Whitespace revert
    
    ---------
    
    Co-authored-by: Barry vd. Heuvel <barry@fruitcake.nl>
    Braunson and barryvdh authored Jul 12, 2024
    Copy the full SHA
    672acce View commit details
  6. Add support in morphTo relationship for null values (1547) (#1549)

    Co-authored-by: Barry vd. Heuvel <barry@fruitcake.nl>
    matysekmichal and barryvdh authored Jul 12, 2024
    Copy the full SHA
    f7a3dc8 View commit details
  7. Add static to isBuiltin() check in ide-helper:models (#1541)

    * Add `\\static` as check
    
    For some reason, the `static` keyword as a return type, does not return `isBuiltin()` === true, so a `\\` is added. We need to manually add it to the built in check.
    
    * Update ModelsCommand.php
    
    * Add tests
    
    * Add CHANGELOG.md entry
    
    ---------
    
    Co-authored-by: Markus Podar <markus@fischer.name>
    Co-authored-by: Barry vd. Heuvel <barry@fruitcake.nl>
    3 people authored Jul 12, 2024
    Copy the full SHA
    f5759e2 View commit details
  8. Bump dev alias to 3.1

    barryvdh authored Jul 12, 2024
    Copy the full SHA
    ccac27c View commit details
  9. fix: unknown format PHPDoc (#1538)

    schrosis authored Jul 12, 2024
    Copy the full SHA
    001091e View commit details
  10. Fix style again (#1569)

    barryvdh authored Jul 12, 2024
    Copy the full SHA
    2dba191 View commit details
  11. Update CHANGELOG.md (#1570)

    barryvdh authored Jul 12, 2024
    Copy the full SHA
    591e7d6 View commit details
Showing with 1,014 additions and 60 deletions.
  1. +17 −3 CHANGELOG.md
  2. +1 −1 composer.json
  3. +25 −25 config/ide-helper.php
  4. +79 −31 src/Console/ModelsCommand.php
  5. +79 −0 src/Parsers/PhpDocReturnTypeParser.php
  6. +2 −0 tests/Console/ModelsCommand/AdvancedCasts/Models/AdvancedCast.php
  7. +4 −0 tests/Console/ModelsCommand/AdvancedCasts/__snapshots__/Test__test__1.php
  8. +59 −0 tests/Console/ModelsCommand/Attributes/Models/BackedAttribute.php
  9. +77 −0 tests/Console/ModelsCommand/Attributes/__snapshots__/Test__test__1.php
  10. +51 −0 tests/Console/ModelsCommand/GenerateMixinCollection/Models/WithCollection.php
  11. +9 −0 tests/Console/ModelsCommand/GenerateMixinCollection/NonModels/CollectionModel.php
  12. +9 −0 tests/Console/ModelsCommand/GenerateMixinCollection/NonModels/NonModel.php
  13. +24 −0 tests/Console/ModelsCommand/GenerateMixinCollection/Test.php
  14. +85 −0 tests/Console/ModelsCommand/GenerateMixinCollection/__snapshots__/Test__test__1.php
  15. +21 −0 tests/Console/ModelsCommand/LaravelCustomCasts/Casts/CustomCasterWithStaticReturnType.php
  16. +2 −0 tests/Console/ModelsCommand/LaravelCustomCasts/Models/CustomCast.php
  17. +3 −0 tests/Console/ModelsCommand/LaravelCustomCasts/__snapshots__/Test__test__1.php
  18. +21 −0 tests/Console/ModelsCommand/Morphs/Models/Morphs.php
  19. +24 −0 tests/Console/ModelsCommand/Morphs/Test.php
  20. +39 −0 tests/Console/ModelsCommand/Morphs/__snapshots__/Test__test__1.php
  21. +18 −0 tests/Console/ModelsCommand/Pivot/Models/ModelWithPivot.php
  22. +11 −0 tests/Console/ModelsCommand/Pivot/Models/Pivots/CustomPivot.php
  23. +24 −0 tests/Console/ModelsCommand/Pivot/Test.php
  24. +48 −0 tests/Console/ModelsCommand/Pivot/__snapshots__/Test__test__1.php
  25. +13 −0 tests/Console/ModelsCommand/QueryScopes/Models/Post.php
  26. +15 −0 tests/Console/ModelsCommand/QueryScopes/Models/PostParent.php
  27. +24 −0 tests/Console/ModelsCommand/QueryScopes/Test.php
  28. +189 −0 tests/Console/ModelsCommand/QueryScopes/__snapshots__/Test__test__1.php
  29. +1 −0 tests/Console/ModelsCommand/SimpleCasts/Models/SimpleCast.php
  30. +1 −0 tests/Console/ModelsCommand/SimpleCasts/__snapshots__/Test__test__1.php
  31. +1 −0 tests/Console/ModelsCommand/migrations/____advanced_casts_table.php
  32. +20 −0 tests/Console/ModelsCommand/migrations/____backed_attribute_table.php
  33. +18 −0 tests/Console/ModelsCommand/migrations/____morphs_table.php
20 changes: 17 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

All notable changes to this project will be documented in this file.

[Next release](https://github.com/barryvdh/laravel-ide-helper/compare/v3.0.0...master)
[Next release](https://github.com/barryvdh/laravel-ide-helper/compare/v3.1.0...master)
--------------

### Fixed
@@ -11,6 +11,20 @@ All notable changes to this project will be documented in this file.

### Added

2024-07-12, 3.1.0
------------------

### Fixed
- Fix return value of query scopes from parent class [#1366 / sforward](https://github.com/barryvdh/laravel-ide-helper/pull/1366)
- Add static to isBuiltin() check in ide-helper:models [#1541 / bram-pkg](https://github.com/barryvdh/laravel-ide-helper/pull/1541)
- Fix for getSomethingAttribute functions which return a collection with type templating in the phpDoc. [#1567 / stefanScrumble](https://github.com/barryvdh/laravel-ide-helper/pull/1567)

### Added
- Add type to pivot when using a custom pivot class [#1518 / d3v2a](https://github.com/barryvdh/laravel-ide-helper/pull/1518)
- Add support in morphTo relationship for null values [#1547 / matysekmichal](https://github.com/barryvdh/laravel-ide-helper/pull/1547)
- Add support for AsEnumCollection casts [#1557 / Braunson](https://github.com/barryvdh/laravel-ide-helper/pull/1557)
- Support for Attribute class in attributes [#1567 / stefanScrumble](https://github.com/barryvdh/laravel-ide-helper/pull/1567)

2024-03-01, 3.0.0
------------------

@@ -22,7 +36,7 @@ All notable changes to this project will be documented in this file.
- Use short types (`int` and `bool` instead of `integer` and `boolean`) [#1524 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1524)

### Removed
- Support for Laravel 9 and use of doctrine/dbal [#1512 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1512)
- Support for Laravel 9 and use of doctrine/dbal [#1512 / barryvdh](https://github.com/barryvdh/laravel-ide-helper/pull/1512)
With this functionality gone, a few changes have been made:
- support for custom datatypes has been dropped (config `custom_db_types`) unknown data types default to `string` now and to fix the type, add a proper cast in Eloquent
- You _might_ have top-level dependency on doctrine/dbal. This may have been in the past due to ide-helper, we suggest to check if you still need it and remove it otherwise
@@ -86,7 +100,7 @@ All notable changes to this project will be documented in this file.
- Handle PHP 8.1 deprecation warnings when passing `null` to `new \ReflectionClass` [#1351 / mfn](https://github.com/barryvdh/laravel-ide-helper/pull/1351)
- Fix issue where \Eloquent is not included when using write_mixin [#1352 / Jefemy](https://github.com/barryvdh/laravel-ide-helper/pull/1352)
- Fix model factory method arguments for Laravel >= 9 [#1361 / wimski](https://github.com/barryvdh/laravel-ide-helper/pull/1361)
- Improve return type of mock helper methods in tests [#1405 / bentleyo](https://github.com/barryvdh/laravel-ide-helper/pull/1405)
- Improve return type of mock helper methods in tests [#1405 / bentleyo](https://github.com/barryvdh/laravel-ide-helper/pull/1405)
- Fix Castable class if failed to detect it from return types [#1388 / kwarcu](https://github.com/barryvdh/laravel-ide-helper/pull/1388)

### Added
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "3.0-dev"
"dev-master": "3.1-dev"
},
"laravel": {
"providers": [
50 changes: 25 additions & 25 deletions config/ide-helper.php
Original file line number Diff line number Diff line change
@@ -4,29 +4,29 @@

/*
|--------------------------------------------------------------------------
| Filename & Format
| Filename
|--------------------------------------------------------------------------
|
| The default filename
| The default filename.
|
*/

'filename' => '_ide_helper.php',
'filename' => '_ide_helper.php',

/*
|--------------------------------------------------------------------------
| Models filename
|--------------------------------------------------------------------------
|
| The default filename for the models helper file
| The default filename for the models helper file.
|
*/

'models_filename' => '_ide_helper_models.php',

/*
|--------------------------------------------------------------------------
| Where to write the PhpStorm specific meta file
| PhpStorm meta filename
|--------------------------------------------------------------------------
|
| PhpStorm also supports the directory `.phpstorm.meta.php/` with arbitrary
@@ -41,15 +41,15 @@
| Fluent helpers
|--------------------------------------------------------------------------
|
| Set to true to generate commonly used Fluent methods
| Set to true to generate commonly used Fluent methods.
|
*/

'include_fluent' => false,

/*
|--------------------------------------------------------------------------
| Factory Builders
| Factory builders
|--------------------------------------------------------------------------
|
| Set to true to generate factory generators for better factory()
@@ -63,29 +63,29 @@

/*
|--------------------------------------------------------------------------
| Write Model Magic methods
| Write model magic methods
|--------------------------------------------------------------------------
|
| Set to false to disable write magic methods of model
| Set to false to disable write magic methods of model.
|
*/

'write_model_magic_where' => true,

/*
|--------------------------------------------------------------------------
| Write Model External Eloquent Builder methods
| Write model external Eloquent builder methods
|--------------------------------------------------------------------------
|
| Set to false to disable write external eloquent builder methods
| Set to false to disable write external Eloquent builder methods.
|
*/

'write_model_external_builder_methods' => true,

/*
|--------------------------------------------------------------------------
| Write Model relation count properties
| Write model relation count properties
|--------------------------------------------------------------------------
|
| Set to false to disable writing of relation count properties to model DocBlocks.
@@ -96,11 +96,11 @@

/*
|--------------------------------------------------------------------------
| Write Eloquent Model Mixins
| Write Eloquent model mixins
|--------------------------------------------------------------------------
|
| This will add the necessary DocBlock mixins to the model class
| contained in the Laravel Framework. This helps the IDE with
| contained in the Laravel framework. This helps the IDE with
| auto-completion.
|
| Please be aware that this setting changes a file within the /vendor directory.
@@ -134,7 +134,7 @@
| for models.
|
| glob patterns are supported to easier reach models in sub-directories,
| e.g. `app/Services/* /Models` (without the space)
| e.g. `app/Services/* /Models` (without the space).
|
*/

@@ -152,15 +152,15 @@
*/

'ignored_models' => [

// App\MyModel::class,
],

/*
|--------------------------------------------------------------------------
| Models hooks
|--------------------------------------------------------------------------
|
| Define which hook classes you want to run for models to add custom information
| Define which hook classes you want to run for models to add custom information.
|
| Hooks should implement Barryvdh\LaravelIdeHelper\Contracts\ModelHookInterface.
|
@@ -175,7 +175,7 @@
| Extra classes
|--------------------------------------------------------------------------
|
| These implementations are not really extended, but called with magic functions
| These implementations are not really extended, but called with magic functions.
|
*/

@@ -197,7 +197,7 @@
*/

'interfaces' => [

// App\MyInterface::class => App\MyImplementation::class,
],

/*
@@ -228,7 +228,7 @@

/*
|--------------------------------------------------------------------------
| Property Casts
| Property casts
|--------------------------------------------------------------------------
|
| Cast the given "real type" to the given "type".
@@ -255,9 +255,9 @@
| Force FQN usage
|--------------------------------------------------------------------------
|
| Use the fully qualified (class) name in docBlock,
| event if class exists in a given file
| or there is an import (use className) of a given class
| Use the fully qualified (class) name in DocBlocks,
| even if the class exists in the same namespace
| or there is an import (use className) of the class.
|
*/
'force_fqn' => false,
@@ -279,8 +279,8 @@
|--------------------------------------------------------------------------
|
| Sometimes it's needed to create custom relation types. The key of the array
| is the Relationship Method name. The value of the array is the canonical class
| name of the Relationship, e.g. `'relationName' => RelationShipClass::class`.
| is the relationship method name. The value of the array is the fully-qualified
| class name of the relationship, e.g. `'relationName' => RelationShipClass::class`.
|
*/
'additional_relation_types' => [],
Loading