File tree Expand file tree Collapse file tree 5 files changed +24
-12
lines changed Expand file tree Collapse file tree 5 files changed +24
-12
lines changed Original file line number Diff line number Diff line change 23
23
"scripts" : {
24
24
"phpcs" : " phpcs" ,
25
25
"phpcs-fix" : " phpcbf" ,
26
- "psalm" : " psalm.phar" ,
26
+ "psalm" : " psalm.phar --no-cache " ,
27
27
"test" : " phpunit" ,
28
28
"test-coverage" : " phpunit --coverage-clover ./coverage/phpunit/clover.xml"
29
29
},
Original file line number Diff line number Diff line change 11
11
xsi : schemaLocation =" https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
12
12
>
13
13
<projectFiles >
14
- <file name =" functions.php" />
15
- <file name =" remote-data-blocks.php" />
16
- <directory name =" inc/" />
14
+ <file name =" *.php" />
15
+ <directory name =" *" />
16
+ <ignoreFiles allowMissingFiles =" true" >
17
+ <directory name =" build/" />
18
+ <directory name =" example/" />
19
+ <directory name =" node_modules/" />
20
+ <directory name =" vendor/" />
21
+ </ignoreFiles >
17
22
</projectFiles >
18
23
<issueHandlers >
19
24
<PossiblyUnusedReturnValue errorLevel =" suppress" />
20
25
<PossiblyUnusedMethod errorLevel =" suppress" />
26
+ <UnusedClass >
27
+ <errorLevel type =" suppress" >
28
+ <directory name =" tests/" />
29
+ </errorLevel >
30
+ </UnusedClass >
21
31
</issueHandlers >
22
32
<stubs >
23
33
<file name =" vendor/php-stubs/wordpress-stubs/wordpress-stubs.php" />
24
34
<file name =" remote-data-blocks.php" />
25
35
</stubs >
26
- </psalm >
36
+ </psalm >
Original file line number Diff line number Diff line change @@ -358,8 +358,6 @@ public function testExecuteSuccessfulResponseWithObjectResponseData() {
358
358
$ response_body = $ this ->createMock ( \Psr \Http \Message \StreamInterface::class );
359
359
$ response = new Response ( 200 , [], $ response_body );
360
360
361
- $ response = new Response ( 200 , [], $ response_body );
362
-
363
361
$ this ->http_client ->method ( 'request ' )->willReturn ( $ response );
364
362
365
363
$ response_data = new \stdClass ();
Original file line number Diff line number Diff line change 6
6
use WP_Error ;
7
7
8
8
class MockValidator implements ValidatorInterface {
9
+ /**
10
+ * @psalm-suppress UnusedProperty
11
+ */
9
12
private array $ schema ;
13
+
10
14
private bool $ should_pass ;
11
15
12
16
/**
13
17
* Constructor.
14
- *
15
- * @param array $schema
18
+ *
19
+ * @param array $schema Validation schema.
16
20
* @param bool $should_pass Whether the validation should pass or fail.
17
21
*/
18
22
public function __construct ( array $ schema = [], bool $ should_pass = true ) {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ function esc_html( string $text ): string {
17
17
return $ text ;
18
18
}
19
19
20
- function register_block_pattern ( string $ name , array $ options ): void {
20
+ function register_block_pattern ( string $ _name , array $ _options ): void {
21
21
// Do nothing
22
22
}
23
23
@@ -99,7 +99,7 @@ function get_page_by_path( string $path ): string {
99
99
return $ path ?? 'fake WP_Post ' ;
100
100
}
101
101
102
- function add_rewrite_rule ( string $ regex , string $ target , string $ position ): void {
102
+ function add_rewrite_rule ( string $ _regex , string $ _target , string $ _position ): void {
103
103
// Do nothing
104
104
}
105
105
@@ -181,7 +181,7 @@ public function get_error_messages( $code = '' ) {
181
181
// Return all messages if no code specified.
182
182
if ( empty ( $ code ) ) {
183
183
$ all_messages = array ();
184
- foreach ( (array ) $ this ->errors as $ code => $ messages ) {
184
+ foreach ( (array ) $ this ->errors as $ _code => $ messages ) {
185
185
$ all_messages = array_merge ( $ all_messages , $ messages );
186
186
}
187
187
You can’t perform that action at this time.
0 commit comments