mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
cs-fix
This commit is contained in:
parent
ec959e95d7
commit
a233e621b2
@ -1468,7 +1468,7 @@ class Config
|
||||
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);
|
||||
|
@ -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;
|
||||
@ -55,7 +55,7 @@ final class DeclareAnalyzer
|
||||
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)
|
||||
@ -78,7 +78,7 @@ final class DeclareAnalyzer
|
||||
|
||||
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(
|
||||
@ -93,7 +93,7 @@ final class DeclareAnalyzer
|
||||
|
||||
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(
|
||||
|
@ -979,7 +979,7 @@ class AtomicPropertyFetchAnalyzer
|
||||
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(),
|
||||
|
@ -1043,7 +1043,7 @@ final class Psalm
|
||||
Config $config,
|
||||
string $current_dir,
|
||||
?string $path_to_config,
|
||||
?array $paths_to_check
|
||||
?array $paths_to_check,
|
||||
): array {
|
||||
$issue_baseline = [];
|
||||
|
||||
|
@ -22,7 +22,7 @@ final class AssertionsFromInheritanceResolver
|
||||
private Codebase $codebase;
|
||||
|
||||
public function __construct(
|
||||
Codebase $codebase
|
||||
Codebase $codebase,
|
||||
) {
|
||||
$this->codebase = $codebase;
|
||||
}
|
||||
@ -32,7 +32,7 @@ final class AssertionsFromInheritanceResolver
|
||||
*/
|
||||
public function resolve(
|
||||
MethodStorage $method_storage,
|
||||
ClassLikeStorage $called_class
|
||||
ClassLikeStorage $called_class,
|
||||
): array {
|
||||
$method_name_lc = strtolower($method_storage->cased_name ?? '');
|
||||
|
||||
|
@ -560,7 +560,7 @@ class Methods
|
||||
?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;
|
||||
|
@ -2943,7 +2943,7 @@ class SimpleAssertionReconciler extends Reconciler
|
||||
private static function reconcileValueOf(
|
||||
Codebase $codebase,
|
||||
TValueOf $assertion_type,
|
||||
int &$failed_reconciliation
|
||||
int &$failed_reconciliation,
|
||||
): ?Union {
|
||||
$reconciled_types = [];
|
||||
|
||||
|
@ -263,10 +263,9 @@ abstract class Type
|
||||
|
||||
/**
|
||||
* @psalm-suppress PossiblyUnusedMethod
|
||||
* @param int|string $value
|
||||
* @return TLiteralString|TLiteralInt
|
||||
*/
|
||||
public static function getLiteral($value): Atomic
|
||||
public static function getLiteral(int|string $value): Atomic
|
||||
{
|
||||
if (is_int($value)) {
|
||||
return new TLiteralInt($value);
|
||||
|
@ -27,7 +27,7 @@ final class TCallableKeyedArray extends TKeyedArray
|
||||
array $properties,
|
||||
?array $class_strings = null,
|
||||
?array $fallback_params = null,
|
||||
bool $from_docblock = false
|
||||
bool $from_docblock = false,
|
||||
) {
|
||||
parent::__construct(
|
||||
$properties,
|
||||
|
Loading…
Reference in New Issue
Block a user