Skip to content

Commit 57e6b5d

Browse files
committed
Refactoring code to be php 7.1 compatible
1 parent 342d28c commit 57e6b5d

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

0 commit comments

Comments
 (0)