Skip to content

Commit 236f09c

Browse files
committed
hardening by avoiding casting
1 parent a22e56b commit 236f09c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Context/FeatureContext.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -943,7 +943,12 @@ protected static function bootstrap_feature_context(): void {
943943
return;
944944
}
945945

946-
$composer = json_decode( (string) file_get_contents( $project_composer ) );
946+
$composer_contents = file_get_contents( $project_composer );
947+
if ( false === $composer_contents ) {
948+
return;
949+
}
950+
951+
$composer = json_decode( $composer_contents );
947952
if ( empty( $composer->autoload->files ) ) {
948953
return;
949954
}

0 commit comments

Comments
 (0)