Skip to content

Commit f6b899c

Browse files
committed
Exclude the file_get_contents rule from PHPStan
1 parent 321109e commit f6b899c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.phpcs.xml.dist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
<!-- Refactoring of this scale is not in scope yet.-->
2525
<exclude name="WordPress.Files.FileName" />
2626
<!-- Exclude the entire filename rule -->
27+
<exclude name="WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents" />
28+
<!-- file_get_contents is safe for reading local plugin files bundled with the plugin. -->
2729
</rule>
2830

2931
<rule ref="WordPress.Security.EscapeOutput">

includes/class-scf-json-schema-validator.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,6 @@ public function load_schema( $schema_name ) {
137137
return null;
138138
}
139139

140-
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Local plugin file, safe to read directly.
141140
$schema_content = file_get_contents( $schema_file );
142141
if ( false === $schema_content ) {
143142
return null;
@@ -271,7 +270,6 @@ public function validate_file( $file_path, $schema_name ) {
271270
return false;
272271
}
273272

274-
// phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Local plugin file, safe to read directly.
275273
$json_content = file_get_contents( $file_path );
276274

277275
if ( false === $json_content ) {

0 commit comments

Comments
 (0)