Commit Graph
657 Commits
Author SHA1 Message Date
Markus PodarandBarry vd. Heuvel ea17a4076b Small improvements for github actions (#961)
* Remove travis leftovers

* gha: remove --no-interaction

* gha: use separate job for style check and use composer scripts

* gha: give workflow a nice name

* gha: remove packages we don't need, reduce workflow runtime

Co-authored-by: Barry vd. Heuvel <[email protected]>
2020-06-22 21:07:19 +02:00
Barry vd. Heuvel 5402b5ebfa Update run-tests.yml 2020-06-22 20:58:32 +02:00
feekandmr-feek 545298c44d [Chore] Introduce psalm (#962)
* chore: introduce psalm

* chore: remove dead code

* chore: run psalm workflow

* chore: run psalm in grumphp

* normalize composer.json

* chore: analyse --> analyze

* chore: just remove psalm when running tests instead of worrying about dependency mismatch hell

Co-authored-by: mr-feek <[email protected]>
2020-06-22 20:28:59 +02:00
Barry vd. HeuvelandMarkus Podar 3381123e71 Use Github Actions (#960)
* Use Github Actions

* Fix PHP versions

* Update run-tests.yml

* Update run-tests.yml

* Delete .travis.yml

* Update run-tests.yml

* Update composer.json

* Update run-tests.yml

* Update .github/workflows/run-tests.yml

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

* Update .github/workflows/run-tests.yml

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

Co-authored-by: Markus Podar <[email protected]>
2020-06-22 17:46:01 +02:00
Tom Witkowski 94948e4f2c composer normalize (#959)
* add gh action

* normalize composer.json
2020-06-22 17:32:22 +02:00
Tom Witkowski b9293420c3 add phpunit tests (#957) 2020-06-22 13:32:19 +02:00
Gabriel Langer 6f20800eef [Model] Simplify full namespaces for already included resources (#954)
* 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
2020-06-20 12:53:36 +02:00
Tom Witkowski 7203ebee24 Fix inline doc-block for final models (#955)
* fix final model classes doc-block generation

* add phpunit tests
2020-06-20 08:22:07 +02:00
fgibaux d35ea6e1d4 Decimal columns as string in Models (#948)
* Decimal columns as string in Models

To follow Eloquent casts

* update tests for decimals
2020-06-09 20:54:26 +02:00
ZhangWei f3e48cbcce Test auth is binded before detect Auth driver (#946)
* Test `auth` is binded before detect Auth driver

some project may not need Auth service provider

* fix codingstyle
2020-06-06 22:28:00 +02:00
Hamid Alaei Varnosfaderani 7515cd206d add optional (#932) 2020-05-05 10:27:37 +02:00
Benedikt Franke 8e34870e2a Clean up the README.md (#931) 2020-05-03 09:50:21 +02:00
Markus Podar b7197aec89 Document that model_locations/dir now supports glob (#925)
Feature was added with https://github.com/barryvdh/laravel-ide-helper/pull/921
2020-04-22 21:20:09 +02:00
Daniel Mason 378adeb1f5 Add static return type to builder methods (#924)
* Add static return type to builder methods

* formatting

* add eloquent builder test

* change to use assertSame
2020-04-22 21:18:54 +02:00
Barry vd. Heuvel 5f677edc14 Private->protected v2.7.0 2020-04-22 11:57:26 +02:00
Barry vd. Heuvel 1b611d7f80 Check if CastsAttributes exists 2020-04-22 11:55:33 +02:00
Krot Eval a233d5bd5a Ability to use patterns for model_locations (#921)
Example: app/Services/*/Models
2020-04-22 06:33:49 +02:00
belamov cfa9a81d65 Added support for Laravel 7 custom casts (#913)
* added support for laravel 7 custom casts

* refactored tests; added test cases

* added test case

* resolved method dublication
2020-04-22 06:32:40 +02:00
mzglinskiandMichał Zgliński dcf76c1a81 Generate noinspections PHPStorm tags (#905)
* 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]>
2020-04-21 21:36:27 +02:00
Barry vd. Heuvel bef8158d02 Merge pull request #901 from loilo/fix-default-param-values
Prevent generation of invalid code for certain parameter default values
2020-04-21 21:35:11 +02:00
Barry vd. Heuvel 8381a2ebdd Merge pull request #906 from mfn/mfn-return-reflection
Infer return type from reflection if no phpdoc given
2020-04-21 21:16:27 +02:00
Barry vd. Heuvel 6bab45b8c2 Merge pull request #920 from mr-feek/include-interfaces
if a model implements interfaces, include them in the stub
2020-04-21 21:15:37 +02:00
Feek 2617352869 if a model implements interfaces, include them in the stub 2020-04-21 02:32:02 -07:00
Barry vd. Heuvel ce275a9bf2 Merge pull request #919 from mr-feek/unregister-custom-autoloader
fix: unregister meta command custom autoloader when it is no longer needed
2020-04-20 18:22:59 +02:00
Feek b7b835bf09 fix: unregister meta command custom autoloader when it is no longer needed. closes #915 2020-04-19 18:05:23 -07:00
Barry vd. Heuvel b0481aef33 Merge pull request #908 from goodjack/patch-1
Update the version in the comment
2020-04-19 07:51:11 +02:00
Barry vd. Heuvel f80887914b Update helper.php 2020-04-19 07:51:00 +02:00
Markus Podar f4ae4c4b45 Remove unnecessary and wrong definition of SoftDelete methods (#918)
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
2020-04-19 07:49:54 +02:00
Daniel MasonandMarkus Podar 6a27c5df68 Add custom collection support for get and all methods (#903)
* 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]>
2020-04-19 07:49:23 +02:00
小克 7be6afbe5f Update the version in the comment 2020-04-06 18:52:32 +08:00
Markus Podar b72689755b Infer return type from reflection if no phpdoc given 2020-04-01 22:44:26 +02:00
Florian ReuschelandMarkus Podar 3cc7d7ccf6 Improve test method doc block
Co-Authored-By: Markus Podar <[email protected]>
2020-03-31 21:19:33 +02:00
leo108 18588eacf3 Make hasOne / hasOneThrough and morphOne nullable. (#864) 2020-03-31 14:40:50 +02:00
Loilo da59650fb2 Add test for method default values with special chars 2020-03-26 09:37:33 +01:00
Loilo fe2890925e Prevent generation of invalid code for certain parameter default values 2020-03-25 23:51:04 +01:00
Barry vd. Heuvel 1d1484025c Test L7 (#899)
* Test L7

* Update composer.json
2020-03-10 15:00:00 +01:00
Pataar 0692626c41 Add ignored_models as config option (#890)
* 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.
2020-03-10 12:18:29 +01:00
Sergio García 90437012b8 Fix camelCase duplicated properties generator. (#881)
* Fix camelCase duplicated properties generator.

* Add basic tests for camel case
2020-03-10 12:17:29 +01:00
Kirill Uksusov e743f44011 Fixed #892 (#894)
* Fixed #892

* #892 test added
2020-03-03 10:48:00 +01:00
Barry vd. Heuvel edd69c5e05 Allow L7 v2.6.7 2020-02-25 21:41:32 +01:00
Markus Podar 68d3d19298 tests: fix after recent merged "stepping on each others toes" (#882)
🩰
2020-02-02 21:12:24 +01:00
Markus Podar 75149ddb1f tests: cover reset and smart-reset options (#875) 2020-01-12 18:24:10 +01:00
Markus Podar e020e265a4 Fixed bug in model command where loose string comparison would override properties for model relations (#873) 2020-01-12 18:23:52 +01:00
Markus Podar 6af1f32d96 tests: fix typo in migration 🤦‍♂️ and adapt tests (#874) 2020-01-12 18:23:27 +01:00
Matt A 972befd7aa Prevent undefined property errors (#877)
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.
2020-01-12 17:51:04 +01:00
Johannes Rudolph 805c4e9a2a Update ModelsCommand.php (#862)
Improve Error Reporting for easy debugging
2020-01-05 11:53:34 +01:00
Markus Podar c0bb9ee1fd Add more tests (#870)
* tests: be more systematic when testing discrete column types

Still not covering all due to SQLite limitation

* tests: relations of models

* tests: model in another namespace gets correctly qualified

* tests: cover SoftDeletes trait

* tests: cover some variants of getter
2020-01-03 23:08:24 +01:00
Markus Podar d9a731daba [TESTS] Add some basic tests for ModelsCommand (#869)
* tests: add abstract class for all database related tests

* tests: add abstract class for all ModelsCommand related tests

* tests: add GenerateBasicPhpdoc test

* tests: add CustomDate test

* tests: remove MITM abstract TestCaseDatabase, not useful here

* tests: skip new ModelsCommand test on Laravel < 6

* tests: remove CarbonImmutable checked

Since we decided to skip for Laravel < 6.0 anyway, it's always present
2020-01-03 09:52:10 +01:00
Markus Podar d3b24ffeae Bump grumphp version (#867)
The current version emits the following:
```
Deprecated: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in laravel-ide-helper/vendor/phpro/grumphp/src/Locator/ConfigurationFile.php on line 75

Deprecated: strpos(): Non-string needles will be interpreted as strings in the future. Use an explicit chr() call to preserve the current behavior in laravel-ide-helper/vendor/phpro/grumphp/src/Locator/ConfigurationFile.php on line 75

```

Manually tested it locally, worked as expected.
2020-01-02 15:21:05 +01:00
Markus Podar 015cc6c493 Drop support for PHP < 7.2 and improve test matrix (#868)
* travis: use explicit test matrix and drop PHP < 7.2

* composer: use more liberal version requirements for orchestra

This is to easier satisfy when we want to use older Laravel versions on travis

* tests: add shim for assertStringContainsString for older Laravel/phpunit versions

Specifically, Laravel 5.5 works with an older phpunit version, which
does not feature assertStringContainsString

* composer: bump minimum PHP version to 7.2

* travis: explicitly install Mockery for testing older Laravel versions

* composer: make mockery a root requirement and remove the one from travis

* travis: further improve based on suggestions from https://github.com/fruitcake/laravel-cors/blob/master/.travis.yml

* tests: skip test if mixin markers are already present in model

We're also testing Laravel 5.5 which contains them (they were removed later)
2020-01-02 14:39:34 +01:00