Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into upstream-master7
Browse files Browse the repository at this point in the history
  • Loading branch information
orklah committed Feb 12, 2022
2 parents fac5557 + 6c2484d commit e6d491a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 2 additions & 1 deletion bin/composer-require-checker-config.json
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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);

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
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion tests/MethodSignatureTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1550,7 +1550,7 @@ public function bar(string ...$_args): void {}
',
'error_message' => 'MethodSignatureMismatch',
],
'noMixedTypehintInDescendant' => [
'SKIPPED-noMixedTypehintInDescendant' => [
'code' => '<?php
class a {
public function test(): mixed {
Expand Down

0 comments on commit e6d491a

Please sign in to comment.