Loading core/.phpstan-baseline.php +32 −1640 File changed.Preview size limit exceeded, changes collapsed. Show changes core/modules/announcements_feed/tests/src/Unit/AnnounceFetcherUnitTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public function setUp():void { * @legacy-covers \Drupal\announcements_feed\AnnounceFetcher::validateUrl */ #[DataProvider('urlProvider')] public function testValidateUrl($url, $isValid): void { public function testValidateUrl(string $url, bool $isValid): void { $this->assertEquals($isValid, $this->fetcher->validateUrl($url)); } Loading core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -214,7 +214,7 @@ public function testUnauthorizedErrorMessage(): void { public function testCacheabilityOf401Response(): void { $url = Url::fromRoute('router_test.11'); $assert_response_cacheability = function ($expected_page_cache_header_value, $expected_dynamic_page_cache_header_sub_request_value) use ($url) { $assert_response_cacheability = function (string|int|float|bool|null $expected_page_cache_header_value, $expected_dynamic_page_cache_header_sub_request_value) use ($url): void { $this->drupalGet($url); $this->assertSession()->statusCodeEquals(401); $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', $expected_page_cache_header_value); Loading core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php +5 −5 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ class BigPipeResponseAttachmentsProcessorTest extends UnitTestCase { * @legacy-covers ::processAttachments */ #[DataProvider('nonHtmlResponseProvider')] public function testNonHtmlResponse($response_class): void { public function testNonHtmlResponse(string $response_class): void { $big_pipe_response_attachments_processor = $this->createBigPipeResponseAttachmentsProcessor($this->prophesize(AttachmentsResponseProcessorInterface::class)); $non_html_response = new $response_class(); Loading @@ -51,7 +51,7 @@ public function testNonHtmlResponse($response_class): void { /** * Provides data to testNonHtmlResponse(). */ public static function nonHtmlResponseProvider() { public static function nonHtmlResponseProvider(): array { return [ 'AjaxResponse, which implements AttachmentsInterface' => [AjaxResponse::class], 'A dummy that implements AttachmentsInterface' => [get_class((new Prophet())->prophesize(AttachmentsInterface::class)->reveal())], Loading @@ -72,7 +72,7 @@ public function testHtmlResponse(array $attachments): void { // service (that is this mock) never receives BigPipe placeholder // attachments, because it doesn't know (nor should it) how to handle them. $html_response_attachments_processor = $this->prophesize(AttachmentsResponseProcessorInterface::class); $html_response_attachments_processor->processAttachments(Argument::that(function ($response) { $html_response_attachments_processor->processAttachments(Argument::that(function ($response): bool { return $response instanceof HtmlResponse && empty(array_intersect(['big_pipe_placeholders', 'big_pipe_nojs_placeholders'], array_keys($response->getAttachments()))); })) Loading Loading @@ -102,7 +102,7 @@ public function testHtmlResponse(array $attachments): void { /** * Provides data to testHtmlResponse(). */ public static function attachmentsProvider() { public static function attachmentsProvider(): array { $typical_cases = [ 'no attachments' => [[]], 'libraries' => [['library' => ['core/drupal']]], Loading Loading @@ -154,7 +154,7 @@ public static function attachmentsProvider() { * @return \Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor * The BigPipeResponseAttachmentsProcessor to test. */ protected function createBigPipeResponseAttachmentsProcessor(ObjectProphecy $decorated_html_response_attachments_processor) { protected function createBigPipeResponseAttachmentsProcessor(ObjectProphecy $decorated_html_response_attachments_processor): BigPipeResponseAttachmentsProcessor { return new BigPipeResponseAttachmentsProcessor( $decorated_html_response_attachments_processor->reveal(), $this->prophesize(AssetResolverInterface::class)->reveal(), Loading core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ public function testLongPlaceholderFiberSuspendingLoop(): void { // Capture the result to avoid PHPUnit complaining. ob_start(); $fiber = new \Fiber(function () use ($bigpipe, $response) { $fiber = new \Fiber(function () use ($bigpipe, $response): void { $bigpipe->sendContent($response); }); $fiber->start(); Loading Loading @@ -143,7 +143,7 @@ public static function turtle(): array { /** * {@inheritdoc} */ public static function trustedCallbacks() { public static function trustedCallbacks(): array { return ['turtle']; } Loading Loading
core/.phpstan-baseline.php +32 −1640 File changed.Preview size limit exceeded, changes collapsed. Show changes
core/modules/announcements_feed/tests/src/Unit/AnnounceFetcherUnitTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ public function setUp():void { * @legacy-covers \Drupal\announcements_feed\AnnounceFetcher::validateUrl */ #[DataProvider('urlProvider')] public function testValidateUrl($url, $isValid): void { public function testValidateUrl(string $url, bool $isValid): void { $this->assertEquals($isValid, $this->fetcher->validateUrl($url)); } Loading
core/modules/basic_auth/tests/src/Functional/BasicAuthTest.php +1 −1 Original line number Diff line number Diff line Loading @@ -214,7 +214,7 @@ public function testUnauthorizedErrorMessage(): void { public function testCacheabilityOf401Response(): void { $url = Url::fromRoute('router_test.11'); $assert_response_cacheability = function ($expected_page_cache_header_value, $expected_dynamic_page_cache_header_sub_request_value) use ($url) { $assert_response_cacheability = function (string|int|float|bool|null $expected_page_cache_header_value, $expected_dynamic_page_cache_header_sub_request_value) use ($url): void { $this->drupalGet($url); $this->assertSession()->statusCodeEquals(401); $this->assertSession()->responseHeaderEquals('X-Drupal-Cache', $expected_page_cache_header_value); Loading
core/modules/big_pipe/tests/src/Unit/Render/BigPipeResponseAttachmentsProcessorTest.php +5 −5 Original line number Diff line number Diff line Loading @@ -40,7 +40,7 @@ class BigPipeResponseAttachmentsProcessorTest extends UnitTestCase { * @legacy-covers ::processAttachments */ #[DataProvider('nonHtmlResponseProvider')] public function testNonHtmlResponse($response_class): void { public function testNonHtmlResponse(string $response_class): void { $big_pipe_response_attachments_processor = $this->createBigPipeResponseAttachmentsProcessor($this->prophesize(AttachmentsResponseProcessorInterface::class)); $non_html_response = new $response_class(); Loading @@ -51,7 +51,7 @@ public function testNonHtmlResponse($response_class): void { /** * Provides data to testNonHtmlResponse(). */ public static function nonHtmlResponseProvider() { public static function nonHtmlResponseProvider(): array { return [ 'AjaxResponse, which implements AttachmentsInterface' => [AjaxResponse::class], 'A dummy that implements AttachmentsInterface' => [get_class((new Prophet())->prophesize(AttachmentsInterface::class)->reveal())], Loading @@ -72,7 +72,7 @@ public function testHtmlResponse(array $attachments): void { // service (that is this mock) never receives BigPipe placeholder // attachments, because it doesn't know (nor should it) how to handle them. $html_response_attachments_processor = $this->prophesize(AttachmentsResponseProcessorInterface::class); $html_response_attachments_processor->processAttachments(Argument::that(function ($response) { $html_response_attachments_processor->processAttachments(Argument::that(function ($response): bool { return $response instanceof HtmlResponse && empty(array_intersect(['big_pipe_placeholders', 'big_pipe_nojs_placeholders'], array_keys($response->getAttachments()))); })) Loading Loading @@ -102,7 +102,7 @@ public function testHtmlResponse(array $attachments): void { /** * Provides data to testHtmlResponse(). */ public static function attachmentsProvider() { public static function attachmentsProvider(): array { $typical_cases = [ 'no attachments' => [[]], 'libraries' => [['library' => ['core/drupal']]], Loading Loading @@ -154,7 +154,7 @@ public static function attachmentsProvider() { * @return \Drupal\big_pipe\Render\BigPipeResponseAttachmentsProcessor * The BigPipeResponseAttachmentsProcessor to test. */ protected function createBigPipeResponseAttachmentsProcessor(ObjectProphecy $decorated_html_response_attachments_processor) { protected function createBigPipeResponseAttachmentsProcessor(ObjectProphecy $decorated_html_response_attachments_processor): BigPipeResponseAttachmentsProcessor { return new BigPipeResponseAttachmentsProcessor( $decorated_html_response_attachments_processor->reveal(), $this->prophesize(AssetResolverInterface::class)->reveal(), Loading
core/modules/big_pipe/tests/src/Unit/Render/FiberPlaceholderTest.php +2 −2 Original line number Diff line number Diff line Loading @@ -105,7 +105,7 @@ public function testLongPlaceholderFiberSuspendingLoop(): void { // Capture the result to avoid PHPUnit complaining. ob_start(); $fiber = new \Fiber(function () use ($bigpipe, $response) { $fiber = new \Fiber(function () use ($bigpipe, $response): void { $bigpipe->sendContent($response); }); $fiber->start(); Loading Loading @@ -143,7 +143,7 @@ public static function turtle(): array { /** * {@inheritdoc} */ public static function trustedCallbacks() { public static function trustedCallbacks(): array { return ['turtle']; } Loading