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
48 changes: 3 additions & 45 deletions build/target-repository/docs/rector_rules_overview.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 389 Rules Overview
# 386 Rules Overview

<br>

## Categories

- [Arguments](#arguments) (6)

- [CodeQuality](#codequality) (73)
- [CodeQuality](#codequality) (72)

- [CodingStyle](#codingstyle) (34)

Expand Down Expand Up @@ -42,7 +42,7 @@

- [Php74](#php74) (13)

- [Php80](#php80) (19)
- [Php80](#php80) (18)

- [Php81](#php81) (12)

Expand Down Expand Up @@ -1018,26 +1018,6 @@ Change OR, AND to ||, && with more common understanding

<br>

### NarrowUnionTypeDocRector

Changes docblock by narrowing type

- class: [`Rector\CodeQuality\Rector\ClassMethod\NarrowUnionTypeDocRector`](../rules/CodeQuality/Rector/ClassMethod/NarrowUnionTypeDocRector.php)

```diff
class SomeClass {
/**
- * @param object|DateTime $message
+ * @param DateTime $message
*/
public function getMessage(object $message)
{
}
}
```

<br>

### NewStaticToNewSelfRector

Change unsafe new `static()` to new `self()`
Expand Down Expand Up @@ -5894,28 +5874,6 @@ Add `Stringable` interface to classes with `__toString()` method

<br>

### UnionTypesRector

Change docs types to union types, where possible (properties are covered by TypedPropertiesRector)

- class: [`Rector\Php80\Rector\FunctionLike\UnionTypesRector`](../rules/Php80/Rector/FunctionLike/UnionTypesRector.php)

```diff
class SomeClass
{
- /**
- * @param array|int $number
- * @return bool|float
- */
- public function go($number)
+ public function go(array|int $number): bool|float
{
}
}
```

<br>

## Php81

### ConstantListClassToEnumRector
Expand Down
4 changes: 0 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -696,10 +696,6 @@ parameters:
# resolve continually
- '#Property Rector\\Core\\Contract\\PhpParser\\Node\\StmtsAwareInterface\:\:\$stmts \(array<PhpParser\\Node\\Stmt>\|null\) does not accept array<PhpParser\\Node\\Stmt\|null>#'

# deprecated
- '#Register "Rector\\Php80\\Rector\\FunctionLike\\UnionTypesRector" service to "php80\.php" config set#'
- '#Fetching class constant class of deprecated class Rector\\CodeQuality\\Rector\\ClassMethod\\NarrowUnionTypeDocRector#'


# statics are required in the kernel for performance reasons
-
Expand Down
69 changes: 0 additions & 69 deletions rules/CodeQuality/Rector/ClassMethod/NarrowUnionTypeDocRector.php

This file was deleted.

82 changes: 0 additions & 82 deletions rules/Php80/Rector/FunctionLike/UnionTypesRector.php

This file was deleted.

27 changes: 0 additions & 27 deletions src/NodeAnalyzer/ArgsAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,6 @@

final class ArgsAnalyzer
{
/**
* @api
* @deprecated Use $node->getArgs()[x] instead
* @param Arg[] $args
*/
public function isArgInstanceInArgsPosition(array $args, int $position): bool
{
return isset($args[$position]);
}

/**
* @api
* @param Arg[] $args
* @param int[] $positions
* @deprecated use count($node->getArgs() < X instead
*/
public function isArgsInstanceInArgsPositions(array $args, array $positions): bool
{
foreach ($positions as $position) {
if (! isset($args[$position])) {
return false;
}
}

return true;
}

/**
* @param mixed[]|Arg[] $args
*/
Expand Down
3 changes: 0 additions & 3 deletions utils/Command/MissingInSetCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

use Nette\Utils\Strings;
use Rector\CodeQuality\Rector\ClassConstFetch\ConvertStaticPrivateConstantToSelfRector;
use Rector\CodeQuality\Rector\ClassMethod\NarrowUnionTypeDocRector;
use Rector\CodingStyle\Rector\ClassMethod\DataProviderArrayItemsNewlinedRector;
use Rector\CodingStyle\Rector\Property\NullifyUnionNullableRector;
use Rector\Core\Contract\Rector\ConfigurableRectorInterface;
Expand Down Expand Up @@ -52,8 +51,6 @@ final class MissingInSetCommand extends Command
FlipNegatedTernaryInstanceofRector::class,
BinaryOpNullableToInstanceofRector::class,
WhileNullableToInstanceofRector::class,
// deprecated
NarrowUnionTypeDocRector::class,
];

public function __construct(
Expand Down