Skip to content

Commit 9ddc39d

Browse files
committed
Fix
1 parent 3852123 commit 9ddc39d

File tree

14 files changed

+11
-85
lines changed

14 files changed

+11
-85
lines changed

examples/TemplateScanner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use function preg_match;
1515
use function trim;
1616

17-
final class TemplateScanner extends Psalm\Internal\Scanner\FileScanner
17+
class TemplateScanner extends Psalm\Internal\Scanner\FileScanner
1818
{
1919
final public const VIEW_CLASS = 'Your\\View\\Class';
2020

src/Psalm/Internal/Analyzer/FileAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
* @internal
4242
* @psalm-consistent-constructor
4343
*/
44-
final class FileAnalyzer extends SourceAnalyzer
44+
class FileAnalyzer extends SourceAnalyzer
4545
{
4646
use CanAlias;
4747

src/Psalm/Internal/Analyzer/NamespaceAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ final class NamespaceAnalyzer extends SourceAnalyzer
3838
private static array $public_namespace_constants = [];
3939

4040
public function __construct(
41-
private readonly Namespace_ $namespace,
41+
private readonly Namespace_ $namespace,
4242
/**
4343
* @var FileAnalyzer
4444
* @psalm-suppress NonInvariantDocblockPropertyType

src/Psalm/Internal/Analyzer/Statements/Block/IfElse/ElseIfAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ public static function analyze(
241241

242242
foreach ($newly_reconciled_var_ids as $changed_var_id => $_) {
243243
foreach ($elseif_context->vars_in_scope as $var_id => $_) {
244-
if (preg_match('/' . preg_quote((string) $changed_var_id, '/') . '[\]\[\-]/', $var_id)
244+
if (preg_match('/' . preg_quote($changed_var_id, '/') . '[\]\[\-]/', $var_id)
245245
&& !array_key_exists($var_id, $newly_reconciled_var_ids)
246246
&& !array_key_exists($var_id, $cond_referenced_var_ids)
247247
) {

src/Psalm/Internal/Analyzer/Statements/Expression/BinaryOp/ArithmeticOpAnalyzer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Psalm\Internal\Analyzer\Statements\Expression\BinaryOp;
66

7-
use Decimal\Decimal;
87
use PhpParser;
98
use Psalm\CodeLocation;
109
use Psalm\Codebase;

src/Psalm/Internal/Diff/FileDiffer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public static function getDiff(string $a_code, string $b_code): array
250250
$b_offset += $new_text_length;
251251
} else {
252252
/** @psalm-suppress MixedArgument */
253-
$same_text_length = strlen((string) $diff_elem->new) + 1;
253+
$same_text_length = strlen($diff_elem->new) + 1;
254254

255255
$a_offset += $same_text_length;
256256
$b_offset += $same_text_length;

src/Psalm/Internal/LanguageServer/LanguageClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private function configurationRefreshed(array $config): void
153153
}
154154

155155
/** @var array */
156-
$array = json_decode((string) json_encode($config, JSON_THROW_ON_ERROR), true, 512, JSON_THROW_ON_ERROR);
156+
$array = json_decode(json_encode($config, JSON_THROW_ON_ERROR), true, 512, JSON_THROW_ON_ERROR);
157157

158158
if (isset($array['hideWarnings'])) {
159159
$this->clientConfiguration->hideWarnings = (bool) $array['hideWarnings'];

src/Psalm/Internal/PhpVisitor/PartialParserVisitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class PartialParserVisitor extends PhpParser\NodeVisitorAbstract
3535
{
3636
private bool $must_rescan = false;
3737

38-
private readonly int $non_method_changes;
38+
private int $non_method_changes;
3939

4040
private readonly int $a_file_contents_length;
4141

src/Psalm/Internal/Type/TypeExpander.php

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -319,28 +319,6 @@ public static function expandAtomic(
319319
];
320320
}
321321

322-
/** @psalm-suppress DeprecatedProperty For backwards compatibility, we have to keep this here. */
323-
foreach ($return_type->extra_types ?? [] as $alias) {
324-
$more_recursively_fleshed_out_types = self::expandAtomic(
325-
$codebase,
326-
$alias,
327-
$self_class,
328-
$static_class_type,
329-
$parent_class,
330-
$evaluate_class_constants,
331-
$evaluate_conditional_types,
332-
$final,
333-
$expand_generic,
334-
$expand_templates,
335-
$throw_on_unresolvable_constant,
336-
);
337-
338-
$recursively_fleshed_out_types = [
339-
...$more_recursively_fleshed_out_types,
340-
...$recursively_fleshed_out_types,
341-
];
342-
}
343-
344322
return $recursively_fleshed_out_types;
345323
}
346324

src/Psalm/IssueBuffer.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,6 @@ public static function getOutput(
881881
Report::TYPE_SARIF => new SarifReport($normalized_data, self::$fixable_issue_counts, $report_options),
882882
Report::TYPE_CODECLIMATE => new CodeClimateReport($normalized_data, self::$fixable_issue_counts, $report_options),
883883
Report::TYPE_COUNT => new CountReport($normalized_data, self::$fixable_issue_counts, $report_options),
884-
default => throw new RuntimeException('Unexpected report format: ' . $report_options->format),
885884
};
886885

887886
return $output->create();

0 commit comments

Comments
 (0)