100 Commits
Author SHA1 Message Date
Markus Podar 0cf178aca9 composer fix-style (#1558) 2024-07-12 15:53:54 +02:00
Markus Podar 8eab699835 phpunit --migrate-configuration (#1526) 2024-02-19 20:52:29 +01:00
Markus PodarandBarry vd. Heuvel 49ac75d805 Remove --smart-reset completely (#1525)
* Remove `--smart-reset` completely

See https://github.com/barryvdh/laravel-ide-helper/pull/1523#issuecomment-1952313183

* Update CHANGELOG.md

---------

Co-authored-by: Barry vd. Heuvel <[email protected]>
2024-02-19 14:03:16 +01:00
Markus Podar 9af62e243d Bump minimum PHP version to 8.1 & misc maintenance (#1521)
* Bump minimum PHP version to 8.1

Laravel 10 doesn't support 8.0 anyway

* Remove phpunit 9

* gha: remove unused matrix dimension

* gha: bump runner os

* tests: remove outdated version checks
2024-02-17 22:08:15 +01:00
Markus Podar bcc233280b [TEST] Show that custom phpdoc tags without space afterwards are unexpectedly changed (#981)
* tests: show that custom phpdoc tags without space afterwards are unexpectedly changed

This adds a test for the (current bug) behaviour of https://github.com/barryvdh/laravel-ide-helper/issues/666

If this ever gets fixed, this fails and needs to be adapted,
ensuring it won't break again.

* test: adapt now that #666 has been fixed
2024-02-16 21:38:43 +01:00
Markus Podar b47a118300 Adjust gitattribute (#1515)
and make up for the missing php-cs-fixer changes

The rest of the changes is just:
- sorted alphabetically
- align the `export-ignore` column
2024-02-14 14:49:24 +01:00
Markus Podar 512612f22f Remove outdated dev references to older versions (#1508) 2024-02-07 19:29:10 +01:00
Markus Podar a8b34ad228 Removed support for Laravel 8 and therefore for PHP < 8.0 (#1504)
* Removed support for Laravel 8 and therefore for PHP < 8.0

* Update php-cs-fixer to v3

* composer fix-style
2024-02-05 13:25:08 +01:00
Markus Podar cf4687f98c Prepare 2.14.0 release (#1503) 2024-02-05 09:13:57 +01:00
Markus Podar e65d30b27a Remove doctrine/dbal:^4 support (#1507)
* Remove doctrine/dbal:^4 support

Tests fail with:
`PHP Fatal error:  Declaration of Illuminate\Database\PDO\Concerns\ConnectsToDatabase::connect(array $params, $username = null, $password = null, array $driverOptions = []) must be compatible with Doctrine\DBAL\Driver::connect(array $params): Doctrine\DBAL\Driver\Connection in /home/runner/work/laravel-ide-helper/laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Database/PDO/Concerns/ConnectsToDatabase.php on line 22`

* gha: install with downgrading all dependencies

* Add note to readme
2024-02-05 06:54:43 +01:00
Markus Podar 416e0ab243 Merge pull request #1506 from olexoliinyk0/test/case-of-1505
test: case for the issue #1505;
2024-02-03 21:02:28 +01:00
Markus Podar 9374952402 Adapt snapshot testcase 2024-02-03 20:56:57 +01:00
Markus Podar 726e595578 Add support for nikic/php-parser:^5 and (hopefully) doctrine/dbal:^4 (#1502)
* Add support for nikic/php-parser:^5

- `createForHostVersion` has been added to php-parse 4.18 so code can
  run with both versions [1]
- therefore also bumped the minimum required version to it

Note:
The dev dependency vimeo/psalm is **not** compatible with
php-parser:^5 currently. This does not impact usages of this library,
but sometimes cause friction when working on this library.
For our CI this isn't a problem, because we already remove that
dependency before running the test suite.

[1] https://github.com/nikic/PHP-Parser/blob/master/UPGRADE-5.0.md#changes-to-the-parser-factory

* gha: prevent cancelling of all jobs if one fails

* Update CHANGELOG.md

* gha: remove unsupported Laravel / PHP combinations

According to https://laravel.com/docs/10.x/releases

* Add dbal:^4 too
2024-01-28 19:33:31 +01:00
Markus Podar 21352a1e48 Merge pull request #1473 from sergiy-petrov/php8.3 2023-10-05 15:58:39 +02:00
Markus Podar 3cdd3af631 chore: add dependabot for github actions (#1470) 2023-09-29 09:26:16 +02:00
Markus Podar 1a3affd4f8 Catch error and exception (#1431) (#1465)
Credit goes to @dongm2ez
2023-09-06 12:35:33 +02:00
Markus Podar 0801d002e4 Fix tests for edc422cd2e (#1457)
I just ran `composer test-regenerate`
2023-07-31 13:26:41 +02:00
Markus PodarandBarry vd. Heuvel 4dc20b028a Remove offical support for Lumen (#1425)
I'm proposing to drop official suport for Lumen for the following reasons:
- Lumen itself is dead, per [1]
  > **Note:** In the years since releasing Lumen, PHP has made a variety of wonderful performance improvements. For this reason, along with the availability of [Laravel Octane](https://laravel.com/docs/octane), we no longer recommend that you begin new projects with Lumen. Instead, we recommend always beginning new projects with [Laravel](https://laravel.com).

  Laravel Octact is just Laravel and no one using ide-helper with it
  needs anything special.
- For now, the change is mostly on the logistics side (readme, run tests,
  issues). In the past we had some special code but over time this was
  already removed.
  For now people still can use it and nothing will break out of the blue,
  but eventually it might

There are a only a few Lumen related issues open currently which would
be closed by this (#1105, #1069, #438).

[1] https://github.com/laravel/lumen/commit/69b26578d2f15595ea901278434b74df459c4329

Co-authored-by: Barry vd. Heuvel <[email protected]>
2023-02-20 13:23:52 +01:00
Markus Podar 97fd0e0a2d Update changelog after new release 2.13.0 (#1418) 2023-02-04 22:04:42 +01:00
Markus Podar 5d9925bab8 gha: fix workflow by allowing the composer-normalize plugin (#1412)
* gha: fix workflow by allowing the composer-normalize plugin

We don't need to enable it in the project itself, but at least in this
workflow which explicitly uses it.

See https://github.com/barryvdh/laravel-ide-helper/actions/runs/3980013548/jobs/6822812621#step:4:34
```
Error: ergebnis/composer-normalize (installed globally) contains a Composer plugin which is blocked by your allow-plugins config. You may add it to the list if you consider it safe.
You can run "composer global config --no-plugins allow-plugins.ergebnis/composer-normalize [true|false]" to enable it (true) or disable it explicitly and suppress this exception (false)
```

* gha: also run this workflow when it is changed itself
2023-01-24 17:32:39 +01:00
Markus Podar e8ecb3da88 Merge pull request #1367 from krsriq/patch-1 2022-08-21 11:42:25 +02:00
Markus Podar a567f73140 readme: explicitly state supported version (#1348)
Based on the discussion in https://github.com/barryvdh/laravel-ide-helper/issues/1347
2022-05-21 22:40:30 +02:00
Markus Podar 6a461a7c47 Fix integration tests by fixing a PHP 8.1+ deprecation warnings in ReflectionClass (#1351)
* gha: get more insights when/if logs exist

* Better handle cases when we can receive a concrete instance

The problem with `null` being passed to `ReflectionClass` was always
there but in PHP 8.1+ it triggers a deprecation warnings.

Since having `null` in `$concrete` doesn't make sense to reflect
anything anyway, we just throw a custom exception (which gets caught a
couple lines below) and just carry on.

When using `-v` this can be seen, example:
```
$ ./artisan ide-helper:meta -v
Cannot make 'Faker\Generator': Class 'Faker\Provider\en_US\Barcode' not found.
Cannot make 'Illuminate\Contracts\Auth\Authenticatable': Class  does not exist
Cannot make 'cache.psr6': Class 'Symfony\Component\Cache\Adapter\Psr16Adapter' not found.
Cannot make 'csp-nonce': Class 'Wza3Mf4CXIvCkcp9K3boMUGJoK6S9maO' not found.
Cannot make 'env': Class 'local' not found.
Cannot make 'filesystem.cloud': Disk [s3] does not have a configured driver.
Cannot make 'redis.connection': Redis connection [default] not configured.
A new meta file was written to .phpstorm.meta.php
```

* gha: make sure to run meta with -v to see all output

Helps when debugging things

* Add CHANGELOG.md entry
2022-05-21 22:38:28 +02:00
Markus Podar 999167d4c2 Prepare 2.12.1 patch release (#1307)
### Fixed
- Properly handle `Castable`s without return type. [#1306 / binotaliu](https://github.com/barryvdh/laravel-ide-helper/pull/1306)
2022-01-24 22:36:43 +01:00
Markus Podar 771770e56c Merge pull request #1304 from mfn/mfn-release
Prepare 2.12 release
2022-01-23 17:50:53 +01:00
Markus Podar 7052b4f708 Prepare 2.12 release
### Added
- Add support for custom casts that using `Castable` [#1287 / binotaliu](https://github.com/barryvdh/laravel-ide-helper/pull/1287)
- Added Laravel 9 support [#1297 / rcerljenko](https://github.com/barryvdh/laravel-ide-helper/pull/1297)
2022-01-23 17:38:31 +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
Markus Podar f2a7f9d84f Improve performance for supporting Laravel 8.77+ cast attributes (#1292)
#1289 calls `getReturnType` for every method on every model, which in
turn calls `getReturnTypeFromDocBlock` which has this code:
```php
$phpDocContext = (new ContextFactory())->createFromReflector($reflection);
```
Extracting the docblock is super slow, always has been. Now that we do
this for every method, this adds up a lot.

Performance on a private commercial project _before_ #1289 was introduced:
```
$ time ./artisan ide-helper:models --write --reset >/dev/null

real	0m2.857s
user	0m1.835s
sys	0m0.129s
```
After #1289 :
```
$ time ./artisan ide-helper:models --write --reset >/dev/null

real	0m54.147s
user	0m47.132s
sys	0m1.047s
```

However, in this case we **do not need** the phpdoc fallback (which is
legitimate and by design for many other cases), because also the Laravel
implementation only works by inspecting the _actual type_, see
https://github.com/laravel/framework/blob/e0c2620b57be6416820ea7ca8e46fd2f71d2fe35/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php#L570-L575
```php
$returnType = (new ReflectionMethod($this, $method))->getReturnType();

return static::$attributeMutatorCache[get_class($this)][$key] = $returnType &&
            $returnType instanceof ReflectionNamedType &&
            $returnType->getName() === Attribute::class &&
            is_callable($this->{$method}()->get);
```

This side-stepping the phpdoc parsing a) still works correctly and b)
brings us back to the previous performance characteristics:
```
time ./artisan ide-helper:models --write --reset >/dev/null

real	0m2.987s
user	0m1.915s
sys	0m0.120s
```
2022-01-03 21:47:54 +01:00
Markus Podar df670747c3 composer.json: remove --prefer-lowest (#1217)
IMHO it's impractical to expect this package to have to work with the
"first release of Laravel for any major release" even when there are
already sever more releases: no one is/should stick to that version.

This is a re-submit of https://github.com/barryvdh/laravel-ide-helper/pull/1076

See also:
- https://github.com/barryvdh/laravel-ide-helper/pull/1216#issuecomment-831029022
- https://github.com/barryvdh/laravel-ide-helper/pull/1185#issuecomment-831029353
2021-06-20 10:11:57 +02:00
Markus Podar dc5282e9a4 Merge pull request #1211 from madalinignisca/patch-1
Fix link to DBAL types
2021-04-13 20:37:23 +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
Markus Podar c1ddd30532 Merge pull request #1198 from jenga201/master
Allowing Methods to be set or unset in ModelHooks
2021-04-03 20:55:37 +02:00
Markus Podar dcbe6c953f chore: update changelog 2021-04-03 00:17:10 +02:00
Markus Podar 867a6fd9b4 Merge branch 'master' into jenga201_master 2021-04-03 00:15:42 +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
Markus Podar 843067b907 Merge pull request #1196 from ahmed-aliraqi/master
Fix ide-helper:models exception if model doesn't have factory
2021-04-01 20:32:08 +02:00
Markus Podar b8d5fc3663 Merge pull request #1193 from netpok/skip_generate_in_phpunit
Skip post_migrate when running tests
2021-03-23 17:47:25 +01:00
Markus Podar 0cae143470 Merge pull request #1192 from netpok/add_missing_changelog_entry
Add missing changelog entry for #1184
2021-03-22 20:15:17 +01:00
Markus Podar d58731cd9b Merge pull request #1178 from barryvdh/mp-release
chore: adapt for release of 2.9.1
2021-03-15 22:09:25 +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
Markus Podar 6c4dcd9049 Merge pull request #1164 from wilsenhc/readme-fix
Fix typo in README
2021-02-27 22:25:34 +01:00
Markus Podar b21324b20e Merge pull request #1156 from ZaidBarghouthi/fix-zb-extra-quote
Remove extra single quote
2021-02-19 07:23:25 +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
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
Markus Podarandlaravel-ide-helper a83df51ad4 tests: fix assertion (#1139)
* tests: fix assertion

* composer fix-style

Co-authored-by: laravel-ide-helper <[email protected]>
2021-01-11 09:14:12 +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
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
Markus Podar c4d1f780b0 composer.json: remove -dev from composer/composer dependency (#1109)
Stable 2 has been released some time ago
2020-12-04 07:13:26 +01:00
Markus Podarandlaravel-ide-helper ca0cf7355a [GHA] Misc improvements (#1101)
* gha: be more specific which OS to use

Avoids "surprises" when Github changes the underlying version, like they
currently announce with a warning:
> Ubuntu-latest workflows will use Ubuntu-20.04 soon. For more details, see https://github.com/actions/virtual-environments/issues/1816

Note: basically right now "latest" is actually 18.04 and not 20.04

* composer fix-style

* gha: require league/flysystem:^1 for lumen

2.* doesn't work out of the box

* gha: explicit version of composer isn't necessary anymore

v2 is already the default

* Be explicit to require the pdo SQLite extension for tests

Co-authored-by: laravel-ide-helper <[email protected]>
2020-11-30 15:13:01 +01: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 5db6029f2c Give feedback when a relation can't be resolved (#1052)
Improves https://github.com/barryvdh/laravel-ide-helper/pull/1017 slightly
2020-09-10 21:58:16 +02:00
Markus Podar 2a3c7fb087 Update CHANGELOG.md (#1046) 2020-09-09 09:13:22 +02:00
Markus Podar 594534ec5a [PSALM] Update baseline (#1044)
* composer: add script to set psalm baseline

* composer psalm-set-baseline
2020-09-08 21:52:35 +02:00
Markus Podar 4aa2e6a576 Update CHANGELOG.md (#1040) 2020-09-07 19:03:31 +02:00
Markus Podar 9baf93a502 Add github issue/PR templates (#1041) 2020-09-07 19:02:38 +02:00
Markus PodarandBarry vd. Heuvel affa55122f [TESTS] Running in CI should not create but rather fail on missing snapshots (#1039)
* tests: running in CI should not create but rather fail on missing snapshots

Otherwise they get created on the CI infrastructure but that's it, the
build won't fail although it was forgotten to add the snapshot.

* Bump minimum phpunit version which correctly accepts the `-d` parameter

The `prefer-lowest` version we get with L6 is 8.0.0 which throws this error:
```
PHP Fatal error:  Uncaught TypeError: ini_set() expects parameter 2 to be string, bool given in /home/runner/work/laravel-ide-helper/laravel-ide-helper/vendor/phpunit/phpunit/src/TextUI/Command.php:379
```

* Update composer.json

Co-authored-by: Barry vd. Heuvel <[email protected]>
2020-09-07 09:36:37 +02:00
Markus Podar d978986523 Remove GrumPHP (#1036)
* composer remove --dev phpro/grumphp

* Remove remains of grumphp
2020-09-04 19:05:00 +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
Markus Podar 007d3adb68 Run composer fix-style and vendor/bin/phpunit -d --update-snapshots to solve failed build (#1032) 2020-09-01 19:50:05 +02:00
Markus PodarandBarry vd. Heuvel 764bc02b84 [CODESTYLE] Replace phpcs with php-cs-fixer (#1030)
* composer require --dev friendsofphp/php-cs-fixer:^2

* php-cs-fixer: ignore cache and custom local config file

* php-cs-fixer: initial config

* php-cs-fixer: replace commands in composer

* php-cs-fixer: add PSR12 "as good as it currently gets"

* php-cs-fixer: apply PSR12 to codebase

* tests: add workaround to keep unused imports for snapshot testing

* php-cs-fixer: apply no_unused_imports

* php-cs-fixer: apply array_syntax short

* php-cs-fixer: apply single_quote

* php-cs-fixer: switch ordered_imports sort_algorithm to alpha

Let's be opinionated here for consistency

* php-cs-fixer: split between non-tests and tests and share config

* php-cs-fixer: apply declare_strict_types for tests

* php-cs-fixer: apply fully_qualified_strict_types

* php-cs-fixer: apply space_after_semicolon

* php-cs-fixer: apply trailing_comma_in_multiline_array

* php-cs-fixer: apply trim_array_spaces

* php-cs-fixer: apply unary_operator_spaces

* php-cs-fixer: apply whitespace_after_comma_in_array

* php-cs-fixer: apply native_function_invocation

* php-cs-fixer: apply concat_space

* grumphp: reflect we're using phpcsfixer now

* composer remove --dev squizlabs/php_codesniffer

* gha: simplify fix-style approach

Not really necessary to remove packages and then manually prevent
unrelated commits creeping in

Co-authored-by: Barry vd. Heuvel <[email protected]>
2020-09-01 11:32:31 +02:00
Markus Podar 4a6d127440 Improve gitignore a bit (#1029)
- build isn't used AFAIK?
- add `/` prefix were we know they're only expected to be in the root anyway
  except `.phpunit.result.cache` which may appear anywhere it's run from
2020-08-31 20:33:07 +02:00
Markus Podar 1ca875fbca Make createLocalViewFactory compatible with Laravel 8 (#1026)
* Make createLocalViewFactory compatible with Laravel 8

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

* tests: move up mockFilesystem so it get be re-used in other tests

Note: removed `$this->mockOutput = '';` as it was a no-op, that property
doesn't exist (it was probably a typo, but I guess we don't need it
anyway)

* tests: show basic features for ide-helper:meta working
2020-08-31 06:20:02 +02:00
Markus Podar 462989abd5 Fix type for new meta command 🤷‍♀️ (#997) 2020-08-30 21:33:19 +02:00
Markus Podar bd5b6ecee7 Remove unused use vars (#1027) 2020-08-30 21:32:47 +02:00
Markus Podar 3b66fea925 tests: no need for < 6 check, as we don't test < L6 anymore (#1025) 2020-08-30 21:32:15 +02:00
Markus Podar 707ec990e7 tests: remove L5.5 workaround (#1023) 2020-08-29 08:12:11 +02:00
Markus Podar ac6fbffac3 tests: ensure output mocking is disabled so we can actually catch the output (#1018)
Discovered via https://github.com/barryvdh/laravel-ide-helper/pull/1017#issuecomment-679318764

This only happens if you run an artisan command _before_ `runCommand`,
but since every of these tests performs migrations, using artisan,
the mocked output instance is left behind and also affected us.

The call added in `runCommand` explicitly unregisters
`\Illuminate\Console\OutputStyle` and thus also throwing away possibly
mocked versions.
2020-08-25 06:29:44 +02:00
Markus Podar 1ad23fd14c gha: use separate workflow file only on push for fixing the code style (#1013) 2020-08-21 06:49:24 +02:00
Markus Podar 444325205e getDoctrineSchemaManager doesn't take an argument (#1011)
AFAIK never had.

See https://github.com/laravel/framework/blob/c1ec18723e763120aa4e816072beca396d298db1/src/Illuminate/Database/Connection.php#L892
2020-08-20 21:58:36 +02:00
Markus Podar c760c9aa0c readme: be clear that models require FQN (#1012)
I've tested this and yes, it *always* requires a FQN.

Therefore I removed the extra note regarding namespace/wrapping because
even by default Laravel has the `App\` namesapce, which requires this.

Fixes https://github.com/barryvdh/laravel-ide-helper/issues/995
2020-08-20 21:57:11 +02:00
Markus Podar ba95d18ef5 [PHPCS] Extend to check/fix all source code and turn GHA into auto-commit fixer (#1003)
* phpcs: enable also for config, resources and tests

* composer fix-style

* vendor/bin/phpunit -d --update-snapshots

* gha: instead of checking the style, fix and auto-commit it 💪
2020-08-10 10:22:48 +02:00
Markus Podar ead6d4f89b Remove timestamps in generated files (#1000)
In https://github.com/barryvdh/laravel-ide-helper/pull/990#issuecomment-664590457 it was agreed upon to just remove them.
2020-07-27 21:42:55 +02:00
Markus Podar 1b5881c1e2 Add more methods able to resolve container instances (#996)
Some years ago the Laravel container was made PSR compliant and this
attributes to the fact that `->get()` is a valid resolve call too.
2020-07-21 07:53:35 +02:00
Markus Podar 4ffda148ce composer.json: bump branch-alias as 2.7 has already been released (#991) 2020-07-16 22:02:19 +02:00
Markus Podar 6cb0201476 Remove unnecessary version checks due to unsupported old Laravel/Lumen versions (#983)
- support for < L5.5 was dropped, so no need to check if it's >= Laravel 5.2
- for the same reason, the Lumen 5.0/5.1 check isn't necessary because only supporting Laravel 5.5 means we only support the Laravel 5.5 _components_ which means the minimum supported Lumen version is also 5.5 (per https://lumen.laravel.com/docs/master/releases#5.5.0 )
2020-06-28 22:14:44 +02:00
Markus Podar f3d841c0a3 Sort models found in file system (#982)
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
2020-06-28 11:21:36 +02:00
Markus Podar 9562bf59d9 Improve readme in certain areas (#980)
* readme: sublime command has been removed

Was removed in https://github.com/barryvdh/laravel-ide-helper/pull/976
as it was already deprecated for 7 years.

* readme: old link only redirects, use the destination link directly

* readme: mention that the default _ide_helper.php name can be changed

* readme: document `meta_filename` and hint it can be written into a special subdirectory

* readme: remove hint about \Eloquent or `@mixin`, as the latter is automatically added nowadays

* readme: update how the current phpdoc looks like

* readme: document `write_model_magic_where`

* readme: document `write_model_relation_count_properties`

* readme: document `custom_db_types`

* readme: clarify installation regarding auto-discovery vs. manual

* readme: mention to avoid caching the config in dev

Inspired by https://github.com/barryvdh/laravel-ide-helper/issues/832
2020-06-28 08:57:22 +02:00
Markus Podar e2547b8596 Removed old/outdated gists from readme (#977) 2020-06-27 17:56:54 +02:00
Markus Podar eaf4a00eae composer: reduce constraints for testbench (#975)
We only support L5.5 which is satisfied by testbench 3.5 already
2020-06-26 07:08:14 +02:00
Markus Podar e1940c25bc Remove deprecated sublime option (#976)
It has been marked as deprecated for 7 years (!) and the option isn't
used in the current code, i.e it does nothing.
2020-06-26 07:05:20 +02:00
Markus Podar 0531a58d24 tests: convert recently created tests to snapshots (#973)
They were created slightly before the snapshot PR was merged.
2020-06-24 15:29:19 +02:00
Markus Podar 6ec4f7baf9 gha: drop non-supported Laravel versions and simplify matrix (#970)
- also drop dedicated testbench version, composer can figure it out itself

https://laravel.com/docs/7.x/releases#support-policy

Only 5.5 receives security fixes until 2020-08-30,
everything else < 6 isn't supported anymore.
Therefore I dropped all versions not officially
supported.

I also find the change in the matrix more readable without having to
mentally parse a set of a lot "includes",
I think this clarifies the intent better.

This also results in more jobs are more (correctly allowed) variations are now covered.
2020-06-23 17:39:14 +02:00
Markus Podar 3197aab841 gha: add timeouts (#967) 2020-06-23 08:25:12 +02:00
Markus Podar bbf329b995 readme: add gha badge for tests (#966) 2020-06-23 08:13:16 +02:00
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
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
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
Markus Podar b72689755b Infer return type from reflection if no phpdoc given 2020-04-01 22:44:26 +02: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
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