Skip to content

Commit

Permalink
Removed iterable for compatibility with HHVM
Browse files Browse the repository at this point in the history
  • Loading branch information
Vincent Lechemin committed Aug 28, 2017
1 parent 97a37ce commit a38ed69
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions src/Configurator/BundlesConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function unconfigure(Recipe $recipe, $bundles): void
$this->dump($file, $registered);
}

private function parse(iterable $manifest, iterable $registered): iterable
private function parse($manifest, $registered)
{
$bundles = [];
foreach ($manifest as $class => $envs) {
Expand All @@ -65,7 +65,7 @@ private function parse(iterable $manifest, iterable $registered): iterable
return $bundles;
}

private function load(string $file): iterable
private function load(string $file)
{
$bundles = file_exists($file) ? (require $file) : [];
if (!is_array($bundles)) {
Expand All @@ -75,7 +75,7 @@ private function load(string $file): iterable
return $bundles;
}

private function dump(string $file, iterable $bundles): void
private function dump(string $file, $bundles): void
{
$contents = "<?php\n\nreturn [\n";
foreach ($bundles as $class => $envs) {
Expand Down
2 changes: 1 addition & 1 deletion src/Configurator/ContainerConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function unconfigure(Recipe $recipe, $parameters): void
file_put_contents($target, implode('', $lines));
}

private function addParameters(iterable $parameters): void
private function addParameters($parameters): void
{
$target = getcwd().'/config/services.yaml';
$lines = [];
Expand Down
4 changes: 2 additions & 2 deletions src/Configurator/CopyFromPackageConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function unconfigure(Recipe $recipe, $config): void
$this->removeFiles($config, $packageDir, getcwd());
}

private function copyFiles(iterable $manifest, string $from, string $to): void
private function copyFiles($manifest, string $from, string $to): void
{
foreach ($manifest as $source => $target) {
$target = $this->options->expandTargetDir($target);
Expand All @@ -50,7 +50,7 @@ private function copyFiles(iterable $manifest, string $from, string $to): void
}
}

private function removeFiles(iterable $manifest, string $from, string $to): void
private function removeFiles($manifest, string $from, string $to): void
{
foreach ($manifest as $source => $target) {
$target = $this->options->expandTargetDir($target);
Expand Down
6 changes: 3 additions & 3 deletions src/Configurator/CopyFromRecipeConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function unconfigure(Recipe $recipe, $config): void
$this->removeFiles($config, $recipe->getFiles(), getcwd());
}

private function copyFiles(iterable $manifest, iterable $files, string $to): void
private function copyFiles($manifest, $files, string $to): void
{
foreach ($manifest as $source => $target) {
$target = $this->options->expandTargetDir($target);
Expand All @@ -42,7 +42,7 @@ private function copyFiles(iterable $manifest, iterable $files, string $to): voi
}
}

private function copyDir(string $source, string $target, iterable $files): void
private function copyDir(string $source, string $target, $files): void
{
foreach ($files as $file => $data) {
if (0 === strpos($file, $source)) {
Expand All @@ -68,7 +68,7 @@ private function copyFile(string $to, string $contents, bool $executable): void
}
}

private function removeFiles(iterable $manifest, iterable $files, string $to): void
private function removeFiles($manifest, $files, string $to): void
{
foreach ($manifest as $source => $target) {
$target = $this->options->expandTargetDir($target);
Expand Down
4 changes: 2 additions & 2 deletions src/Downloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function get(string $path, array $headers = [], $cache = true): Response
}
}

private function fetchFile(string $url, string $cacheKey, iterable $headers): Response
private function fetchFile(string $url, string $cacheKey, $headers): Response
{
$options = $this->getOptions($headers);
$retries = 3;
Expand Down Expand Up @@ -204,7 +204,7 @@ private function fetchFile(string $url, string $cacheKey, iterable $headers): Re
}
}

private function fetchFileIfLastModified(string $url, string $cacheKey, string $lastModifiedTime, iterable $headers): Response
private function fetchFileIfLastModified(string $url, string $cacheKey, string $lastModifiedTime, $headers): Response
{
$headers[] = 'If-Modified-Since: '.$lastModifiedTime;
$options = $this->getOptions($headers);
Expand Down
2 changes: 1 addition & 1 deletion src/Recipe.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function getManifest(): array
return $this->data['manifest'];
}

public function getFiles(): iterable
public function getFiles()
{
return $this->data['files'] ?? [];
}
Expand Down
6 changes: 3 additions & 3 deletions src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Response implements \JsonSerializable
/**
* @param mixed $body The response as JSON
*/
public function __construct($body, iterable $headers = [], int $code = 200)
public function __construct($body, $headers = [], int $code = 200)
{
$this->body = $body;
$this->origHeaders = $headers;
Expand Down Expand Up @@ -52,7 +52,7 @@ public function getBody()
return $this->body;
}

public function getOrigHeaders(): iterable
public function getOrigHeaders()
{
return $this->origHeaders;
}
Expand All @@ -74,7 +74,7 @@ public function jsonSerialize()
return ['body' => $this->body, 'headers' => $this->headers];
}

private function parseHeaders(iterable $headers): array
private function parseHeaders($headers): array
{
$values = [];
foreach (array_reverse($headers) as $header) {
Expand Down

0 comments on commit a38ed69

Please sign in to comment.