Skip to content

Commit

Permalink
Suppress/fix issues raised by removing ignoreInternalFunction(False|N…
Browse files Browse the repository at this point in the history
…ull)Return
  • Loading branch information
robchett committed Oct 6, 2023
1 parent 76a782c commit eca0969
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
33 changes: 33 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,39 @@
<pluginClass class="Psalm\MockeryPlugin\Plugin"/>
</plugins>

<ignoredInternalFunctionFalseReturn>
<referencedFunction name="getcwd"/>
<referencedFunction name="ob_get_clean"/>
<referencedFunction name="glob"/>
<referencedFunction name="filemtime"/>
<referencedFunction name="opendir"/>
<referencedFunction name="scandir"/>
<referencedFunction name="readdir"/>
<referencedFunction name="tempnam"/>
<referencedFunction name="phpversion"/>
<referencedFunction name="file_get_contents"/>
<referencedFunction name="reset"/>
<referencedFunction name="end"/>
<referencedFunction name="fwrite"/>
<referencedFunction name="fread"/>
<referencedFunction name="realpath"/>
<referencedFunction name="readlink"/>
<referencedFunction name="json_encode"/>
<referencedFunction name="curl_init"/>
<referencedFunction name="base64_decode"/>
<referencedFunction name="igbinary_serialize"/>
<referencedFunction name="strtotime"/>
<referencedFunction name="preg_split"/>
<referencedFunction name="ini_get"/>
<referencedFunction name="getopt"/>
</ignoredInternalFunctionFalseReturn>

<ignoredInternalFunctionNullReturn>
<referencedFunction name="preg_replace"/>
<referencedFunction name="array_shift"/>
<referencedFunction name="key"/>
</ignoredInternalFunctionNullReturn>

<issueHandlers>
<Trace errorLevel="error"/>
<PossiblyNullOperand errorLevel="suppress"/>
Expand Down
4 changes: 3 additions & 1 deletion src/Psalm/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1018,7 +1018,9 @@ private static function processConfigDeprecations(
);
if ($deprecated_elements_xml->length) {
$deprecated_element_xml = $deprecated_elements_xml->item(0);
self::processDeprecatedElement($deprecated_element_xml, $file_contents, $config, $config_path);
if ($deprecated_element_xml) {
self::processDeprecatedElement($deprecated_element_xml, $file_contents, $config, $config_path);
}
}
}
}
Expand Down

0 comments on commit eca0969

Please sign in to comment.