Skip to content

Commit feb0a6e

Browse files
committed
[ci] add job to check laravel rector with latest dev-main build
1 parent 0a6028a commit feb0a6e

4 files changed

Lines changed: 31 additions & 71 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Rector Laravel with dev-main
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: null
8+
9+
env:
10+
# see https://github.com/composer/composer/issues/9368#issuecomment-718112361
11+
COMPOSER_ROOT_VERSION: "dev-main"
12+
13+
jobs:
14+
rector_laravel_rector_dev:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
-
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
php-version: 8.3
22+
coverage: none
23+
24+
# fixes https://github.com/rectorphp/rector/pull/4559/checks?check_run_id=1359814403, see https://github.com/shivammathur/setup-php#composer-github-oauth
25+
env:
26+
COMPOSER_TOKEN: ${{ secrets.ACCESS_TOKEN }}
27+
28+
- run: git clone https://github.com/driftingly/rector-laravel.git
29+
- run: composer require rector/rector:dev-main --working-dir rector-laravel
30+
- run: cd rector-laravel && vendor/bin/phpunit
31+

rules-tests/Privatization/Rector/ClassMethod/PrivatizeFinalClassMethodRector/Fixture/keep_magic_parent_called_method.php.inc

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,12 @@
33
namespace Rector\Tests\Privatization\Rector\ClassMethod\PrivatizeFinalClassMethodRector\Fixture;
44

55
use PhpParser\PrettyPrinter\Standard;
6-
<<<<<<< HEAD
7-
=======
86
use Rector\PhpParser\Node\FileNode;
9-
>>>>>>> fb58990e39 (extract LaravelClassName)
107

118
final class KeepMagicParentCalledMethod extends Standard
129
{
1310
// called from parent by $this->{'p'} method
14-
<<<<<<< HEAD
15-
protected function pFileNode($fileNode)
16-
=======
1711
protected function pFileNode(FileNode $fileNode)
18-
>>>>>>> fb58990e39 (extract LaravelClassName)
1912
{
2013
}
2114
}

rules/Privatization/Rector/ClassMethod/PrivatizeFinalClassMethodRector.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,7 @@ public function __construct(
3131
private readonly OverrideByParentClassGuard $overrideByParentClassGuard,
3232
private readonly BetterNodeFinder $betterNodeFinder,
3333
private readonly LaravelModelGuard $laravelModelGuard,
34-
<<<<<<< HEAD
3534
private readonly ParentClassMagicCallGuard $parentClassMagicCallGuard,
36-
=======
37-
private readonly \Rector\Privatization\VisibilityGuard\ParentClassMagicCallGuard $parentClassMagicCallGuard
38-
>>>>>>> 4263eff61e (skip parent magic called method in PrivatizeFinalClassMethodRector)
3935
) {
4036
}
4137

src/Testing/TestingParser/TestingParser.php

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,7 @@ public function __construct(
2828

2929
public function parseFilePathToFile(string $filePath): File
3030
{
31-
<<<<<<< HEAD
32-
<<<<<<< HEAD
3331
[$file, $stmts] = $this->parseToFileAndStmts($filePath);
34-
<<<<<<< HEAD
35-
=======
36-
// needed for PHPStan reflection, as it caches the last processed file
37-
$this->dynamicSourceLocatorProvider->setFilePath($filePath);
38-
39-
$fileContent = FileSystem::read($filePath);
40-
$file = new File($filePath, $fileContent);
41-
$stmts = $this->rectorParser->parseString($fileContent);
42-
43-
// wrap in FileNode to enable file-level rules
44-
$stmts = [new FileNode($stmts)];
45-
46-
$stmts = $this->nodeScopeAndMetadataDecorator->decorateNodesFromFile($filePath, $stmts);
47-
48-
$file->hydrateStmtsAndTokens($stmts, $stmts, []);
49-
$this->currentFileProvider->setFile($file);
50-
>>>>>>> 2751658832 (introduce FileNode to handle file-level changes; deprecate IncreaseDeclareStrictTypesRector)
51-
=======
52-
[$file, $stmts] = $this->parseToFileAndStmts($filePath);
53-
>>>>>>> 8e51776f69 (cleanup phpstan errors)
54-
55-
=======
56-
>>>>>>> 90002f8aee (extract LaravelClassName)
5732
return $file;
5833
}
5934

@@ -64,37 +39,10 @@ public function parseFileToDecoratedNodes(string $filePath): array
6439
{
6540
[$file, $stmts] = $this->parseToFileAndStmts($filePath);
6641
return $stmts;
67-
<<<<<<< HEAD
68-
<<<<<<< HEAD
6942
}
7043

7144
/**
7245
* @return array{0: File, 1: Node[]}
73-
=======
74-
//
75-
// // needed for PHPStan reflection, as it caches the last processed file
76-
// $this->dynamicSourceLocatorProvider->setFilePath($filePath);
77-
//
78-
// $fileContent = FileSystem::read($filePath);
79-
// $stmts = $this->rectorParser->parseString($fileContent);
80-
// $file = new File($filePath, $fileContent);
81-
//
82-
// // wrap in FileNode to enable file-level rules
83-
// $stmts = [new FileNode($stmts)];
84-
//
85-
// $stmts = $this->nodeScopeAndMetadataDecorator->decorateNodesFromFile($filePath, $stmts);
86-
// $file->hydrateStmtsAndTokens($stmts, $stmts, []);
87-
//
88-
// $this->currentFileProvider->setFile($file);
89-
//
90-
// return $stmts;
91-
=======
92-
>>>>>>> 90002f8aee (extract LaravelClassName)
93-
}
94-
95-
/**
96-
* @return array{0: File, 1: Node\Stmt[]}
97-
>>>>>>> 8e51776f69 (cleanup phpstan errors)
9846
*/
9947
private function parseToFileAndStmts(string $filePath): array
10048
{
@@ -105,16 +53,8 @@ private function parseToFileAndStmts(string $filePath): array
10553
$file = new File($filePath, $fileContent);
10654
$stmts = $this->rectorParser->parseString($fileContent);
10755

108-
<<<<<<< HEAD
109-
$stmts = $this->rectorParser->parseString($fileContent);
110-
=======
11156
// wrap in FileNode to enable file-level rules
11257
$stmts = [new FileNode($stmts)];
113-
<<<<<<< HEAD
114-
115-
>>>>>>> 2751658832 (introduce FileNode to handle file-level changes; deprecate IncreaseDeclareStrictTypesRector)
116-
=======
117-
>>>>>>> 90002f8aee (extract LaravelClassName)
11858
$stmts = $this->nodeScopeAndMetadataDecorator->decorateNodesFromFile($filePath, $stmts);
11959

12060
$file->hydrateStmtsAndTokens($stmts, $stmts, []);

0 commit comments

Comments
 (0)