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

PHPCS: Implement StaticClosure rule #12908

Merged
merged 2 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
<rule
ref="SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue"
/>
<rule ref="SlevomatCodingStandard.Functions.StaticClosure" />
spacedmonkey marked this conversation as resolved.
Show resolved Hide resolved
<!-- Enforce no space between closing brace and colon of return typehint. -->
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHintSpacing">
<properties>
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/integration/tests/AMP/Sanitization.php
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ public function test_get_sanitizers_with_dev_mode(): void {
$validation_error_callback = [ $this->instance, 'validation_error_callback' ];
add_filter(
'web_stories_amp_dev_mode_element_xpaths',
fn( $xpaths ) => array_merge( $xpaths, $element_xpaths )
static fn( $xpaths ) => array_merge( $xpaths, $element_xpaths )
);

// Check that AMP_Dev_Mode_Sanitizer is not registered if not in dev mode.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function test_it_can_return_the_actual_service_it_represents(): void {
}

public function test_it_throws_when_instantiating_an_invalid_service(): void {
$callable = fn() => new stdClass();
$callable = static fn() => new stdClass();
$lazy_service = new LazilyInstantiatedService( $callable );

$this->expectException( InvalidService::class );
Expand Down