Fix PHPStan errors for Email editor PHP package integration test folder

MAILPOET-6318
This commit is contained in:
Oluwaseun Olorunsola
2024-11-22 16:38:13 +01:00
committed by Jan Lysý
parent a4ad960492
commit 325c4c74f4
10 changed files with 35 additions and 13 deletions

View File

@@ -31,7 +31,7 @@ class Email_Editor_Test extends \MailPoetTest {
*/
public function _before() {
parent::_before();
$this->email_editor = $this->di_container->get( Email_Editor::class );
$this->email_editor = $this->di_container->get( Email_Editor::class ); // @phpstan-ignore-line
$this->post_register_callback = function ( $post_types ) {
$post_types[] = array(
'name' => 'custom_email_type',

View File

@@ -23,7 +23,7 @@ class Patterns_Test extends \MailPoetTest {
*/
public function _before() {
parent::_before();
$this->patterns = $this->di_container->get( Patterns::class );
$this->patterns = $this->di_container->get( Patterns::class ); // @phpstan-ignore-line
$this->cleanup_patterns();
}
@@ -33,7 +33,8 @@ class Patterns_Test extends \MailPoetTest {
public function testItRegistersPatternCategories() {
$this->patterns->initialize();
$categories = \WP_Block_Pattern_Categories_Registry::get_instance()->get_all_registered();
$category = array_pop( $categories );
/** @var array{name: string, label: string, description: string} $category */ // phpcs:ignore
$category = array_pop( $categories );
$this->assertEquals( 'email-contents', $category['name'] );
$this->assertEquals( 'Email Contents', $category['label'] );
$this->assertEquals( 'A collection of email content layouts.', $category['description'] );

View File

@@ -29,7 +29,7 @@ class Blocks_Registry_Test extends \MailPoetTest {
*/
public function _before() {
parent::_before();
$this->registry = $this->di_container->get( Blocks_Registry::class );
$this->registry = $this->di_container->get( Blocks_Registry::class ); // @phpstan-ignore-line
}
/**

View File

@@ -134,8 +134,8 @@ class Content_Renderer_Test extends \MailPoetTest {
*/
private function getStylesValueForTag( $html, $tag ): ?string {
$html = new \WP_HTML_Tag_Processor( $html );
if ( $html->next_tag( $tag ) ) {
return $html->get_attribute( 'style' );
if ( $html->next_tag( $tag ) ) { // @phpstan-ignore-line
return $html->get_attribute( 'style' ); // @phpstan-ignore-line
}
return null;
}

View File

@@ -211,7 +211,7 @@ class Renderer_Test extends \MailPoetTest {
private function getStylesValueForTag( string $html, array $query ): ?string {
$html = new \WP_HTML_Tag_Processor( $html );
if ( $html->next_tag( $query ) ) {
return $html->get_attribute( 'style' );
return $html->get_attribute( 'style' ); // @phpstan-ignore-line
}
return null;
}

View File

@@ -24,7 +24,7 @@ class Theme_Controller_Test extends \MailPoetTest {
*/
public function _before() {
parent::_before();
$this->theme_controller = $this->di_container->get( Theme_Controller::class );
$this->theme_controller = $this->di_container->get( Theme_Controller::class ); // @phpstan-ignore-line
}
/**