Skip to content

Commit 22f63e2

Browse files
authored
Merge pull request #154 from radimvaculik/feature/rector-0-5
Update rector-migrate.yml to support Rector 0.5
2 parents 5b782da + 1847ac8 commit 22f63e2

File tree

9 files changed

+1121
-1123
lines changed

9 files changed

+1121
-1123
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ script:
5858
echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
5959
exit 1;
6060
fi
61-
- cd generator/tests/rector/0.4 && composer install && composer rector && composer test && cd ../../../..
61+
- cd generator/tests/rector/0.5 && composer install && composer rector && composer test && cd ../../../..
6262

6363
after_script:
6464
- cd generator && travis_retry php vendor/bin/php-coveralls -v

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ tool that performs instant refactoring of your application.
114114
First, you need to install Rector:
115115
116116
```bash
117-
$ composer require --dev rector/rector ^0.4
117+
$ composer require --dev rector/rector ^0.5
118118
```
119119

120120
Now, you simply need to run Rector with this command:

generated/image.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ function imagefilledellipse($image, int $cx, int $cy, int $width, int $height, i
11251125
* such as imagecreatetruecolor.
11261126
* @param array $points An array containing the x and y
11271127
* coordinates of the polygons vertices consecutively.
1128-
* @param int $num_points Total number of vertices, which must be at least 3.
1128+
* @param int $num_points Total number of points (vertices), which must be at least 3.
11291129
* @param int $color A color identifier created with imagecolorallocate.
11301130
* @throws ImageException
11311131
*
@@ -1776,7 +1776,7 @@ function imageloadfont(string $file): int
17761776
*
17771777
*
17781778
*
1779-
* @param int $num_points Total number of points (vertices).
1779+
* @param int $num_points Total number of points (vertices), which must be at least 3.
17801780
* @param int $color A color identifier created with imagecolorallocate.
17811781
* @throws ImageException
17821782
*
@@ -1852,7 +1852,7 @@ function imagepng($image, $to = null, int $quality = -1, int $filters = -1): voi
18521852
*
18531853
*
18541854
*
1855-
* @param int $num_points Total number of points (vertices).
1855+
* @param int $num_points Total number of points (vertices), which must be at least 3.
18561856
* @param int $color A color identifier created with imagecolorallocate.
18571857
* @throws ImageException
18581858
*

generator/src/FileCreator.php

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,13 @@ public function generateRectorFile(array $functions, string $path): void
128128
throw new \RuntimeException('Unable to write to '.$path);
129129
}
130130
fwrite($stream, "# This rector file is replacing all core PHP functions with the equivalent \"safe\" functions
131-
# It is targetting Rector 0.4.x versions.
132-
# If you are using Rector 0.3, please upgrade your Rector version
131+
# It is targetting Rector 0.5.x versions.
132+
# If you are using Rector 0.4, please upgrade your Rector version
133133
services:
134-
Rector\Rector\Function_\RenameFunctionRector:
135-
\$oldFunctionToNewFunction:
134+
Rector\Renaming\Rector\Function_\RenameFunctionRector:
136135
");
137136
foreach ($functionNames as $functionName) {
138-
fwrite($stream, ' '.$functionName.": 'Safe\\".$functionName."'\n");
137+
fwrite($stream, ' '.$functionName.": 'Safe\\".$functionName."'\n");
139138
}
140139
fclose($stream);
141140
}

generator/tests/rector/0.4/composer.json renamed to generator/tests/rector/0.5/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
},
77
"require": {
88
"php": ">=7.1",
9-
"rector/rector": "^0.4"
9+
"rector/rector": "^0.5"
1010
},
1111
"require-dev": {
1212
"phpunit/phpunit": "^7"
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)