Skip to content

Commit 43ab5dd

Browse files
committed
bump to PHP 8.2
1 parent 15b944b commit 43ab5dd

28 files changed

+66
-75
lines changed

rector.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
typeDeclarations: true,
2020
rectorPreset: true,
2121
)
22+
->withPhpSets()
23+
->withAttributesSets()
2224
->withSkip([
2325
RenameForeachValueVariableToMatchMethodCallReturnTypeRector::class => [
2426
// metadata -> datum false positive

routes/web.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@
3838
Route::get('documentation/{section?}', DocumentationController::class);
3939

4040
Route::get('blog', BlogController::class);
41-
Route::get('book', function () {
42-
return redirect()->to('https://leanpub.com/rector-the-power-of-automated-refactoring');
43-
});
41+
Route::get('book', fn() => redirect()->to('https://leanpub.com/rector-the-power-of-automated-refactoring'));
4442

4543
Route::get('contact', ContactController::class);
4644
Route::get('hire-team', HireTeamController::class);

src/Controller/FindRuleController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
final class FindRuleController extends Controller
1212
{
1313
public function __construct(
14-
private RectorFinder $rectorFinder
14+
private readonly RectorFinder $rectorFinder
1515
) {
1616
}
1717

src/Controller/Stats/FindRuleStatsController.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@ public function __invoke(): View
5656
*/
5757
private function getArrayFlattenKey(array $items, string $keyName): array
5858
{
59-
$items = array_map(function (array $item) use ($keyName) {
60-
return $item[$keyName];
61-
}, $items);
59+
$items = array_map(fn(array $item) => $item[$keyName], $items);
6260

6361
// remove empty ones
6462
return array_filter($items);

src/DemoRunner.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
/**
2222
* @see \App\Tests\DemoRunnerTest
2323
*/
24-
final class DemoRunner
24+
final readonly class DemoRunner
2525
{
2626
/**
2727
* @var string
@@ -38,12 +38,12 @@ final class DemoRunner
3838
*/
3939
private const EXIT_CODE_SUCCESS = 0;
4040

41-
private readonly string $demoDir;
41+
private string $demoDir;
4242

4343
public function __construct(
44-
private readonly ErrorMessageNormalizer $errorMessageNormalizer,
45-
private readonly Filesystem $filesystem,
46-
private readonly RectorProcessFactory $rectorProcessFactory,
44+
private ErrorMessageNormalizer $errorMessageNormalizer,
45+
private Filesystem $filesystem,
46+
private RectorProcessFactory $rectorProcessFactory,
4747
) {
4848
$this->demoDir = __DIR__ . '/../storage/demo';
4949
}

src/Documentation/DocumentationMenuFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/**
1010
* @see \App\Tests\Documentation\DocumentationMenuFactoryTest
1111
*/
12-
final class DocumentationMenuFactory
12+
final readonly class DocumentationMenuFactory
1313
{
1414
public function __construct(
1515
private DocumentationMenuItemFactory $documentationMenuItemFactory

src/Documentation/DocumentationMenuItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace App\Documentation;
66

7-
final class DocumentationMenuItem
7+
final readonly class DocumentationMenuItem
88
{
99
public function __construct(
1010
private string $href,

src/Documentation/DocumentationMenuItemFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Illuminate\Contracts\Routing\UrlGenerator;
99
use Illuminate\Routing\Controller;
1010

11-
final class DocumentationMenuItemFactory
11+
final readonly class DocumentationMenuItemFactory
1212
{
1313
public function __construct(
1414
private UrlGenerator $urlGenerator

src/Entity/Post.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,19 @@
77
use App\Controller\Blog\PostController;
88
use DateTimeInterface;
99

10-
final class Post
10+
final readonly class Post
1111
{
1212
public function __construct(
13-
private readonly int $id,
14-
private readonly string $title,
15-
private readonly string $slug,
16-
private readonly DateTimeInterface $dateTime,
17-
private readonly string $perex,
18-
private readonly string $contents,
19-
private readonly string $author,
20-
private readonly ?DateTimeInterface $updatedAt = null,
21-
private readonly ?string $updatedMessage = null,
22-
private readonly ?string $sinceRector = null
13+
private int $id,
14+
private string $title,
15+
private string $slug,
16+
private DateTimeInterface $dateTime,
17+
private string $perex,
18+
private string $contents,
19+
private string $author,
20+
private ?DateTimeInterface $updatedAt = null,
21+
private ?string $updatedMessage = null,
22+
private ?string $sinceRector = null
2323
) {
2424
}
2525

src/EntityFactory/PostFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use Symfony\Component\Yaml\Yaml;
1515
use Webmozart\Assert\Assert;
1616

17-
final class PostFactory
17+
final readonly class PostFactory
1818
{
1919
/**
2020
* @var string
@@ -27,7 +27,7 @@ final class PostFactory
2727
private const CONFIG_CONTENT_REGEX = '#^\s*' . self::SLASHES_WITH_SPACES_REGEX . '?(?<config>.*?)' . self::SLASHES_WITH_SPACES_REGEX . '(?<content>.*?)$#s';
2828

2929
public function __construct(
30-
private readonly PathAnalyzer $pathAnalyzer,
30+
private PathAnalyzer $pathAnalyzer,
3131
) {
3232
}
3333

0 commit comments

Comments
 (0)