Skip to content

Commit

Permalink
Fix various things
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Sep 14, 2020
1 parent 3f91166 commit c4450b9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
1 change: 1 addition & 0 deletions composer.json
Expand Up @@ -20,6 +20,7 @@
"ext-json": "*",
"ext-libxml": "*",
"ext-tokenizer": "*",
"ext-mbstring": "*",
"amphp/amp": "^2.1",
"amphp/byte-stream": "^1.5",
"composer/package-versions-deprecated": "^1.8.0",
Expand Down
8 changes: 4 additions & 4 deletions src/Psalm/Internal/Analyzer/Statements/Block/IfAnalyzer.php
Expand Up @@ -703,7 +703,7 @@ function (Type\Union $_): bool {
new DocblockTypeContradiction(
'if (false) is impossible',
new CodeLocation($statements_analyzer, $cond),
'false falsy',
'false falsy'
),
$statements_analyzer->getSuppressedIssues()
)) {
Expand All @@ -714,7 +714,7 @@ function (Type\Union $_): bool {
new TypeDoesNotContainType(
'if (false) is impossible',
new CodeLocation($statements_analyzer, $cond),
'false falsy',
'false falsy'
),
$statements_analyzer->getSuppressedIssues()
)) {
Expand All @@ -727,7 +727,7 @@ function (Type\Union $_): bool {
new RedundantConditionGivenDocblockType(
'if (true) is redundant',
new CodeLocation($statements_analyzer, $cond),
'true falsy',
'true falsy'
),
$statements_analyzer->getSuppressedIssues()
)) {
Expand All @@ -738,7 +738,7 @@ function (Type\Union $_): bool {
new RedundantCondition(
'if (true) is redundant',
new CodeLocation($statements_analyzer, $cond),
'true falsy',
'true falsy'
),
$statements_analyzer->getSuppressedIssues()
)) {
Expand Down
14 changes: 7 additions & 7 deletions tests/StubTest.php
Expand Up @@ -48,7 +48,7 @@ private function getProjectAnalyzerWithConfig(Config $config): \Psalm\Internal\A
new Provider\FakeParserCacheProvider()
)
);
$project_analyzer->setPhpVersion('7.3');
$project_analyzer->setPhpVersion('7.4');

$config->setIncludeCollector(new IncludeCollector());
$config->visitComposerAutoloadFiles($project_analyzer, null);
Expand Down Expand Up @@ -1134,13 +1134,13 @@ public function testStubOverridingMissingClass(): void
)
);

$this->project_analyzer->setPhpVersion('7.4');

$file_path = getcwd() . '/src/somefile.php';

$this->addFile(
$file_path,
'<?php'
'<?php
echo "hello";'
);

$this->expectException(\Psalm\Exception\InvalidClasslikeOverrideException::class);
Expand All @@ -1165,13 +1165,13 @@ public function testStubOverridingMissingMethod(): void
)
);

$this->project_analyzer->setPhpVersion('7.4');

$file_path = getcwd() . '/src/somefile.php';

$this->addFile(
$file_path,
'<?php'
'<?php

This comment has been minimized.

Copy link
@weirdan

weirdan Sep 14, 2020

Collaborator

I wonder what was wrong with 'empty' (no code) file here?

echo "hello";'
);

$this->expectException(\Psalm\Exception\InvalidMethodOverrideException::class);
Expand Down

0 comments on commit c4450b9

Please sign in to comment.