Commit Graph
96 Commits
Author SHA1 Message Date
de64d665e0 added laravel 9 support (#1297)
* added laravel 9 support

* added exclude directives to matrix

* fixed matrix

* Update composer.json

* Update run-integration-tests.yml

* Update CHANGELOG.md

Co-authored-by: Ricardo Čerljenko <[email protected]>
Co-authored-by: Barry vd. Heuvel <[email protected]>
2022-01-13 15:38:59 +01:00
Markus Podar 93d987336b Adapt/fix changelog now that a new release was made (#1294)
Triggered by https://github.com/barryvdh/laravel-ide-helper/pull/1287#issuecomment-1008344636
2022-01-09 22:26:59 +01:00
BinotaLIU 744a9cf380 support Castables (#1287) 2022-01-09 18:52:15 +01:00
Simon Jønsson 29dd57e1e2 Support Laravel 8.77 Attributes (#1289)
*  Set properties from model functions returning an Attribute

*  Add test for model Attributes

* 🎨 Fix code style

* 🔖 Update changelog

*  Update test to not require php 8

* 🐛 Fix PHP 7.3 incompatibility

*  Update tests to only run when Illuminate Attribute exists
2022-01-03 10:02:18 +01:00
Michael Newton ebea96213d Improve casts support (#1262)
* support for all possible `Model::$casts` types

* add testing for casts

* update changelog

* update changelog (again?)
2021-11-14 17:40:15 +01:00
Silvan Krähenbühl a091b9c94a Allow casts without property (#1267)
* Allow casts without property

* Update changelog
2021-10-25 13:45:30 +02:00
Wim Reckmanandlaravel-ide-helper c733bde1ea Move default models filename to config (#1241)
* Move default models filename to config

* Add default value when getting models helper filename from config

* composer fix-style

Co-authored-by: laravel-ide-helper <[email protected]>
2021-08-10 07:12:56 +02:00
ZeroThe2nd b6871d09a4 Bugfix/custom types cause exception (#1228)
* bugfix/custom-types-cause-exception

- Added use statements for DBAL Exception and Type
- Added @throws tag to getPropertiesFromTable method
- Added Type::addType() to properly register types
- Added Try-Catch around Type::addType() to give users a proper error message, then throw the exception up.

* bugfix/custom-types-cause-exception

- Updated CHANGELOG.MD

* bugfix/custom-types-cause-exception

- Fixed `Type enum_string_boolean already exists.` error from being triggered when multiple models are loaded
2021-08-04 11:18:55 +02:00
Karel Faille 3b75048d12 Support variadic parameters in models command (#1234) 2021-08-04 11:13:23 +02:00
Richard van Baarsen f4e0fc3695 Allow for PhpDoc for macros with union types (#1148)
* Allow for PhpDoc for macros with union types

* Replace null coalescing operator

* Test init PhpDoc for macros with parameter union types

* Allow for PhpDoc for macros with union return types

* Add helper method to Macro class

* Add changelog entry

* Format

* Complement changelog with PR link

* Add missing return

* Fix test for PHP < 8

* Rewrite PHP 8 test using eval()

* Remove obsolete test class

* Suppress Psalm errors for undefined ReflectionUnionType class

* Remove unreachable return statement
2021-07-30 08:54:59 +02:00
Alexander StockandMarkus Podar af84c78dec Use platformName to determine db type (#1212)
* Use current connection platform (driver) instead of default connection name to determine used dbms. Previous solution isn't working, when multiple connections with custom names are used.

* chore: add changelog

Co-authored-by: Markus Podar <[email protected]>
2021-06-20 10:38:04 +02:00
Daniël de WitandMarkus Podar e71f3d5fc0 Check for traits recursively (#1216)
* Check for traits recursively

* Remove autoload bool from class_uses_recursive

* Add test

* Update src/Console/ModelsCommand.php

Co-authored-by: Markus Podar <[email protected]>

* Updated changelog

Co-authored-by: Markus Podar <[email protected]>
2021-06-20 10:18:14 +02:00
Markus Podarandlaravel-ide-helper 73b1012b92 chore: prepare 2.10.0 release (#1207)
* chore: prepare 2.10.0 release

* composer fix-style

Co-authored-by: laravel-ide-helper <[email protected]>
2021-04-09 08:17:55 +02:00
Terence MarksandTerence Marks ca94ffd99a Fixing issue where incorrect autoloader unregistered (#1210)
Co-authored-by: Terence Marks <[email protected]>
2021-04-09 07:54:00 +02:00
Markus Podar dcbe6c953f chore: update changelog 2021-04-03 00:17:10 +02:00
Markus Podar 1010cdbd26 chore: prepare changelog for 2.9.3 release (#1203) 2021-04-02 19:55:52 +02:00
Markus Podar c8ebf563a0 chore: prepare 2.9.2 release (#1197) 2021-04-01 20:56:14 +02:00
Ahmed Fathy e1af93f43b update changelog 2021-03-31 23:10:46 +02:00
wimskiandlaravel-ide-helper f0c138c4fd Model hooks (#945)
* Model hooks

* composer fix-style

* Fix test for ModelHooks

Co-authored-by: laravel-ide-helper <[email protected]>
2021-03-29 20:49:09 +02:00
netpok df994eb767 Merge branch 'master' into skip_generate_in_phpunit 2021-03-23 09:59:38 +01:00
Balázs Váradi 40c02c524d Add changelog entry 2021-03-22 10:02:17 +01:00
Balázs Váradi 172e430c12 Add missing changelog entry 2021-03-22 09:49:30 +01:00
Barry vd. Heuvel 1a813703fe Update CHANGELOG.md 2021-03-17 10:08:59 +01:00
Markus Podar b246d9ab23 chore: adapt for release of 2.9.1 2021-03-15 21:00:43 +01:00
Markus Podar 8d8302ff6a chore: add missing changelog entries (#1176)
* chore: mention the fix from https://github.com/barryvdh/laravel-ide-helper/pull/1005

* chore: mention https://github.com/barryvdh/laravel-ide-helper/pull/1163
2021-03-15 20:22:08 +01:00
biiiiiigmonsterandMarkus Podar c5c9b2b951 Add comments like table columns. (#1168)
* add comment with @method & @property-read & property-write in models

* add readme comment

* add readme comment

* add comment tag unit-test

* add comment tag unit-test

* both a getter and a setter has a @comment test

* Update README.md

improve README

Co-authored-by: Markus Podar <[email protected]>

* Update CHANGELOG.md

Co-authored-by: Markus Podar <[email protected]>
2021-03-15 07:52:11 +01:00
Markus Podarandlaravel-ide-helper f0959c1184 Update changelog and also automagically apply style fix (#1140)
* changelog: re-order entry after recent merges in master

* composer fix-style

Co-authored-by: laravel-ide-helper <[email protected]>
2021-01-11 09:34:16 +01:00
Fabio Ivona 73c502d5c5 Fix broken ReflectionUnionTypes (#1132)
* Fix exceptions on ReflectionUnionTypes
this commit fixes exceptions thrown on ReflectionUnionType::isBuiltIn() and ReflectionUnionType::getNme() called on php8 union types

* Fix exceptions on ReflectionUnionTypes
this commit fixes exceptions thrown on ReflectionUnionType::isBuiltIn() and ReflectionUnionType::getNme() called on php8 union types

* add check for php8.0

* fix static analysis error

* fix $types variable undefined

* fix failing test

* fix failing test

* fixed style with php-cs-fixer

* add test for union types in parameters and return type

* add test for nullable union types in parameters and return type

* updated CHANGELOG.md
2021-01-11 09:15:22 +01:00
Markus Podarandlaravel-ide-helper 3376522d68 changelog: re-order entry after recent merges in master (#1138)
* changelog: re-order entry after recent merges in master

* composer fix-style

Co-authored-by: laravel-ide-helper <[email protected]>
2021-01-11 09:14:32 +01:00
Stan Daniëls fd30d1190d Fix issues with parsing invokable macros (#1124)
* Fix issues with parsing invokable macros

* Add macro test

# Conflicts:
#	tests/MacroTest.php
2021-01-09 13:24:28 +01:00
Ahmed Fathy 4f13ba85bd Generate PHPDoc for laravel 8.x factories (#1074)
* Generate PHPDoc for laravel 8.x factories

* formatting

* sorting imports

* fix code style

* fix tests in laravel 7.x and lower

* use markTestSkipped

* fix test failing ~_~

* add  argument

* determine the laravel vertion is 8.2.x or upper

* use version_compare instead of artisan command

* use correct namespace

* formatting

* formatting

* formatting

* update next release notes
2021-01-06 13:38:26 +01:00
Markus Podar 0fee1c47d3 Update changelog / releases (#1134) 2020-12-30 18:12:38 +01:00
Markus Podar 64a6b90258 [2.9] Drop support for: Laravel 6, Laravel 7, PHP 7.2 and add doctrine/dbal ^3 (#1114)
* composer.json: drop support for PHP 7.2/Laravel 6+7 and bump dependencies

* tests: remove framework version tests

They don't apply anymore, we're Laravel 8+ only from now on

* changelog: update for ending support for L6/7 and PHP7.2
2020-12-29 11:11:05 +01:00
Markus Podar ae5d7708b7 Remove format and broken generateJsonHelper (#1053)
The JSON generate doesn't work, always generates an empty list.

I looked a bit around and seems changes around 3 years ago broke it.

Since there was no bug report ever about this, I conclude this feature
isn't used and suggest to remove it.

This also changes the config `filename` as there's no need for the
extension-less version and the format is gone too. This change is
backwards compatible as we just add back the `.php` in case it's missing
though users are encouraged to update it.
2020-12-04 09:54:50 +01:00
Matthew Hailwood b3a79fe6c1 Allow casts with a return type of static or this to reference themselves (#1103)
* Allow casts with a return type of static or this to reference themselves

Supports

```php
/**
     * @param $model
     * @param string $key
     * @param $value
     * @param array $attributes
     * @return static
     */
    public function get($model, string $key, $value, array $attributes)
    {
        return new static($value);
    }
```

or

```php
/**
     * @param $model
     * @param string $key
     * @param $value
     * @param array $attributes
     * @return $this
     */
    public function get($model, string $key, $value, array $attributes)
    {
        return new static($value);
    }
```

* Update CHANGELOG.md
2020-12-04 07:33:45 +01:00
Markus Podar b4138e5122 [PHP8] Add initial compatibility (#1106)
* gha: run on PHP8 too

The composer.json constraint is unbound, so it's already "allowed" at least.

* gha: remove php-cs-fixer when running unit tests

- not necessary anyway
- not compatible with PHP8 currently

* gha: lumen 6 and 7 don't support PHP8

* composer.json: allow spatie/phpunit-snapshot-assertions 4.* for PHP8 compatibility

* php8-compat: Method ReflectionParameter::getClass() is deprecated

* php8-compat: adapt expected error message depending on PHP version

* composer.json: bump mockery to 1.3.3 minimum

This is the minimum version also supporting PHP8

* gha: disable prefer-lowest for PHP8

Some lower version requirements like doctrone/dbal won't work and
would require at least dbal 2.12.0, which in turn doesn't support PHP 7.2
anymore.

So instead of bumping dbal and excluding PHP 7.2 users, we ignore the
lowest version for PHP 8 for the time being.

* Update CHANGELOG.md
2020-12-04 07:28:07 +01:00
domkrm 0168e7256b Fix generate error when macroable class has a "fake" method (#1066) 2020-09-21 16:26:32 +02:00
Isaac EarlandMarkus Podar 1044f466e9 allow model_locations to have glob patterns (#1059)
* allow model_locations to have glob patterns

This if statement check for a valid directory was happening to early.  It was checking the string that contained the wildcards to see if it is a valid directory and always failing.  Need to check after the foreach starts. fixes #1058 .

* test(#1059) Allow glob directories

* Fix tests to chdir() into where to expect the glob to work

* Update CHANGELOG.md

Co-authored-by: Markus Podar <[email protected]>
2020-09-20 22:06:24 +02:00
Richard van BaarsenandMarkus Podar 2ff9672a49 Add @see location for macros & mixins to PhpDoc (#1054)
* Add @see location for macros & mixins to PhpDoc

* Fix CS

* Add entry to changelog

* Improve changelog entry

* Adjust CS

* Update CHANGELOG.md

Co-authored-by: Markus Podar <[email protected]>
2020-09-11 16:35:41 +02:00
Markus Podar 4ef3876b94 Fix compatibility with Lumen (#1043)
* Fix compatibility with Lumen

Fixes https://github.com/barryvdh/laravel-ide-helper/issues/1042

Got broken by https://github.com/barryvdh/laravel-ide-helper/pull/1026

TL;DR: can't use anything in the `Illuminate\Foundation` namespace
without safety check, as it doesn't exist in Lumen.

* Add helper to check for Laravel

* Use helper to check for Laravel
2020-09-11 09:13:35 +02:00
Markus Podar 2a3c7fb087 Update CHANGELOG.md (#1046) 2020-09-09 09:13:22 +02:00
efinder2andMarkus Podar 7305504c99 Created a positiblity to add custom relation type (#987)
* Created a positiblity to add custom relation type

* Changed access modifier

Co-authored-by: Markus Podar <[email protected]>

* fixed hints from code review

* Added Test for https://github.com/barryvdh/laravel-ide-helper/pull/987

* composer fix-style

* Clarify doc in config entry

* Update CHANGELOG.md

Co-authored-by: Markus Podar <[email protected]>
2020-09-08 07:18:43 +02:00
Artem KryukovandMarkus Podar 186340bedc Fix phpdoc generate for custom cast with parameter (#986)
* Fix phpdoc generate for custom cast with parameter

* Add param for cast

* Simplify cast class name normalizing

Co-authored-by: Markus Podar <[email protected]>

* Update changelog

* composer fix-style

Co-authored-by: Markus Podar <[email protected]>
2020-09-07 22:39:35 +02:00
Markus Podar 4aa2e6a576 Update CHANGELOG.md (#1040) 2020-09-07 19:03:31 +02:00
domkrmandDominik Krämer 3a22b8daf6 Add better support for macros and mixins (#1006)
Co-authored-by: Dominik Krämer <[email protected]>
2020-09-06 07:58:13 +02:00
Markus Podar 3ea232dc3a Add initial changelog (#1035)
At least until 2.6.6; quite a chore ;)

The idea is to keep it updated; ideally each PR updates the changelog
otherwise we/I will keep track of the "notable" changes.

The goal would be that once the next release is about to happen, the
changes collected here so far can just be copy-pasted to the release
notes and the top link has to be bumped.

I would define "notable" as user-facing, thus many internal changes
(readme, test suite, etc.) have not been added to give end-users a
clearer focus what may have changed/improved _for them_.
2020-09-03 06:00:59 +02:00