Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust for composer-require-checker check. #7632

Merged
merged 3 commits into from Feb 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion bin/composer-require-checker-config.json
Expand Up @@ -4,7 +4,8 @@
"static", "self", "parent",
"array", "string", "int", "float", "bool", "iterable", "callable", "void", "object",
"igbinary_serialize", "igbinary_unserialize", "PHP_PARSER_VERSION", "PSALM_VERSION", "runkit_object_id",
"sapi_windows_cp_is_utf8", "ReflectionUnionType"
"sapi_windows_cp_is_utf8", "ReflectionUnionType",
"Composer\\Autoload\\ClassLoader"
],
"php-core-extensions" : [
"Core",
Expand Down
5 changes: 2 additions & 3 deletions src/Psalm/Config.php
Expand Up @@ -7,7 +7,7 @@
use Composer\Semver\VersionParser;
use DOMAttr;
use DOMDocument;
use DomElement;
use DOMElement;
use InvalidArgumentException;
use JsonException;
use LogicException;
Expand Down Expand Up @@ -764,7 +764,6 @@ private static function validateXmlConfig(string $base_dir, string $file_content

$psalm_nodes = $dom_document->getElementsByTagName('psalm');

/** @var DomElement|null */
$psalm_node = $psalm_nodes->item(0);
sasezaki marked this conversation as resolved.
Show resolved Hide resolved

if (!$psalm_node) {
Expand Down Expand Up @@ -853,7 +852,7 @@ private static function processDeprecatedAttribute(
}

private static function processDeprecatedElement(
DomElement $deprecated_element_xml,
DOMElement $deprecated_element_xml,
string $file_contents,
self $config,
string $config_path
Expand Down
10 changes: 5 additions & 5 deletions src/Psalm/Internal/PluginManager/ConfigFile.php
Expand Up @@ -3,7 +3,7 @@
namespace Psalm\Internal\PluginManager;

use DOMDocument;
use DomElement;
use DOMElement;
use Psalm\Config;
use RuntimeException;

Expand Down Expand Up @@ -53,15 +53,15 @@ public function getConfig(): Config
public function removePlugin(string $plugin_class): void
{
$config_xml = $this->readXml();
/** @var DomElement */
/** @var DOMElement */
$psalm_root = $config_xml->getElementsByTagName('psalm')[0];
$plugins_elements = $psalm_root->getElementsByTagName('plugins');
if (!$plugins_elements->length) {
// no plugins, nothing to remove
return;
}

/** @var DomElement */
/** @var DOMElement */
$plugins_element = $plugins_elements->item(0);

$plugin_elements = $plugins_element->getElementsByTagName('pluginClass');
Expand All @@ -84,7 +84,7 @@ public function removePlugin(string $plugin_class): void
public function addPlugin(string $plugin_class): void
{
$config_xml = $this->readXml();
/** @var DomElement */
/** @var DOMElement */
$psalm_root = $config_xml->getElementsByTagName('psalm')->item(0);
$plugins_elements = $psalm_root->getElementsByTagName('plugins');
if (!$plugins_elements->length) {
Expand All @@ -93,7 +93,7 @@ public function addPlugin(string $plugin_class): void
$psalm_root->appendChild($plugins_element);
}
} else {
/** @var DomElement */
/** @var DOMElement */
$plugins_element = $plugins_elements->item(0);
}

Expand Down