Skip to content

Commit

Permalink
Make phpstan happy
Browse files Browse the repository at this point in the history
  • Loading branch information
brightbyte committed Dec 14, 2023
1 parent e808564 commit 8b6b0f0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Core/Analyser/EventHandler/FromDeprecatedHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@
*/
class FromDeprecatedHandler implements EventSubscriberInterface
{
private bool $enabled;

/**
* @param array<mixed> $config
*/
public function __construct( array $config ) {
$this->enabled = $config['skip_deprecated'];
$this->enabled = (bool)$config['skip_deprecated'];
}

public function invoke(ProcessEvent $event): void
Expand Down
1 change: 1 addition & 0 deletions src/Core/Ast/AstMap/ClassLike/ClassLikeReference.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class ClassLikeReference implements TokenReferenceInterface
/**
* @param AstInherit[] $inherits
* @param DependencyToken[] $dependencies
* @param array<string,bool> $tags
*/
public function __construct(
private readonly ClassLikeToken $classLikeName,
Expand Down
5 changes: 5 additions & 0 deletions src/Core/Ast/AstMap/ClassLike/ClassLikeReferenceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ final class ClassLikeReferenceBuilder extends ReferenceBuilder

/**
* @param list<string> $tokenTemplates
* @param array<string,bool> $tags
*/
private function __construct(
array $tokenTemplates,
Expand All @@ -29,6 +30,7 @@ private function __construct(

/**
* @param list<string> $classTemplates
* @param array<string,bool> $tags
*/
public static function createClassLike(string $filepath, string $classLikeName, array $classTemplates, array $tags): self
{
Expand All @@ -37,6 +39,7 @@ public static function createClassLike(string $filepath, string $classLikeName,

/**
* @param list<string> $classTemplates
* @param array<string,bool> $tags
*/
public static function createClass(string $filepath, string $classLikeName, array $classTemplates, array $tags): self
{
Expand All @@ -45,6 +48,7 @@ public static function createClass(string $filepath, string $classLikeName, arra

/**
* @param list<string> $classTemplates
* @param array<string,bool> $tags
*/
public static function createTrait(string $filepath, string $classLikeName, array $classTemplates, array $tags): self
{
Expand All @@ -53,6 +57,7 @@ public static function createTrait(string $filepath, string $classLikeName, arra

/**
* @param list<string> $classTemplates
* @param array<string,bool> $tags
*/
public static function createInterface(string $filepath, string $classLikeName, array $classTemplates, array $tags): self
{
Expand Down
4 changes: 4 additions & 0 deletions src/Core/Ast/AstMap/File/FileReferenceBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public function useStatement(string $classLikeName, int $occursAtLine): self

/**
* @param list<string> $templateTypes
* @param array<string,bool> $tags
*/
public function newClass(string $classLikeName, array $templateTypes, array $tags): ClassLikeReferenceBuilder
{
Expand All @@ -49,6 +50,7 @@ public function newClass(string $classLikeName, array $templateTypes, array $tag

/**
* @param list<string> $templateTypes
* @param array<string,bool> $tags
*/
public function newTrait(string $classLikeName, array $templateTypes, array $tags): ClassLikeReferenceBuilder
{
Expand All @@ -60,6 +62,7 @@ public function newTrait(string $classLikeName, array $templateTypes, array $tag

/**
* @param list<string> $templateTypes
* @param array<string,bool> $tags
*/
public function newClassLike(string $classLikeName, array $templateTypes, array $tags): ClassLikeReferenceBuilder
{
Expand All @@ -71,6 +74,7 @@ public function newClassLike(string $classLikeName, array $templateTypes, array

/**
* @param list<string> $templateTypes
* @param array<string,bool> $tags
*/
public function newInterface(string $classLikeName, array $templateTypes, array $tags): ClassLikeReferenceBuilder
{
Expand Down
6 changes: 6 additions & 0 deletions src/Core/Ast/Parser/NikicPhpParser/FileReferenceVisitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ private function getClassReferenceName(ClassLike $node): ?string
return null;
}

/**
* @param array<string,bool> $tags
*/
private function enterInterface(string $name, Interface_ $node, array $tags): void
{
$this->currentReference = $this->fileReferenceBuilder->newInterface($name, $this->templatesFromDocs($node), $tags);
Expand All @@ -235,6 +238,9 @@ private function enterInterface(string $name, Interface_ $node, array $tags): vo
}
}

/**
* @param array<string,bool> $tags
*/
private function enterClass(string $name, Class_ $node, array $tags): void
{
$this->currentReference = $this->fileReferenceBuilder->newClass($name, $this->templatesFromDocs($node), $tags);
Expand Down

0 comments on commit 8b6b0f0

Please sign in to comment.