Skip to content

Add Tribe__Cache::has method - #2061

Draft
lucatume wants to merge 4 commits into
masterfrom
feat/tribe-cache-has
Draft

Add Tribe__Cache::has method#2061
lucatume wants to merge 4 commits into
masterfrom
feat/tribe-cache-has

Conversation

@lucatume

@lucatume lucatume commented Mar 15, 2024

Copy link
Copy Markdown
Contributor

🎫 Ticket

Innovation Day work, Cookbook

🗒️ Description

For back-compatibility purposes, I've not modified existing methods like offsetGet.
This add a $found flag, set by reference, to the get method similarly to the one set by the wp_cache_get function.
To just check on a value, I've added the has method.

✔️ Checklist

  • Changelog entry in the readme.txt file.
  • Code is covered by NEW wpunit or integration tests.
  • Code is covered by EXISTING wpunit or integration tests.
  • Are all the required tests passing?
  • Automated code review comments are addressed.
  • Have you added Artifacts?
  • Check the base branch for your PR.
  • Add your PR to the project board for the release.

For back-compatibility purposes, I've not modified existing methods like `offsetGet`.
This add a `$found` flag, set by reference, to the `get` method similarly to the one set by the `wp_cache_get` function.
To just check on a value, I've added the `has` method.
@lucatume lucatume self-assigned this Mar 15, 2024
Comment thread src/Tribe/Cache.php
* @return mixed
*/
public function get( $id, $expiration_trigger = '', $default = false, $expiration = 0, $args = [] ) {
public function get( $id, $expiration_trigger = '', $default = false, $expiration = 0, $args = [], ?bool &$found = false ) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
Universal.NamingConventions.NoReservedKeywordParameterNames.defaultFound
It is recommended not to use reserved keyword "default" as function parameter name. Found: $default

Comment thread tests/wpunit/Tribe/CacheTest.php Outdated

$cache->set( 'foo-bar', 'bar' );
$this->assertTrue( $cache->has( 'foo-bar' ) );
$this->assertEquals('bar', $cache->get( 'foo-bar','', false, 0, [], $found ) );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

Comment thread tests/wpunit/Tribe/CacheTest.php Outdated

$cache->set( 'foo-bar', 'bar' );
$this->assertTrue( $cache->has( 'foo-bar' ) );
$this->assertEquals('bar', $cache->get( 'foo-bar','', false, 0, [], $found ) );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
Generic.Functions.FunctionCallArgumentSpacing.NoSpaceAfterComma
No space found after comma in argument list

Comment thread tests/wpunit/Tribe/CacheTest.php Outdated

$cache->set( 'foo-bar-save-post', 'bar', 0, Triggers::TRIGGER_SAVE_POST );
$this->assertTrue( $cache->has( 'foo-bar-save-post', Triggers::TRIGGER_SAVE_POST ) );
$this->assertEquals('bar', $cache->get( 'foo-bar-save-post', Triggers::TRIGGER_SAVE_POST, false, 0, [], $found ) );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

Comment thread tests/wpunit/Tribe/CacheTest.php Outdated

$cache->set( 'foo-bar-updated-option', 'bar', 0, Triggers::TRIGGER_UPDATED_OPTION );
$this->assertTrue( $cache->has( 'foo-bar-updated-option', Triggers::TRIGGER_UPDATED_OPTION ) );
$this->assertEquals('bar', $cache->get( 'foo-bar-updated-option', Triggers::TRIGGER_UPDATED_OPTION, false, 0, [], $found ) );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

Comment thread tests/wpunit/Tribe/CacheTest.php Outdated

$cache->set( 'foo-bar-generate-rewrite-rules', 'bar', 0, Triggers::TRIGGER_GENERATE_REWRITE_RULES );
$this->assertTrue( $cache->has( 'foo-bar-generate-rewrite-rules', Triggers::TRIGGER_GENERATE_REWRITE_RULES ) );
$this->assertEquals('bar', $cache->get( 'foo-bar-generate-rewrite-rules', Triggers::TRIGGER_GENERATE_REWRITE_RULES, false, 0, [], $found ) );

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
PEAR.Functions.FunctionCallSignature.SpaceAfterOpenBracket
Expected 1 spaces after opening parenthesis; 0 found

@tec-bot tec-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit

phpcs

tests/unit/Tribe/Utils/ArrayTest.php|404 col 100| WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.
tests/unit/Tribe/Utils/ArrayTest.php|406 col 17| NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.
tests/unit/Tribe/Utils/ArrayTest.php|406 col 17| SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.
tests/unit/Tribe/Utils/ArrayTest.php|408 col 80| WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow
Expected 1 space between "'non-empty array, closure shape, all key pass, strict'" and double arrow; 13 found.
tests/unit/Tribe/Utils/ArrayTest.php|409 col 54| WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.
tests/unit/Tribe/Utils/ArrayTest.php|410 col 100| WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.
tests/unit/Tribe/Utils/ArrayTest.php|412 col 17| NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.
tests/unit/Tribe/Utils/ArrayTest.php|412 col 17| SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.
tests/unit/Tribe/Utils/ArrayTest.php|414 col 80| WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow
Expected 1 space between "'non-empty array, closure shape, all key pass, non-strict '" and double arrow; 8 found.
tests/unit/Tribe/Utils/ArrayTest.php|415 col 54| WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.
tests/unit/Tribe/Utils/ArrayTest.php|416 col 100| WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.
tests/unit/Tribe/Utils/ArrayTest.php|418 col 17| NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.
tests/unit/Tribe/Utils/ArrayTest.php|418 col 17| SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.
tests/unit/Tribe/Utils/ArrayTest.php|420 col 80| WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow
Expected 1 space between "'non-empty array, closure shape, some key pass, strict'" and double arrow; 12 found.
tests/unit/Tribe/Utils/ArrayTest.php|421 col 49| WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.
tests/unit/Tribe/Utils/ArrayTest.php|422 col 100| WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.
tests/unit/Tribe/Utils/ArrayTest.php|424 col 17| NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.
tests/unit/Tribe/Utils/ArrayTest.php|424 col 17| SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.
tests/unit/Tribe/Utils/ArrayTest.php|426 col 80| WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow
Expected 1 space between "'non-empty array, closure shape, some key pass, non-strict'" and double arrow; 8 found.
tests/unit/Tribe/Utils/ArrayTest.php|427 col 49| WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.
tests/unit/Tribe/Utils/ArrayTest.php|428 col 100| WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.
tests/unit/Tribe/Utils/ArrayTest.php|430 col 17| NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.
tests/unit/Tribe/Utils/ArrayTest.php|430 col 17| SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.

Comment thread src/Tribe/Utils/Array.php
* The callable must have the signature `fn( mixed $value ) :bool`.
*
* @return bool
*/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
Squiz.Commenting.FunctionCommentThrowTag.Missing
Missing @throws tag in function comment

Comment thread src/Tribe/Utils/Array.php Outdated
*
* @return bool
*/
public static function has_shape( $array, array $shape ): bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
Universal.NamingConventions.NoReservedKeywordParameterNames.arrayFound
It is recommended not to use reserved keyword "array" as function parameter name. Found: $array

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated

public function has_shape_data_provider(): array {
return [
'not an array' => [ 'foo', [], true, false ],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 29 space(s) between "'not an array'" and double arrow, but found 53.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
public function has_shape_data_provider(): array {
return [
'not an array' => [ 'foo', [], true, false ],
'empty array, empty shape' => [ [], [], true, true ],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 17 space(s) between "'empty array, empty shape'" and double arrow, but found 41.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
return [
'not an array' => [ 'foo', [], true, false ],
'empty array, empty shape' => [ [], [], true, true ],
'empty array, non-empty shape, strict' => [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.DoubleArrowNotAligned
Array double arrow not aligned correctly; expected 5 space(s) between "'empty array, non-empty shape, strict'" and double arrow, but found 29.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
true
],
'non-empty array, closure shape, all key fail failure, strict' => [
[ 'foo' => 23, 'bar' => 89 ],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
],
'non-empty array, closure shape, all key fail failure, strict' => [
[ 'foo' => 23, 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
[ 'foo' => 23, 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],
true,
false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
[ 'foo' => 23, 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],
true,
false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
false
],
'non-empty array, closure shape, all key fail failure, non-strict' => [
[ 'foo' => 23, 'bar' => 89 ],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.

@lucatume
lucatume force-pushed the feat/tribe-cache-has branch from 7032a98 to a9bc11e Compare March 15, 2024 16:36
Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
],
'non-empty array, closure shape, all key fail failure, non-strict' => [
[ 'foo' => 23, 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
[ 'foo' => 23, 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],
false,
false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
[ 'foo' => 23, 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],
false,
false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
false,
false
],
'non-empty array, closure shape, all key pass, strict' => [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow
Expected 1 space between "'non-empty array, closure shape, all key pass, strict'" and double arrow; 13 found.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
false
],
'non-empty array, closure shape, all key pass, strict' => [
[ 'foo' => 'hello', 'bar' => 'world' ],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
true,
false
],
'non-empty array, closure shape, some key pass, non-strict' => [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.MultipleStatementAlignment.LongIndexSpaceBeforeDoubleArrow
Expected 1 space between "'non-empty array, closure shape, some key pass, non-strict'" and double arrow; 8 found.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
false
],
'non-empty array, closure shape, some key pass, non-strict' => [
[ 'foo' => 'hello', 'bar' => 89 ],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
],
'non-empty array, closure shape, some key pass, non-strict' => [
[ 'foo' => 'hello', 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
WordPress.Arrays.ArrayDeclarationSpacing.AssociativeArrayFound
When a multi-item array uses associative keys, each value should start on a new line.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
[ 'foo' => 'hello', 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],
false,
true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
[ 'foo' => 'hello', 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],
false,
true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.

@lucatume
lucatume force-pushed the feat/tribe-cache-has branch from a9bc11e to fa40956 Compare March 15, 2024 16:56
Comment thread src/Tribe/Utils/Array.php
*
* @return bool Whether the array has the specified shape.
*/
public static function has_shape( $array, array $shape, bool $strict = false ): bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
Universal.NamingConventions.NoReservedKeywordParameterNames.arrayFound
It is recommended not to use reserved keyword "array" as function parameter name. Found: $array

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
[],
[ 'foo' => 'is_string' ],
false,
false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
[],
[ 'foo' => 'is_string' ],
false,
false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
[ 'foo' => 'hello', 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],
false,
false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine
There should be a comma after the last array item in a multi-line array.

Comment thread tests/unit/Tribe/Utils/ArrayTest.php Outdated
[ 'foo' => 'hello', 'bar' => 89 ],
[ 'foo' => fn( $foo ) => $foo === 'hello', 'bar' => fn( $bar ) => $bar === 'world' ],
false,
false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[phpcs] reported by reviewdog 🐶
SlevomatCodingStandard.Arrays.TrailingArrayComma.MissingTrailingComma
Multi-line arrays must have a trailing comma after the last element.

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.

2 participants