Skip to content

Commit

Permalink
DOMElement instead of DomElement - https://php.net/DOMElement
Browse files Browse the repository at this point in the history
to avoid composer-require-check reports false-positive,
just did - find src/ -type f -exec sed -i -e 's/DomElement/DOMElement/g' {} \;
  • Loading branch information
sasezaki committed Feb 11, 2022
1 parent 11e60fa commit 116a142
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 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,7 @@ private static function validateXmlConfig(string $base_dir, string $file_content

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

/** @var DomElement|null */
/** @var DOMElement|null */
$psalm_node = $psalm_nodes->item(0);

if (!$psalm_node) {
Expand Down Expand Up @@ -853,7 +853,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

0 comments on commit 116a142

Please sign in to comment.