Skip to content

Commit

Permalink
Merge pull request #715 from stof/upgrade_phpstan
Browse files Browse the repository at this point in the history
Upgrade phpstan
  • Loading branch information
stof authored Aug 15, 2024
2 parents 394ed1e + 43bb1e4 commit 1c57724
Show file tree
Hide file tree
Showing 11 changed files with 90 additions and 60 deletions.
25 changes: 10 additions & 15 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1415,11 +1415,6 @@ parameters:
count: 1
path: src/Compiler.php

-
message: "#^Parameter \\#1 \\$value of method ScssPhp\\\\ScssPhp\\\\Compiler\\:\\:compileValue\\(\\) expects array\\|ScssPhp\\\\ScssPhp\\\\Node\\\\Number, array\\|string given\\.$#"
count: 1
path: src/Compiler.php

-
message: "#^Parameter \\#2 \\$baseDir of method ScssPhp\\\\ScssPhp\\\\Compiler\\:\\:resolveImportPath\\(\\) expects string, string\\|false given\\.$#"
count: 1
Expand Down Expand Up @@ -1625,11 +1620,6 @@ parameters:
count: 1
path: src/Parser.php

-
message: "#^Method ScssPhp\\\\ScssPhp\\\\Parser\\:\\:func\\(\\) has parameter \\$func with no value type specified in iterable type array\\.$#"
count: 1
path: src/Parser.php

-
message: "#^Method ScssPhp\\\\ScssPhp\\\\Parser\\:\\:isPlainCssValidElement\\(\\) has parameter \\$parsed with no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -1675,11 +1665,6 @@ parameters:
count: 1
path: src/Parser.php

-
message: "#^Method ScssPhp\\\\ScssPhp\\\\Parser\\:\\:unit\\(\\) has parameter \\$unit with no value type specified in iterable type array\\.$#"
count: 1
path: src/Parser.php

-
message: "#^PHPDoc tag @var for variable \\$nextValue has no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -1700,6 +1685,16 @@ parameters:
count: 1
path: src/Parser.php

-
message: "#^Parameter &\\$out @param\\-out type of method ScssPhp\\\\ScssPhp\\\\Parser\\:\\:enclosedExpression\\(\\) expects array\\|ScssPhp\\\\ScssPhp\\\\Node\\\\Number, array\\|hasOffsetValue\\(int, string\\) given\\.$#"
count: 2
path: src/Parser.php

-
message: "#^Parameter &\\$out @param\\-out type of method ScssPhp\\\\ScssPhp\\\\Parser\\:\\:genericList\\(\\) expects array\\|ScssPhp\\\\ScssPhp\\\\Node\\\\Number, array\\|ScssPhp\\\\ScssPhp\\\\Node\\\\Number\\|null given\\.$#"
count: 1
path: src/Parser.php

-
message: "#^Right side of && is always true\\.$#"
count: 5
Expand Down
4 changes: 4 additions & 0 deletions phpstan-no-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,9 @@ parameters:
message: "#^Method ScssPhp\\\\ScssPhp\\\\Parser\\:\\:[^(]+\\(\\) has parameter \\$out with no value type specified in iterable type array\\.$#"
path: src/Parser.php

-
message: "#^Method ScssPhp\\\\ScssPhp\\\\Parser\\:\\:[^(]+\\(\\) has @param-out PHPDoc tag for parameter \\$\\w+ with no value type specified in iterable type array\\.$#"
path: src/Parser.php

includes:
- vendor-bin/phpstan/vendor/phpstan/phpstan/conf/bleedingEdge.neon
3 changes: 2 additions & 1 deletion src/Block/DirectiveBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace ScssPhp\ScssPhp\Block;

use ScssPhp\ScssPhp\Block;
use ScssPhp\ScssPhp\Node\Number;
use ScssPhp\ScssPhp\Type;

/**
Expand All @@ -26,7 +27,7 @@ class DirectiveBlock extends Block
public $name;

/**
* @var string|array|null
* @var array|Number|null
*/
public $value;

Expand Down
3 changes: 2 additions & 1 deletion src/Block/EachBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace ScssPhp\ScssPhp\Block;

use ScssPhp\ScssPhp\Block;
use ScssPhp\ScssPhp\Node\Number;
use ScssPhp\ScssPhp\Type;

/**
Expand All @@ -26,7 +27,7 @@ class EachBlock extends Block
public $vars = [];

/**
* @var array
* @var array|Number
*/
public $list;

Expand Down
3 changes: 2 additions & 1 deletion src/Block/ElseifBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace ScssPhp\ScssPhp\Block;

use ScssPhp\ScssPhp\Block;
use ScssPhp\ScssPhp\Node\Number;
use ScssPhp\ScssPhp\Type;

/**
Expand All @@ -21,7 +22,7 @@
class ElseifBlock extends Block
{
/**
* @var array
* @var array|Number
*/
public $cond;

Expand Down
5 changes: 3 additions & 2 deletions src/Block/ForBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace ScssPhp\ScssPhp\Block;

use ScssPhp\ScssPhp\Block;
use ScssPhp\ScssPhp\Node\Number;
use ScssPhp\ScssPhp\Type;

/**
Expand All @@ -26,12 +27,12 @@ class ForBlock extends Block
public $var;

/**
* @var array
* @var array|Number
*/
public $start;

/**
* @var array
* @var array|Number
*/
public $end;

Expand Down
3 changes: 2 additions & 1 deletion src/Block/IfBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace ScssPhp\ScssPhp\Block;

use ScssPhp\ScssPhp\Block;
use ScssPhp\ScssPhp\Node\Number;
use ScssPhp\ScssPhp\Type;

/**
Expand All @@ -21,7 +22,7 @@
class IfBlock extends Block
{
/**
* @var array
* @var array|Number
*/
public $cond;

Expand Down
3 changes: 2 additions & 1 deletion src/Block/MediaBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace ScssPhp\ScssPhp\Block;

use ScssPhp\ScssPhp\Block;
use ScssPhp\ScssPhp\Node\Number;
use ScssPhp\ScssPhp\Type;

/**
Expand All @@ -21,7 +22,7 @@
class MediaBlock extends Block
{
/**
* @var string|array|null
* @var string|array|Number|null
*/
public $value;

Expand Down
1 change: 1 addition & 0 deletions src/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,7 @@ protected function compileWith($withCondition)
$parser = $this->parserFactory(__METHOD__);

if ($parser->parseValue($buffer, $reParsedWith)) {
\assert(\is_array($reParsedWith));
$withCondition = $reParsedWith;
}
}
Expand Down
Loading

0 comments on commit 1c57724

Please sign in to comment.