Skip to content

Commit

Permalink
cs-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
danog committed Oct 19, 2023
1 parent ec959e9 commit a233e62
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/Psalm/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -1468,7 +1468,7 @@ public function setAdvancedErrorLevel(string $issue_key, array $config, ?string
public function safeSetAdvancedErrorLevel(
string $issue_key,
array $config,
?string $default_error_level = null
?string $default_error_level = null,
): void {
if (!isset($this->issue_handlers[$issue_key])) {
$this->setAdvancedErrorLevel($issue_key, $config, $default_error_level);
Expand Down
8 changes: 4 additions & 4 deletions src/Psalm/Internal/Analyzer/Statements/DeclareAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ final class DeclareAnalyzer
public static function analyze(
StatementsAnalyzer $statements_analyzer,
PhpParser\Node\Stmt\Declare_ $stmt,
Context $context
Context $context,
): void {
foreach ($stmt->declares as $declaration) {
$declaration_key = (string) $declaration->key;
Expand Down Expand Up @@ -55,7 +55,7 @@ public static function analyze(
private static function analyzeStrictTypesDeclaration(
StatementsAnalyzer $statements_analyzer,
PhpParser\Node\Stmt\DeclareDeclare $declaration,
Context $context
Context $context,
): void {
if (!$declaration->value instanceof PhpParser\Node\Scalar\LNumber
|| !in_array($declaration->value->value, [0, 1], true)
Expand All @@ -78,7 +78,7 @@ private static function analyzeStrictTypesDeclaration(

private static function analyzeTicksDeclaration(
StatementsAnalyzer $statements_analyzer,
PhpParser\Node\Stmt\DeclareDeclare $declaration
PhpParser\Node\Stmt\DeclareDeclare $declaration,
): void {
if (!$declaration->value instanceof PhpParser\Node\Scalar\LNumber) {
IssueBuffer::maybeAdd(
Expand All @@ -93,7 +93,7 @@ private static function analyzeTicksDeclaration(

private static function analyzeEncodingDeclaration(
StatementsAnalyzer $statements_analyzer,
PhpParser\Node\Stmt\DeclareDeclare $declaration
PhpParser\Node\Stmt\DeclareDeclare $declaration,
): void {
if (!$declaration->value instanceof PhpParser\Node\Scalar\String_) {
IssueBuffer::maybeAdd(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,7 @@ private static function handleEnumName(
StatementsAnalyzer $statements_analyzer,
PropertyFetch $stmt,
Union $stmt_var_type,
ClassLikeStorage $class_storage
ClassLikeStorage $class_storage,
): void {
$relevant_enum_cases = array_filter(
$stmt_var_type->getAtomicTypes(),
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Cli/Psalm.php
Original file line number Diff line number Diff line change
Expand Up @@ -1043,7 +1043,7 @@ private static function initBaseline(
Config $config,
string $current_dir,
?string $path_to_config,
?array $paths_to_check
?array $paths_to_check,
): array {
$issue_baseline = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class AssertionsFromInheritanceResolver
private Codebase $codebase;

public function __construct(
Codebase $codebase
Codebase $codebase,
) {
$this->codebase = $codebase;
}
Expand All @@ -32,7 +32,7 @@ public function __construct(
*/
public function resolve(
MethodStorage $method_storage,
ClassLikeStorage $called_class
ClassLikeStorage $called_class,
): array {
$method_name_lc = strtolower($method_storage->cased_name ?? '');

Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Codebase/Methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ public function getMethodReturnType(
?string &$self_class,
?SourceAnalyzer $source_analyzer = null,
?array $args = null,
?TemplateResult $template_result = null
?TemplateResult $template_result = null,
): ?Union {
$original_fq_class_name = $method_id->fq_class_name;
$original_method_name = $method_id->method_name;
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Internal/Type/SimpleAssertionReconciler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2943,7 +2943,7 @@ private static function reconcileClassConstant(
private static function reconcileValueOf(
Codebase $codebase,
TValueOf $assertion_type,
int &$failed_reconciliation
int &$failed_reconciliation,
): ?Union {
$reconciled_types = [];

Expand Down
3 changes: 1 addition & 2 deletions src/Psalm/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,9 @@ public static function getNumericString(): Union

/**
* @psalm-suppress PossiblyUnusedMethod
* @param int|string $value
* @return TLiteralString|TLiteralInt
*/
public static function getLiteral($value): Atomic
public static function getLiteral(int|string $value): Atomic

Check failure on line 268 in src/Psalm/Type.php

View workflow job for this annotation

GitHub Actions / Check backward compatibility

The parameter $value of Psalm\Type::getLiteral() changed from no type to a non-contravariant int|string

Check failure on line 268 in src/Psalm/Type.php

View workflow job for this annotation

GitHub Actions / Check backward compatibility

The parameter $value of Psalm\Type::getLiteral() changed from no type to int|string
{
if (is_int($value)) {
return new TLiteralInt($value);
Expand Down
2 changes: 1 addition & 1 deletion src/Psalm/Type/Atomic/TCallableKeyedArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
array $properties,
?array $class_strings = null,
?array $fallback_params = null,
bool $from_docblock = false
bool $from_docblock = false,
) {
parent::__construct(
$properties,
Expand Down

0 comments on commit a233e62

Please sign in to comment.