* Fix code that was causing the test to break and fix bug with not built in types
* Run cs fixer
* Remove fetching the doc block type and the putting it as a type hint as a php doc block is sufficient
* Revert doc block type hinting
* Enchance doc block type hinting
* Combine replacements
* Use the full builder class instead of the parsed one after the getClassName function and remove in array check
* Get the builder from the model itself instead of passing a string directly the function
* Use the full builder class to get the builder methods and reflection, but use the parsed builder class after setting its method in the doc
* Add test for fqn support on external eloquent builder
* Use the external builder if necessary when building the magic wheres
* Use the default eloquent builder if the user has disabled the external builder option
* Fix code that was causing the test to break and fix bug with not built in types
* Run cs fixer
* Remove fetching the doc block type and the putting it as a type hint as a php doc block is sufficient
* Revert doc block type hinting
* Enchance doc block type hinting
* Combine replacements
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.
* Add support for generating helpers for external eloquent builders
* Extract external builder methods generator to its own method and add an option to toggle this feature
* Check if we are using the default name of the eloquent builder
* Add tests with snapshots for external eloquent builder feature
* Refactor codegs
* Allow for type hinting
* Update test
* Run cs fix
* Update readme
* Use getName for parameter instead of relying on __toString()
* Do not use str_contains and use built in php method
* 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
* 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]>
* 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]>
* [LARAVEL 8] include_factory_builders does not work anymore (#1047)
* Change skip expression
Append comment about deprecated to config file
Append comment about deprecated to README file
* 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]>
* New --write-mixin option.
* Keep all tags from the existing docblock.
* Update argument description to be more descriptive
Co-authored-by: Markus Podar <[email protected]>
* Add the new --write-mixin option to the docs
* Add test for the new --write-mixin option
* Update README.md
* composer fix-style
* Adapt test after refactoring recently done
Co-authored-by: Markus Podar <[email protected]>
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_.
- 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
* 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
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.