Skip to content

Commit

Permalink
Update packages (#282)
Browse files Browse the repository at this point in the history
 - phpstan/phpdoc-parser updated from 1.25.0 to 1.26.0 minor
   See changes: phpstan/phpdoc-parser@1.25.0...1.26.0
   Release notes: https://github.com/phpstan/phpdoc-parser/releases/tag/1.26.0

 - phpstan/phpstan updated from 1.10.58 to 1.10.59 patch
   See changes: phpstan/phpstan@1.10.58...1.10.59
   Release notes: https://github.com/phpstan/phpstan/releases/tag/1.10.59

 - psalm/phar updated from 5.22.1 to 5.22.2 patch
   See changes: psalm/phar@5.22.1...5.22.2
   Release notes: https://github.com/psalm/phar/releases/tag/5.22.2

 - roave/security-advisories updated from dev-latest@3e513f3 to dev-latest@8f1e484
   See changes: Roave/SecurityAdvisories@3e513f3...8f1e484

 - symfony/cache updated from v7.0.3 to v7.0.4 patch
   See changes: symfony/cache@v7.0.3...v7.0.4
   Release notes: https://github.com/symfony/cache/releases/tag/v7.0.4

 - symfony/config updated from v7.0.3 to v7.0.4 patch
   See changes: symfony/config@v7.0.3...v7.0.4
   Release notes: https://github.com/symfony/config/releases/tag/v7.0.4

 - symfony/translation updated from v7.0.3 to v7.0.4 patch
   See changes: symfony/translation@v7.0.3...v7.0.4
   Release notes: https://github.com/symfony/translation/releases/tag/v7.0.4

 - symfony/var-exporter updated from v7.0.3 to v7.0.4 patch
   See changes: symfony/var-exporter@v7.0.3...v7.0.4
   Release notes: https://github.com/symfony/var-exporter/releases/tag/v7.0.4
  • Loading branch information
spaze authored Mar 2, 2024
2 parents 3b74388 + d3d015e commit b867a6a
Show file tree
Hide file tree
Showing 20 changed files with 369 additions and 230 deletions.
117 changes: 60 additions & 57 deletions site/composer.lock

Large diffs are not rendered by default.

131 changes: 67 additions & 64 deletions site/vendor/composer/installed.json

Large diffs are not rendered by default.

48 changes: 24 additions & 24 deletions site/vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => 'spaze/michalspacek.cz',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '3651d24e4fc4e08cd3b532afef0856b4b9a52df5',
'reference' => '3b74388fb0b085f18077ed24694bf651905bfc7c',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -314,18 +314,18 @@
),
),
'phpstan/phpdoc-parser' => array(
'pretty_version' => '1.25.0',
'version' => '1.25.0.0',
'reference' => 'bd84b629c8de41aa2ae82c067c955e06f1b00240',
'pretty_version' => '1.26.0',
'version' => '1.26.0.0',
'reference' => '231e3186624c03d7e7c890ec662b81e6b0405227',
'type' => 'library',
'install_path' => __DIR__ . '/../phpstan/phpdoc-parser',
'aliases' => array(),
'dev_requirement' => true,
),
'phpstan/phpstan' => array(
'pretty_version' => '1.10.58',
'version' => '1.10.58.0',
'reference' => 'a23518379ec4defd9e47cbf81019526861623ec2',
'pretty_version' => '1.10.59',
'version' => '1.10.59.0',
'reference' => 'e607609388d3a6d418a50a49f7940e8086798281',
'type' => 'library',
'install_path' => __DIR__ . '/../phpstan/phpstan',
'aliases' => array(),
Expand All @@ -350,9 +350,9 @@
'dev_requirement' => true,
),
'psalm/phar' => array(
'pretty_version' => '5.22.1',
'version' => '5.22.1.0',
'reference' => 'e69b15968ed39a66bd1a8ed1b7cbb07857d1cd1f',
'pretty_version' => '5.22.2',
'version' => '5.22.2.0',
'reference' => '380b34d2b19c5a48a201e6f84fab5388c5eced49',
'type' => 'library',
'install_path' => __DIR__ . '/../psalm/phar',
'aliases' => array(),
Expand Down Expand Up @@ -400,7 +400,7 @@
'roave/security-advisories' => array(
'pretty_version' => 'dev-latest',
'version' => 'dev-latest',
'reference' => '3e513f303c13a625befa037a23b5d1ac9bde2a52',
'reference' => '8f1e484da92817191c75c9b00108f13fb62fd741',
'type' => 'metapackage',
'install_path' => NULL,
'aliases' => array(
Expand Down Expand Up @@ -456,7 +456,7 @@
'spaze/michalspacek.cz' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '3651d24e4fc4e08cd3b532afef0856b4b9a52df5',
'reference' => '3b74388fb0b085f18077ed24694bf651905bfc7c',
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down Expand Up @@ -541,9 +541,9 @@
),
),
'symfony/cache' => array(
'pretty_version' => 'v7.0.3',
'version' => '7.0.3.0',
'reference' => '2207eceb2433d74df81232d97439bf508cb9e050',
'pretty_version' => 'v7.0.4',
'version' => '7.0.4.0',
'reference' => 'fc822951dd360a593224bb2cef90a087d0dff60f',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/cache',
'aliases' => array(),
Expand All @@ -565,9 +565,9 @@
),
),
'symfony/config' => array(
'pretty_version' => 'v7.0.3',
'version' => '7.0.3.0',
'reference' => '86a5027869ca3d6bdecae6d5d6c2f77c8f2c1d16',
'pretty_version' => 'v7.0.4',
'version' => '7.0.4.0',
'reference' => '44deeba7233f08f383185ffa37dace3b3bc87364',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/config',
'aliases' => array(),
Expand Down Expand Up @@ -631,9 +631,9 @@
'dev_requirement' => false,
),
'symfony/translation' => array(
'pretty_version' => 'v7.0.3',
'version' => '7.0.3.0',
'reference' => '7285f25c7dcc74d9ec1232473114274604e50f00',
'pretty_version' => 'v7.0.4',
'version' => '7.0.4.0',
'reference' => '5b75e872f7d135d7abb4613809fadc8d9f3d30a0',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/translation',
'aliases' => array(),
Expand All @@ -655,9 +655,9 @@
),
),
'symfony/var-exporter' => array(
'pretty_version' => 'v7.0.3',
'version' => '7.0.3.0',
'reference' => '1fb79308cb5fc2b44bff6e8af10a5af6812e05b8',
'pretty_version' => 'v7.0.4',
'version' => '7.0.4.0',
'reference' => 'dfb0acb6803eb714f05d97dd4c5abe6d5fa9fe41',
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/var-exporter',
'aliases' => array(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace PHPStan\PhpDocParser\Ast\Type;

use PHPStan\PhpDocParser\Ast\NodeAttributes;
use PHPStan\PhpDocParser\Ast\PhpDoc\TemplateTagValueNode;
use function implode;

class CallableTypeNode implements TypeNode
Expand All @@ -13,6 +14,9 @@ class CallableTypeNode implements TypeNode
/** @var IdentifierTypeNode */
public $identifier;

/** @var TemplateTagValueNode[] */
public $templateTypes;

/** @var CallableTypeParameterNode[] */
public $parameters;

Expand All @@ -21,12 +25,14 @@ class CallableTypeNode implements TypeNode

/**
* @param CallableTypeParameterNode[] $parameters
* @param TemplateTagValueNode[] $templateTypes
*/
public function __construct(IdentifierTypeNode $identifier, array $parameters, TypeNode $returnType)
public function __construct(IdentifierTypeNode $identifier, array $parameters, TypeNode $returnType, array $templateTypes = [])
{
$this->identifier = $identifier;
$this->parameters = $parameters;
$this->returnType = $returnType;
$this->templateTypes = $templateTypes;
}


Expand All @@ -36,8 +42,11 @@ public function __toString(): string
if ($returnType instanceof self) {
$returnType = "({$returnType})";
}
$template = $this->templateTypes !== []
? '<' . implode(', ', $this->templateTypes) . '>'
: '';
$parameters = implode(', ', $this->parameters);
return "{$this->identifier}({$parameters}): {$returnType}";
return "{$this->identifier}{$template}({$parameters}): {$returnType}";
}

}
59 changes: 23 additions & 36 deletions site/vendor/phpstan/phpdoc-parser/src/Parser/PhpDocParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,12 @@ public function parseTagValue(TokenIterator $tokens, string $tag): Ast\PhpDoc\Ph
case '@template-contravariant':
case '@phpstan-template-contravariant':
case '@psalm-template-contravariant':
$tagValue = $this->parseTemplateTagValue($tokens, true);
$tagValue = $this->typeParser->parseTemplateTagValue(
$tokens,
function ($tokens) {
return $this->parseOptionalDescription($tokens);
}
);
break;

case '@extends':
Expand Down Expand Up @@ -919,20 +924,24 @@ private function parsePropertyTagValue(TokenIterator $tokens): Ast\PhpDoc\Proper

private function parseMethodTagValue(TokenIterator $tokens): Ast\PhpDoc\MethodTagValueNode
{
$isStatic = $tokens->tryConsumeTokenValue('static');
$startLine = $tokens->currentTokenLine();
$startIndex = $tokens->currentTokenIndex();
$returnTypeOrMethodName = $this->typeParser->parse($tokens);
$staticKeywordOrReturnTypeOrMethodName = $this->typeParser->parse($tokens);

if ($staticKeywordOrReturnTypeOrMethodName instanceof Ast\Type\IdentifierTypeNode && $staticKeywordOrReturnTypeOrMethodName->name === 'static') {
$isStatic = true;
$returnTypeOrMethodName = $this->typeParser->parse($tokens);

} else {
$isStatic = false;
$returnTypeOrMethodName = $staticKeywordOrReturnTypeOrMethodName;
}

if ($tokens->isCurrentTokenType(Lexer::TOKEN_IDENTIFIER)) {
$returnType = $returnTypeOrMethodName;
$methodName = $tokens->currentTokenValue();
$tokens->next();

} elseif ($returnTypeOrMethodName instanceof Ast\Type\IdentifierTypeNode) {
$returnType = $isStatic
? $this->typeParser->enrichWithAttributes($tokens, new Ast\Type\IdentifierTypeNode('static'), $startLine, $startIndex)
: null;
$returnType = $isStatic ? $staticKeywordOrReturnTypeOrMethodName : null;
$methodName = $returnTypeOrMethodName->name;
$isStatic = false;

Expand All @@ -947,7 +956,12 @@ private function parseMethodTagValue(TokenIterator $tokens): Ast\PhpDoc\MethodTa
do {
$startLine = $tokens->currentTokenLine();
$startIndex = $tokens->currentTokenIndex();
$templateTypes[] = $this->enrichWithAttributes($tokens, $this->parseTemplateTagValue($tokens, false), $startLine, $startIndex);
$templateTypes[] = $this->enrichWithAttributes(
$tokens,
$this->typeParser->parseTemplateTagValue($tokens),
$startLine,
$startIndex
);
} while ($tokens->tryConsumeTokenType(Lexer::TOKEN_COMMA));
$tokens->consumeTokenType(Lexer::TOKEN_CLOSE_ANGLE_BRACKET);
}
Expand Down Expand Up @@ -1003,33 +1017,6 @@ private function parseMethodTagValueParameter(TokenIterator $tokens): Ast\PhpDoc
);
}

private function parseTemplateTagValue(TokenIterator $tokens, bool $parseDescription): Ast\PhpDoc\TemplateTagValueNode
{
$name = $tokens->currentTokenValue();
$tokens->consumeTokenType(Lexer::TOKEN_IDENTIFIER);

if ($tokens->tryConsumeTokenValue('of') || $tokens->tryConsumeTokenValue('as')) {
$bound = $this->typeParser->parse($tokens);

} else {
$bound = null;
}

if ($tokens->tryConsumeTokenValue('=')) {
$default = $this->typeParser->parse($tokens);
} else {
$default = null;
}

if ($parseDescription) {
$description = $this->parseOptionalDescription($tokens);
} else {
$description = '';
}

return new Ast\PhpDoc\TemplateTagValueNode($name, $bound, $description, $default);
}

private function parseExtendsTagValue(string $tagName, TokenIterator $tokens): Ast\PhpDoc\PhpDocTagValueNode
{
$startLine = $tokens->currentTokenLine();
Expand Down
Loading

0 comments on commit b867a6a

Please sign in to comment.