Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scout 9 Support #52

Open
wants to merge 32 commits into
base: master
Choose a base branch
from

Conversation

devNoiseConsulting
Copy link

Update the test Matrix.
Added Laravel 9 and Scout 9 packages.
Implemented new abstract methods needed for Scout 9.
Added tests for 2 of the 3 new methods.
The lazyMap method returns a lazyCollection but not completely implemeted yet.

Update the test Matrix.
Added Laravel 9 and Scout 9 packages.
Implemented new abstract methods needed for Scout 9.
Added tests for 2 of the 3 new methods.
The lazyMap method returns a lazyCollection but not completely implemeted yet.
Removing versions that are no longer supported.
Added in Laravel 10 packages.
Added the LazyCollection use statement.
Updated some returns in the DocBlock to reflect the actual return values.
Changing the composer.json to reflect that this package has been forked and to be published on packagist.org
Added Larastan to the package and analyzing the code.
Going with level 5 to start with.
Adding type information.
Casting some variable to match the return type.
Added a baseline for errors not fixing at this point. Mostly calls to methods that come from traits.
Left 2 errors that I want to get fixed.
Laravel Scout v10 is now out.
Installed tighten/duster and laravel/pint as dev dependencies.
Just using the lint option with Duster.
Added a pint.json file so Pint will follow the Duster formatting standard.
Formatting the code.
Refactoring code to remove the getDriverName call so that the "Call to an undefined method" error is fixed.

Checking if the connection is an instance of PostgessConnection.
Making larastan/phpstan happy by refactoring the code.
Fixes Issue 2.
Making larastan/phpstan happy by refactoring the code.
Fixes Issue 3.
larastan/phpstan getting picky about the return type on the map function.
Made a new collection variable that pushed the models in the result order.
Fixes Issue 2
While it made larastan/phpstan happy, the code did not work. Putting back the old code until a better solution is apparent.
Working through the errors as I increase the phpstan level up to 8.

Narrowing some Types to identify what is being put into collect().

searchConfig should return a string and not string|null. If the not defined then 'simple' will be the text search configuration.

'plainquery' is the defaultQueryMethod. Changed the default from 'plain' to 'plainquery'.
Testing broke with the new dev packages used to improve the code.
Removing the dev packages.
Updated the phpunit.xml.dist to match the new schema.
Making changes so test matches how the code works.
Changed code so that the test passes. Not sure that the map_filters_out_no_longer_existing_models is really a valid test.
Working on getting the code to pass Larastan level 9.
Mostly new code to get around the fact you can cast a mixed variable into the type you need.
Mostly making variables so that they can be typed to prevent phpstan errors.
Adding dev package requirements.
Some of the dev tools to help with code improvement do not support PHP 8.0.

Change removing unneeded packages for testing in GitHub Actions.
Finally got enough Larastan under my belt to see how to get rid of the error.

Fixed #3
Catching up with the latest Laravel releases.
Had Duster fix the PostgresEngine.php so it would be happy.
Working through the new Larastan errors. No real code changes, but new type hinting to remove the errors.
Any ignored errors appear to be related to the fact that the code assumes that the Model is using the Searchable trait.
Scout only goes up to 10.
Change type returned on performSearch to array|null. This is more to make the test happy than improve the code. Need to revise and make better tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant