Skip to content

Commit 3fb6f72

Browse files
committed
Bump Psalm 3.18.2 and fix reported issues.
1 parent a51e36c commit 3fb6f72

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ build/php-cs-fixer.phar:
5757

5858
# Update download URL from https://github.com/vimeo/psalm/releases
5959
build/psalm.phar:
60-
curl -LSs https://github.com/vimeo/psalm/releases/download/3.0.17/psalm.phar -o build/psalm.phar
60+
curl -LSs https://github.com/vimeo/psalm/releases/download/3.18.2/psalm.phar -o build/psalm.phar
6161

6262
build/box.phar:
6363
@cd build && curl -LSs https://box-project.github.io/box2/installer.php | php

psalm.xml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,6 @@
4040
</errorLevel>
4141
</UnresolvableInclude>
4242

43-
<!-- Invalid PHPDoc on Symfony process helper -->
44-
<PossiblyInvalidArgument>
45-
<errorLevel type="suppress">
46-
<file name="src/Process/Execute.php"/>
47-
</errorLevel>
48-
</PossiblyInvalidArgument>
49-
5043
<!-- These are due to how Command classes work with properties -->
5144
<PossiblyNullArgument>
5245
<errorLevel type="suppress">
@@ -89,6 +82,8 @@
8982
<errorLevel type="suppress">
9083
<directory name="src/PluginValidate/Requirements"/>
9184
<file name="src/Command/CodeFixerCommand.php"/>
85+
<file name="src/Installer/AbstractInstaller.php"/>
86+
<file name="src/PluginValidate/Finder/FinderInterface.php"/>
9287
</errorLevel>
9388
</MissingReturnType>
9489

src/Bridge/Moodle.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function getComponentInstallDirectory($component)
105105
list($type, $name) = $this->normalizeComponent($component);
106106

107107
// Must use reflection to avoid using static cache.
108-
$method = new \ReflectionMethod('core_component', 'fetch_plugintypes');
108+
$method = new \ReflectionMethod(\core_component::class, 'fetch_plugintypes');
109109
$method->setAccessible(true);
110110
$result = $method->invoke(null);
111111

src/Command/AddPluginCommand.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7171
throw new \InvalidArgumentException('Cannot use both the project argument and the --clone option');
7272
}
7373
if (!empty($project)) {
74+
/** @psalm-suppress PossiblyInvalidArgument */
7475
$cloneUrl = sprintf('https://github.com/%s.git', $project);
7576
} elseif (!empty($clone)) {
7677
$cloneUrl = $clone;
@@ -81,7 +82,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
8182
$filesystem->mkdir($storage);
8283
$storageDir = realpath($validate->directory($storage));
8384

84-
$process = new Process(sprintf('git clone --depth 1 --branch %s %s', $branch, $cloneUrl), $storageDir);
85+
/** @psalm-suppress PossiblyInvalidArgument */
86+
$cloneUrl = sprintf('git clone --depth 1 --branch %s %s', $branch, $cloneUrl);
87+
$process = new Process($cloneUrl, $storageDir);
8588
$this->execute->mustRun($process);
8689

8790
$dumper = new EnvDumper();

src/Command/CoverallsUploadCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ protected function execute(InputInterface $input, OutputInterface $output)
4444
{
4545
$coverage = realpath($input->getOption('coverage-file'));
4646
if ($coverage === false) {
47-
$output->writeln(sprintf('Did not find coverage file at <info>%s</info>', $input->getOption('coverage-file')));
47+
/** @psalm-suppress PossiblyInvalidArgument */
48+
$message = sprintf('Did not find coverage file at <info>%s</info>', $input->getOption('coverage-file'));
49+
$output->writeln($message);
4850

4951
return 0;
5052
}

src/Parser/StatementFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function arrayStringKeys(Array_ $array)
160160
{
161161
$keys = [];
162162
foreach ($array->items as $item) {
163-
if ($item->key instanceof String_) {
163+
if (isset($item->key) && $item->key instanceof String_) {
164164
$keys[] = $item->key->value;
165165
}
166166
}

src/PluginValidate/Finder/TableFinder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ protected function findTables($file)
3939
$tables = [];
4040
$xml = simplexml_load_file($file);
4141
foreach ($xml->xpath('TABLES/TABLE') as $element) {
42-
if (null !== $element['NAME']) {
42+
if (isset($element['NAME'])) {
4343
$tables[] = (string) $element['NAME'];
4444
}
4545
}

0 commit comments

Comments
 (0)