Skip to content

Commit edd08a8

Browse files
Laravel 9 (#4)
* Add support for Laravel 9 * Fix styling * Fix tests * Fix styling Co-authored-by: rubenvanassche <[email protected]>
1 parent 9a85e8f commit edd08a8

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

.github/workflows/run-tests.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ jobs:
1313
fail-fast: true
1414
matrix:
1515
os: [ubuntu-latest, windows-latest]
16-
php: [8.0]
17-
laravel: [8.*]
16+
php: [8.1, 8.0]
17+
laravel: [9.*, 8.*]
1818
stability: [prefer-lowest, prefer-stable]
1919
include:
2020
- laravel: 8.*
2121
testbench: ^6.6
22+
- laravel: 9.*
23+
testbench: 7.*
2224

2325
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}
2426

.php-cs-fixer.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"php":"8.1.0","version":"3.4.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":{"elements":["method","property"]},"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}},"single_trait_insert_per_statement":true},"hashes":{"src\/SearchQuery.php":904772392,"src\/Support\/Regex.php":1588407898,"src\/Concerns\/ForwardsCalls.php":1561246881,"src\/SearchHit.php":2068485165,"src\/SearchExecutor.php":3386966144,"src\/Suggestion.php":2090866737,"src\/Directives\/DateRangeKeyValuePatternDirective.php":2189551149,"src\/Directives\/FuzzyKeyValuePatternDirective.php":3299415763,"src\/Directives\/GroupDirective.php":968603032,"src\/Directives\/FuzzyValueBaseDirective.php":4213220924,"src\/Directives\/DateKeyValuePatternDirective.php":4082701461,"src\/Directives\/ColumnGroupDirective.php":1730858933,"src\/Directives\/BaseDirective.php":1837670501,"src\/Directives\/PatternDirective.php":1732368638,"src\/SearchResults.php":1400944556,"tests\/SearchQueryTest.php":3899440115,"tests\/TestCase.php":3201134510,"tests\/Support\/PayloadFactory.php":1983555671,"tests\/Fakes\/FakeElasticSearchClient.php":3633090768,"tests\/stubs\/Data\/ErrorOccurrenceHit.php":141751169,"tests\/stubs\/Data\/ErrorOccurrence.php":795272725,"tests\/stubs\/Data\/ErrorOccurrenceGrouping.php":855156310,"tests\/stubs\/FlareContextGroupDirective.php":3393435878,"tests\/stubs\/FlareGroupDirective.php":3194451501}}
1+
{"php":"8.1.1","version":"3.5.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":{"elements":["method","property"]},"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}},"single_trait_insert_per_statement":true},"hashes":{"src\/SearchQuery.php":904772392,"src\/Suggestion.php":2090866737,"src\/Support\/Regex.php":1588407898,"src\/SearchHit.php":2068485165,"src\/Concerns\/ForwardsCalls.php":1561246881,"src\/SearchExecutor.php":3386966144,"src\/SearchResults.php":1400944556,"src\/Directives\/DateKeyValuePatternDirective.php":4082701461,"src\/Directives\/FuzzyKeyValuePatternDirective.php":3299415763,"src\/Directives\/ColumnGroupDirective.php":1730858933,"src\/Directives\/BaseDirective.php":1837670501,"src\/Directives\/DateRangeKeyValuePatternDirective.php":2189551149,"src\/Directives\/GroupDirective.php":968603032,"src\/Directives\/FuzzyValueBaseDirective.php":4213220924,"src\/Directives\/PatternDirective.php":1732368638,"tests\/Support\/PayloadFactory.php":1983555671,"tests\/TestCase.php":3201134510,"tests\/stubs\/Data\/ErrorOccurrenceGrouping.php":855156310,"tests\/stubs\/Data\/ErrorOccurrenceHit.php":141751169,"tests\/stubs\/Data\/ErrorOccurrence.php":795272725,"tests\/stubs\/FlareGroupDirective.php":3194451501,"tests\/stubs\/FlareContextGroupDirective.php":3393435878,"tests\/SearchQueryTest.php":195164432,"tests\/Fakes\/FakeElasticSearchClient.php":3633090768}}

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"require": {
2727
"php": "^8.0",
2828
"elasticsearch/elasticsearch": "^7.12",
29-
"illuminate/collections": "^8.40",
29+
"illuminate/collections": "^8.40|^9.0",
3030
"spatie/elasticsearch-query-builder": "^1.0"
3131
},
3232
"require-dev": {

tests/SearchQueryTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use Spatie\ElasticsearchStringParser\Directives\PatternDirective;
1212
use Spatie\ElasticsearchStringParser\SearchHit;
1313
use Spatie\ElasticsearchStringParser\SearchQuery;
14+
use Spatie\ElasticsearchStringParser\Suggestion;
1415
use Spatie\ElasticsearchStringParser\Tests\Fakes\FakeElasticSearchClient;
1516
use Spatie\ElasticsearchStringParser\Tests\Support\PayloadFactory;
1617

@@ -183,11 +184,11 @@ public function it_will_append_suggestions()
183184
->patternDirectives((new FuzzyKeyValuePatternDirective('title', ['title']))->withSuggestions())
184185
->search('title:test');
185186

186-
$this->assertArrayHasKey('title', $results->suggestions);
187+
$this->assertArrayHasKey('title:test', $results->suggestions);
187188
$this->assertEquals([
188-
'Hello world',
189-
'A message from Rick',
190-
], $results->suggestions['title']);
189+
new Suggestion('Hello world'),
190+
new Suggestion('A message from Rick'),
191+
], $results->suggestions['title:test']);
191192
}
192193

193194
/** @test */

0 commit comments

Comments
 (0)