Skip to content

Commit 816483d

Browse files
committed
Refactoring code to be php 7.1 compatible
1 parent 342d28c commit 816483d

18 files changed

+37
-38
lines changed

src/Command/RecipesCommand.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
use Composer\Command\BaseCommand;
1515
use Composer\Downloader\TransportException;
16-
use Composer\Util\HttpDownloader;
1716
use Symfony\Component\Console\Input\InputArgument;
1817
use Symfony\Component\Console\Input\InputInterface;
1918
use Symfony\Component\Console\Input\InputOption;

src/Command/UpdateRecipesCommand.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ class UpdateRecipesCommand extends BaseCommand
3333
{
3434
/** @var Flex */
3535
private $flex;
36-
private Downloader $downloader;
37-
private Configurator $configurator;
38-
private string $rootDir;
39-
private GithubApi $githubApi;
36+
private $downloader;
37+
private $configurator;
38+
private $rootDir;
39+
private $githubApi;
4040

4141
public function __construct(/* cannot be type-hinted */ $flex, Downloader $downloader, HttpDownloader $httpDownloader, Configurator $configurator, string $rootDir)
4242
{
@@ -234,7 +234,7 @@ private function getRecipe(string $packageName, string $recipeRef = null, string
234234
$packageName,
235235
$operation->getOperationType(),
236236
$recipes['manifests'][$packageName],
237-
$recipes['locks'][$packageName] ?? [],
237+
$recipes['locks'][$packageName] ?? []
238238
);
239239
}
240240

@@ -264,7 +264,7 @@ private function generateChangelog(Recipe $originalRecipe): ?array
264264
$recipeVersions = $this->githubApi->getVersionsOfRecipe(
265265
$recipeData['repo'],
266266
$recipeData['branch'],
267-
$originalRecipe->getName(),
267+
$originalRecipe->getName()
268268
);
269269
if (!$recipeVersions) {
270270
return null;

src/Configurator/ComposerScriptsConfigurator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ public function update(RecipeUpdate $recipeUpdate, array $originalConfig, array
5353

5454
$recipeUpdate->setOriginalFile(
5555
$jsonPath,
56-
$this->configureScripts($originalConfig, $json),
56+
$this->configureScripts($originalConfig, $json)
5757
);
5858
$recipeUpdate->setNewFile(
5959
$jsonPath,
60-
$this->configureScripts($newConfig, $json),
60+
$this->configureScripts($newConfig, $json)
6161
);
6262
}
6363

src/Configurator/CopyFromPackageConfigurator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function update(RecipeUpdate $recipeUpdate, array $originalConfig, array
4747
// path is in both, we cannot update
4848
$recipeUpdate->addCopyFromPackagePath(
4949
$packageDir.'/'.$source,
50-
$this->options->expandTargetDir($target),
50+
$this->options->expandTargetDir($target)
5151
);
5252

5353
unset($newConfig[$source]);

src/GithubApi.php

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

1616
class GithubApi
1717
{
18-
private HttpDownloader $downloader;
18+
private $downloader;
1919

2020
public function __construct(HttpDownloader $downloader)
2121
{

src/InformationOperation.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
*/
1111
class InformationOperation implements OperationInterface
1212
{
13-
private PackageInterface $package;
14-
private ?string $recipeRef = null;
15-
private ?string $version = null;
13+
private $package;
14+
private $recipeRef = null;
15+
private $version = null;
1616

1717
public function __construct(PackageInterface $package)
1818
{

src/Update/RecipePatch.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
class RecipePatch
1515
{
16-
private string $patch;
17-
private array $blobs;
16+
private $patch;
17+
private $blobs;
1818

1919
public function __construct(string $patch, array $blobs)
2020
{

src/Update/RecipePatcher.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
class RecipePatcher
2020
{
21-
private string $rootDir;
22-
private Filesystem $filesystem;
23-
private IOInterface $io;
24-
private ProcessExecutor $processExecutor;
21+
private $rootDir;
22+
private $filesystem;
23+
private $io;
24+
private $processExecutor;
2525

2626
public function __construct(string $rootDir, IOInterface $io)
2727
{

src/Update/RecipeUpdate.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@
1616

1717
class RecipeUpdate
1818
{
19-
private Recipe $originalRecipe;
20-
private Recipe $newRecipe;
21-
private Lock $lock;
22-
private string $rootDir;
19+
private $originalRecipe;
20+
private $newRecipe;
21+
private $lock;
22+
private $rootDir;
2323

2424
/** @var string[] */
25-
private array $originalRecipeFiles = [];
25+
private $originalRecipeFiles = [];
2626
/** @var string[] */
27-
private array $newRecipeFiles = [];
28-
private array $copyFromPackagePaths = [];
27+
private $newRecipeFiles = [];
28+
private $copyFromPackagePaths = [];
2929

3030
public function __construct(Recipe $originalRecipe, Recipe $newRecipe, Lock $lock, string $rootDir)
3131
{

tests/Configurator/ComposerScriptsConfiguratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ public function testUpdate()
158158
$configurator->update(
159159
$recipeUpdate,
160160
['cache:clear' => 'symfony-cmd'],
161-
['cache:clear' => 'other-cmd', 'do:cool-stuff' => 'symfony-cmd'],
161+
['cache:clear' => 'other-cmd', 'do:cool-stuff' => 'symfony-cmd']
162162
);
163163

164164
$this->assertSame(['composer.json' => <<<EOF

tests/Configurator/ContainerConfiguratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ public function testUpdate()
327327
$configurator->update(
328328
$recipeUpdate,
329329
['locale' => 'en', 'foobar' => 'baz'],
330-
['locale' => 'fr', 'foobar' => 'baz', 'new_one' => 'hallo'],
330+
['locale' => 'fr', 'foobar' => 'baz', 'new_one' => 'hallo']
331331
);
332332

333333
$this->assertSame(['config/services.yaml' => <<<EOF

tests/Configurator/CopyDirectoryFromPackageConfiguratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function testUpdate()
125125
$configurator->update(
126126
$recipeUpdate,
127127
['package/files1/' => 'target/files1/', 'package/files2/' => 'target/files2/'],
128-
['package/files1/' => 'target/files1/', 'package/files3/' => 'target/files3/'],
128+
['package/files1/' => 'target/files1/', 'package/files3/' => 'target/files3/']
129129
);
130130

131131
// original files always show as empty: we don't know what they are

tests/Configurator/DockerComposeConfiguratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -729,7 +729,7 @@ public function testUpdate()
729729
'MY_DATABASE:',
730730
],
731731
],
732-
],
732+
]
733733
);
734734

735735
$this->assertSame(['docker-compose.yml' => <<<EOF

tests/Configurator/DockerfileConfiguratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ public function testUpdate()
228228
$configurator->update(
229229
$recipeUpdate,
230230
['RUN docker-php-ext-install pdo_dummyv1'],
231-
['RUN docker-php-ext-install pdo_dummyv2'],
231+
['RUN docker-php-ext-install pdo_dummyv2']
232232
);
233233

234234
$this->assertSame(['Dockerfile' => <<<EOF

tests/Configurator/EnvConfiguratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ public function testUpdate()
381381
$recipeUpdate,
382382
// %generate(secret)% should not regenerate a new value
383383
['APP_ENV' => 'original', 'APP_SECRET' => '%generate(secret)%', 'APP_DEBUG' => 0, 'EXTRA_VAR' => 'apple'],
384-
['APP_ENV' => 'updated', 'APP_SECRET' => '%generate(secret)%', 'APP_DEBUG' => 0, 'NEW_VAR' => 'orange'],
384+
['APP_ENV' => 'updated', 'APP_SECRET' => '%generate(secret)%', 'APP_DEBUG' => 0, 'NEW_VAR' => 'orange']
385385
);
386386

387387
$this->assertSame(['.env' => <<<EOF

tests/Configurator/GitignoreConfiguratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ public function testUpdate()
180180
$configurator->update(
181181
$recipeUpdate,
182182
['/.env.local', '/.env.local.php', '/.env.*.local', '/vendor/'],
183-
['/.env.LOCAL', '/.env.LOCAL.php', '/.env.*.LOCAL', '/%VAR_DIR%/'],
183+
['/.env.LOCAL', '/.env.LOCAL.php', '/.env.*.LOCAL', '/%VAR_DIR%/']
184184
);
185185

186186
$this->assertSame(['.gitignore' => <<<EOF

tests/Configurator/MakefileConfiguratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public function testUpdate()
188188
'ifndef CONSOLE',
189189
' @printf "Run composer require cli to install the Symfony console."',
190190
'endif',
191-
],
191+
]
192192
);
193193

194194
$this->assertSame(['Makefile' => <<<EOF

tests/Update/RecipeUpdateTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ class RecipeUpdateTest extends TestCase
2020
{
2121
private $originalRecipe;
2222
private $newRecipe;
23-
private Lock $lock;
24-
private string $rootDir;
25-
private RecipeUpdate $update;
23+
private $lock;
24+
private $rootDir;
25+
private $update;
2626

2727
protected function setUp(): void
2828
{

0 commit comments

Comments
 (0)