Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Lock closed PRs"

on:
schedule:
- cron: "0 3 * * *" # every day at 03:00 UTC
workflow_dispatch:

jobs:
lock:
runs-on: ubuntu-latest

steps:
- uses: dessant/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

pr-inactive-days: 150

pr-comment: >
This pull request has been automatically locked because it has been closed for 150 days.
Please open a new PR if you want to continue the work.

exclude-pr-labels: "keep-open,no-lock"
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ jobs:
days-before-stale: 60
days-before-close: 90
stale-issue-message: 'This issue has been automatically marked as stale due to inactivity for past 2 months. It will be closed in next 30 days if no further activity occurs.'
close-issue-message: 'Closing this issue due to prolonged inactivity.'
close-issue-message: 'Closing this issue as inactive for 30 days after marking stale.'
operations-per-run: 10
23 changes: 23 additions & 0 deletions build/target-repository/.github/workflows/lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Lock closed issues"

on:
schedule:
- cron: "0 3 * * *" # every day at 03:00 UTC
workflow_dispatch:

jobs:
lock:
runs-on: ubuntu-latest

steps:
- uses: dessant/lock-threads@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

issue-inactive-days: 150

issue-comment: >
This issue has been automatically locked because it has been closed for 150 days.
Please open a new issue if you have a similar problem.

exclude-issue-labels: "keep-open,no-lock"
3 changes: 1 addition & 2 deletions src/PHPStanStaticTypeMapper/TypeMapper/IntegerTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use PhpParser\Node;
use PhpParser\Node\Identifier;
use PHPStan\PhpDocParser\Ast\Type\IdentifierTypeNode;
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
use PHPStan\Type\IntegerType;
use PHPStan\Type\Type;
use Rector\Php\PhpVersionProvider;
Expand All @@ -32,7 +31,7 @@ public function getNodeClass(): string
/**
* @param IntegerType $type
*/
public function mapToPHPStanPhpDocTypeNode(Type $type): TypeNode
public function mapToPHPStanPhpDocTypeNode(Type $type): IdentifierTypeNode
{
// note: cannot be handled by PHPStan as uses explicit values
return new IdentifierTypeNode('int');
Expand Down
3 changes: 1 addition & 2 deletions src/PHPStanStaticTypeMapper/TypeMapper/ThisTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Rector\PHPStanStaticTypeMapper\TypeMapper;

use PhpParser\Node;
use PhpParser\Node\Name;
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
use PHPStan\Type\ThisType;
Expand Down Expand Up @@ -32,7 +31,7 @@ public function mapToPHPStanPhpDocTypeNode(Type $type): TypeNode
/**
* @param ThisType $type
*/
public function mapToPhpParserNode(Type $type, string $typeKind): Node
public function mapToPhpParserNode(Type $type, string $typeKind): Name
{
return new Name('self');
}
Expand Down
3 changes: 1 addition & 2 deletions src/PHPStanStaticTypeMapper/TypeMapper/UnionTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
use PhpParser\Node\Name\FullyQualified;
use PhpParser\Node\NullableType;
use PhpParser\Node\UnionType as PhpParserUnionType;
use PHPStan\PhpDocParser\Ast\Type\TypeNode;
use PHPStan\Type\ArrayType;
use PHPStan\Type\MixedType;
use PHPStan\Type\NeverType;
Expand Down Expand Up @@ -55,7 +54,7 @@ public function getNodeClass(): string
/**
* @param UnionType $type
*/
public function mapToPHPStanPhpDocTypeNode(Type $type): TypeNode
public function mapToPHPStanPhpDocTypeNode(Type $type): BracketsAwareUnionTypeNode
{
$unionTypesNodes = [];
$existingTypes = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function isCandidate(mixed $value): bool
/**
* @param mixed[] $value
*/
public function map($value): Expr
public function map($value): Array_
{
$arrayItems = [];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Rector\PhpAttribute\AnnotationToAttributeMapper;

use PhpParser\Node\Expr;
use PhpParser\Node\Scalar\String_;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Rector\PhpAttribute\Contract\AnnotationToAttributeMapperInterface;
Expand All @@ -22,7 +21,7 @@ public function isCandidate(mixed $value): bool
/**
* @param string $value
*/
public function map($value): Expr
public function map($value): String_
{
if (str_contains($value, "'") && ! str_contains($value, "\n")) {
$kind = String_::KIND_DOUBLE_QUOTED;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

namespace Rector\PhpAttribute\AnnotationToAttributeMapper;

use PhpParser\Node\Expr;
use PhpParser\Node\Scalar\String_;
use Rector\BetterPhpDocParser\PhpDoc\StringNode;
use Rector\NodeTypeResolver\Node\AttributeKey;
Expand All @@ -23,7 +22,7 @@ public function isCandidate(mixed $value): bool
/**
* @param StringNode $value
*/
public function map($value): Expr
public function map($value): String_
{
return new String_($value->value, [
AttributeKey::KIND => $value->getAttribute(AttributeKey::KIND),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use PhpParser\Node\Name;
use PhpParser\Node\Name\FullyQualified;
use PHPStan\Type\IntersectionType;
use PHPStan\Type\Type;
use Rector\StaticTypeMapper\Contract\PhpParser\PhpParserNodeMapperInterface;

/**
Expand All @@ -31,7 +30,7 @@ public function getNodeType(): string
/**
* @param Node\IntersectionType $node
*/
public function mapToPHPStan(Node $node): Type
public function mapToPHPStan(Node $node): IntersectionType
{
$types = [];
foreach ($node->types as $intersectionedType) {
Expand Down
3 changes: 1 addition & 2 deletions src/StaticTypeMapper/PhpParser/StringNodeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use PhpParser\Node;
use PhpParser\Node\Scalar\String_;
use PHPStan\Type\StringType;
use PHPStan\Type\Type;
use Rector\StaticTypeMapper\Contract\PhpParser\PhpParserNodeMapperInterface;

/**
Expand All @@ -23,7 +22,7 @@ public function getNodeType(): string
/**
* @param String_ $node
*/
public function mapToPHPStan(Node $node): Type
public function mapToPHPStan(Node $node): StringType
{
return new StringType();
}
Expand Down
Loading