diff --git a/composer.lock b/composer.lock index bbe420f..29443a3 100644 --- a/composer.lock +++ b/composer.lock @@ -1,10 +1,11 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "e48732e2c3ded567221a09c6a80e9c93", + "hash": "494a8cca7c8b86d1ad9c114e8a6c6dd5", + "content-hash": "a970e7e763685cb49daabb8503435980", "packages": [ { "name": "egeloen/http-adapter", @@ -82,6 +83,7 @@ "http-client", "psr-7" ], + "abandoned": "php-http/httplug", "time": "2015-08-12 09:35:40" }, { @@ -272,20 +274,20 @@ }, { "name": "rybakit/arguments-resolver", - "version": "dev-master", + "version": "v0.5.0", "source": { "type": "git", "url": "https://github.com/rybakit/arguments-resolver.git", - "reference": "edabcaeba6ff23e03308a80d36edd18721ceb601" + "reference": "a494ec543c6af664b4f46d749fa69dfc692fe91f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rybakit/arguments-resolver/zipball/edabcaeba6ff23e03308a80d36edd18721ceb601", - "reference": "edabcaeba6ff23e03308a80d36edd18721ceb601", + "url": "https://api.github.com/repos/rybakit/arguments-resolver/zipball/a494ec543c6af664b4f46d749fa69dfc692fe91f", + "reference": "a494ec543c6af664b4f46d749fa69dfc692fe91f", "shasum": "" }, "require": { - "php": ">=5.4.0" + "php": "^5.4|^7.0" }, "type": "library", "extra": { @@ -321,29 +323,30 @@ "reflection", "resolver" ], - "time": "2015-09-21 08:22:23" + "time": "2015-12-29 10:59:41" }, { "name": "symfony/console", - "version": "v2.7.7", + "version": "v3.0.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "16bb1cb86df43c90931df65f529e7ebd79636750" + "reference": "2ed5e2706ce92313d120b8fe50d1063bcfd12e04" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/16bb1cb86df43c90931df65f529e7ebd79636750", - "reference": "16bb1cb86df43c90931df65f529e7ebd79636750", + "url": "https://api.github.com/repos/symfony/console/zipball/2ed5e2706ce92313d120b8fe50d1063bcfd12e04", + "reference": "2ed5e2706ce92313d120b8fe50d1063bcfd12e04", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9", + "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { "psr/log": "~1.0", - "symfony/event-dispatcher": "~2.1", - "symfony/process": "~2.1" + "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/process": "~2.8|~3.0" }, "suggest": { "psr/log": "For using the console logger", @@ -353,7 +356,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -380,31 +383,31 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2015-11-18 09:54:26" + "time": "2016-02-28 16:24:34" }, { "name": "symfony/event-dispatcher", - "version": "v2.7.7", + "version": "v3.0.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "7e2f9c31645680026c2372edf66f863fc7757af5" + "reference": "4dd5df31a28c0f82b41cb1e1599b74b5dcdbdafa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7e2f9c31645680026c2372edf66f863fc7757af5", - "reference": "7e2f9c31645680026c2372edf66f863fc7757af5", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/4dd5df31a28c0f82b41cb1e1599b74b5dcdbdafa", + "reference": "4dd5df31a28c0f82b41cb1e1599b74b5dcdbdafa", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "require-dev": { "psr/log": "~1.0", - "symfony/config": "~2.0,>=2.0.5", - "symfony/dependency-injection": "~2.6", - "symfony/expression-language": "~2.6", - "symfony/stopwatch": "~2.3" + "symfony/config": "~2.8|~3.0", + "symfony/dependency-injection": "~2.8|~3.0", + "symfony/expression-language": "~2.8|~3.0", + "symfony/stopwatch": "~2.8|~3.0" }, "suggest": { "symfony/dependency-injection": "", @@ -413,7 +416,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -440,24 +443,83 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2015-10-30 20:10:21" + "time": "2016-01-27 05:14:46" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.1.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "1289d16209491b584839022f29257ad859b8532d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/1289d16209491b584839022f29257ad859b8532d", + "reference": "1289d16209491b584839022f29257ad859b8532d", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.1-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "time": "2016-01-20 09:13:37" }, { "name": "zendframework/zend-diactoros", - "version": "1.2.0", + "version": "1.3.5", "source": { "type": "git", "url": "https://github.com/zendframework/zend-diactoros.git", - "reference": "edfda00b9831630c19c411f85f50a47bb66af457" + "reference": "b1d59735b672865dbeb930805029c24f226e3e77" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/edfda00b9831630c19c411f85f50a47bb66af457", - "reference": "edfda00b9831630c19c411f85f50a47bb66af457", + "url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/b1d59735b672865dbeb930805029c24f226e3e77", + "reference": "b1d59735b672865dbeb930805029c24f226e3e77", "shasum": "" }, "require": { - "php": ">=5.4", + "php": "^5.4 || ^7.0", "psr/http-message": "~1.0" }, "provide": { @@ -470,8 +532,8 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2-dev", - "dev-develop": "1.3-dev" + "dev-master": "1.3-dev", + "dev-develop": "1.4-dev" } }, "autoload": { @@ -490,7 +552,7 @@ "psr", "psr-7" ], - "time": "2015-11-24 19:16:22" + "time": "2016-03-17 18:02:05" } ], "packages-dev": [ @@ -630,16 +692,16 @@ }, { "name": "phpspec/phpspec", - "version": "2.4.0", + "version": "2.5.0", "source": { "type": "git", "url": "https://github.com/phpspec/phpspec.git", - "reference": "1d3938e6d9ffb1bd4805ea8ddac62ea48767f358" + "reference": "385ecb015e97c13818074f1517928b24d4a26067" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/phpspec/zipball/1d3938e6d9ffb1bd4805ea8ddac62ea48767f358", - "reference": "1d3938e6d9ffb1bd4805ea8ddac62ea48767f358", + "url": "https://api.github.com/repos/phpspec/phpspec/zipball/385ecb015e97c13818074f1517928b24d4a26067", + "reference": "385ecb015e97c13818074f1517928b24d4a26067", "shasum": "" }, "require": { @@ -704,26 +766,28 @@ "testing", "tests" ], - "time": "2015-11-29 02:03:49" + "time": "2016-03-20 20:34:32" }, { "name": "phpspec/prophecy", - "version": "v1.5.0", + "version": "v1.6.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7" + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4745ded9307786b730d7a60df5cb5a6c43cf95f7", - "reference": "4745ded9307786b730d7a60df5cb5a6c43cf95f7", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/3c91bdf81797d725b14cb62906f9a4ce44235972", + "reference": "3c91bdf81797d725b14cb62906f9a4ce44235972", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", + "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "~2.0", - "sebastian/comparator": "~1.1" + "sebastian/comparator": "~1.1", + "sebastian/recursion-context": "~1.0" }, "require-dev": { "phpspec/phpspec": "~2.0" @@ -731,7 +795,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "1.5.x-dev" } }, "autoload": { @@ -764,7 +828,7 @@ "spy", "stub" ], - "time": "2015-08-13 10:07:40" + "time": "2016-02-15 07:46:21" }, { "name": "sebastian/comparator", @@ -832,28 +896,28 @@ }, { "name": "sebastian/diff", - "version": "1.3.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3" + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/863df9687835c62aa423a22412d26fa2ebde3fd3", - "reference": "863df9687835c62aa423a22412d26fa2ebde3fd3", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/13edfd8706462032c2f52b4b862974dd46b71c9e", + "reference": "13edfd8706462032c2f52b4b862974dd46b71c9e", "shasum": "" }, "require": { "php": ">=5.3.3" }, "require-dev": { - "phpunit/phpunit": "~4.2" + "phpunit/phpunit": "~4.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -876,11 +940,11 @@ } ], "description": "Diff implementation", - "homepage": "http://www.github.com/sebastianbergmann/diff", + "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ "diff" ], - "time": "2015-02-22 15:13:53" + "time": "2015-12-08 07:14:41" }, { "name": "sebastian/exporter", @@ -950,16 +1014,16 @@ }, { "name": "sebastian/recursion-context", - "version": "1.0.1", + "version": "1.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba" + "reference": "913401df809e99e4f47b27cdd781f4a258d58791" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/994d4a811bafe801fb06dccbee797863ba2792ba", - "reference": "994d4a811bafe801fb06dccbee797863ba2792ba", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/913401df809e99e4f47b27cdd781f4a258d58791", + "reference": "913401df809e99e4f47b27cdd781f4a258d58791", "shasum": "" }, "require": { @@ -999,29 +1063,29 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2015-06-21 08:04:50" + "time": "2015-11-11 19:50:13" }, { "name": "symfony/finder", - "version": "v2.7.7", + "version": "v3.0.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "a06a0c0ff7db3736a50d530c908cca547bf13da9" + "reference": "623bda0abd9aa29e529c8e9c08b3b84171914723" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/a06a0c0ff7db3736a50d530c908cca547bf13da9", - "reference": "a06a0c0ff7db3736a50d530c908cca547bf13da9", + "url": "https://api.github.com/repos/symfony/finder/zipball/623bda0abd9aa29e529c8e9c08b3b84171914723", + "reference": "623bda0abd9aa29e529c8e9c08b3b84171914723", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1048,29 +1112,29 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2015-10-30 20:10:21" + "time": "2016-01-27 05:14:46" }, { "name": "symfony/process", - "version": "v2.7.7", + "version": "v3.0.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "f6290983c8725d0afa29bdc3e5295879de3e58f5" + "reference": "dfecef47506179db2501430e732adbf3793099c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/f6290983c8725d0afa29bdc3e5295879de3e58f5", - "reference": "f6290983c8725d0afa29bdc3e5295879de3e58f5", + "url": "https://api.github.com/repos/symfony/process/zipball/dfecef47506179db2501430e732adbf3793099c8", + "reference": "dfecef47506179db2501430e732adbf3793099c8", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1097,29 +1161,29 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2015-11-19 16:11:24" + "time": "2016-02-02 13:44:19" }, { "name": "symfony/yaml", - "version": "v2.7.7", + "version": "v3.0.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "4cfcd7a9fceba662b3c036b7d9a91f6197af046c" + "reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/4cfcd7a9fceba662b3c036b7d9a91f6197af046c", - "reference": "4cfcd7a9fceba662b3c036b7d9a91f6197af046c", + "url": "https://api.github.com/repos/symfony/yaml/zipball/b5ba64cd67ecd6887f63868fa781ca094bd1377c", + "reference": "b5ba64cd67ecd6887f63868fa781ca094bd1377c", "shasum": "" }, "require": { - "php": ">=5.3.9" + "php": ">=5.5.9" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -1146,14 +1210,12 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2015-11-18 13:41:01" + "time": "2016-02-23 15:16:06" } ], "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "rybakit/arguments-resolver": 20 - }, + "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/spec/Console/CommandFactorySpec.php b/spec/Console/CommandFactorySpec.php index 5a9a2e5..6c2ae66 100644 --- a/spec/Console/CommandFactorySpec.php +++ b/spec/Console/CommandFactorySpec.php @@ -136,7 +136,7 @@ public function getMatchers() 'onlyContainCommandInstances' => function ($subject) { foreach ($subject as $command) { if (!$command instanceof Command) { - throw new FailureException('"'.get_class($command).'" is not a subtype of Symfony\Component\Console\Command\Command'); + throw new FailureException('"' . get_class($command) . '" is not a subtype of Symfony\Component\Console\Command\Command'); } } diff --git a/spec/Output/ProjectsSpec.php b/spec/Output/ProjectsSpec.php index ab1b683..072b43c 100644 --- a/spec/Output/ProjectsSpec.php +++ b/spec/Output/ProjectsSpec.php @@ -152,7 +152,7 @@ private function defaultOutput($method) 'version_current' => '2.5.0', 'version_requested' => '2.5.0', 'licenses' => [['name' => 'MIT']], - 'security_vulnerabilities' => [['cve' => 'lolcat']], + 'security_vulnerabilities' => [['cve' => 'lolcat']], ]], ]); diff --git a/src/Api/BaseApi.php b/src/Api/BaseApi.php index 8e13ae6..4040814 100644 --- a/src/Api/BaseApi.php +++ b/src/Api/BaseApi.php @@ -25,7 +25,7 @@ abstract class BaseApi public function __construct(HttpClient $client, $token = null) { $this->client = $client; - $this->token = $token; + $this->token = $token; } /** @@ -78,7 +78,7 @@ protected function transform($name) private function sanitizeQuery($query) { $parts = parse_url($query); - $path = $parts['path']; + $path = $parts['path']; if (!isset($parts['query'])) { return $query; @@ -101,7 +101,7 @@ private function sanitizeQuery($query) } } - return $path.'?'.http_build_query($final); + return $path . '?' . http_build_query($final); } /** diff --git a/src/Api/Github.php b/src/Api/Github.php index 7ddc287..4c6f2fa 100644 --- a/src/Api/Github.php +++ b/src/Api/Github.php @@ -48,7 +48,7 @@ public function sync() */ public function show($repository) { - return $this->request('github/'.$this->transform($repository)); + return $this->request('github/' . $this->transform($repository)); } /** diff --git a/src/Api/Projects.php b/src/Api/Projects.php index b73504f..8e3ff9e 100644 --- a/src/Api/Projects.php +++ b/src/Api/Projects.php @@ -30,7 +30,7 @@ public function all() */ public function show($project) { - return $this->request('projects/'.$project); + return $this->request('projects/' . $project); } /** @@ -42,7 +42,7 @@ public function show($project) */ public function delete($project) { - return $this->request('projects/'.$project, 'DELETE'); + return $this->request('projects/' . $project, 'DELETE'); } /** @@ -67,7 +67,7 @@ public function create($file) */ public function update($project, $file) { - return $this->request('projects/'.$project, 'POST', ['project_file' => $file]); + return $this->request('projects/' . $project, 'POST', ['project_file' => $file]); } /** diff --git a/src/Api/Users.php b/src/Api/Users.php index c185d87..bbcb3be 100644 --- a/src/Api/Users.php +++ b/src/Api/Users.php @@ -20,7 +20,7 @@ class Users extends BaseApi implements Api */ public function show($username) { - return $this->request('users/'.$username); + return $this->request('users/' . $username); } /** diff --git a/src/Authentication/RubyConfigFileToken.php b/src/Authentication/RubyConfigFileToken.php index cb185d6..004ae43 100644 --- a/src/Authentication/RubyConfigFileToken.php +++ b/src/Authentication/RubyConfigFileToken.php @@ -17,7 +17,7 @@ class RubyConfigFileToken implements Token public function __construct($file = null) { if (null === $file) { - $file = $_SERVER['HOME'].DIRECTORY_SEPARATOR.'.veye.rc'; + $file = $_SERVER['HOME'] . DIRECTORY_SEPARATOR . '.veye.rc'; } $this->file = $file; diff --git a/src/Client.php b/src/Client.php index 9d880f6..1da33a1 100644 --- a/src/Client.php +++ b/src/Client.php @@ -46,12 +46,12 @@ public function __construct(HttpClient $client = null, $url = 'https://www.versi */ public function api($name) { - $class = 'Rs\\VersionEye\\Api\\'.ucfirst($name); + $class = 'Rs\\VersionEye\\Api\\' . ucfirst($name); if (class_exists($class)) { return new $class($this->client, $this->token); } else { - throw new \InvalidArgumentException('unknown api "'.$name.'" requested'); + throw new \InvalidArgumentException('unknown api "' . $name . '" requested'); } } diff --git a/src/Console/CommandFactory.php b/src/Console/CommandFactory.php index fe76057..763a88d 100644 --- a/src/Console/CommandFactory.php +++ b/src/Console/CommandFactory.php @@ -35,7 +35,7 @@ class CommandFactory public function __construct(Token $token, CaseTransformerInterface $transformer) { $this->transformer = $transformer; - $this->token = $token; + $this->token = $token; } /** @@ -47,8 +47,8 @@ public function __construct(Token $token, CaseTransformerInterface $transformer) */ public function generateCommands(array $classes = []) { - $classes = $this->readApis($classes); - $token = $this->token->read(); + $classes = $this->readApis($classes); + $token = $this->token->read(); $commands = []; foreach ($classes as $class) { @@ -56,7 +56,7 @@ public function generateCommands(array $classes = []) foreach ($api->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) { if (0 !== strpos($method->getName(), '__')) { //skip magics - $command = $this->generateCommand($api->getShortName(), $method, $token); + $command = $this->generateCommand($api->getShortName(), $method, $token); $commands[$command->getName()] = $command; } } @@ -78,7 +78,7 @@ private function generateCommand($name, \ReflectionMethod $method, $token = null { $methodName = $this->transformer->transform($method->getName()); - $command = new Command(strtolower($name.':'.$methodName)); + $command = new Command(strtolower($name . ':' . $methodName)); $docBlock = new DocBlock($method->getDocComment()); $command->setDefinition($this->buildDefinition($method, $token)); @@ -133,9 +133,9 @@ private function createCode($name, \ReflectionMethod $method) $client->authorize($input->getOption('token')); } - $methodName = $method->getName(); - $api = $client->api(strtolower($name)); - $args = (new NamedArgumentsResolver($method))->resolve(array_merge($input->getOptions(), $input->getArguments())); + $methodName = $method->getName(); + $api = $client->api(strtolower($name)); + $args = (new NamedArgumentsResolver($method))->resolve(array_merge($input->getOptions(), $input->getArguments())); $outputClass = $this->generateOutputClassFromApiClass($api); $response = call_user_func_array([$api, $methodName], $args); @@ -181,9 +181,9 @@ private function readApis(array $classes = []) private function generateOutputClassFromApiClass(Api $api) { $classParts = explode('\\', get_class($api)); - $apiName = array_pop($classParts); + $apiName = array_pop($classParts); array_pop($classParts); - return implode('\\', $classParts).'\\Output\\'.$apiName; + return implode('\\', $classParts) . '\\Output\\' . $apiName; } } diff --git a/src/Http/IvoryHttpAdapterClient.php b/src/Http/IvoryHttpAdapterClient.php index 7b1679a..8c74ac6 100644 --- a/src/Http/IvoryHttpAdapterClient.php +++ b/src/Http/IvoryHttpAdapterClient.php @@ -26,7 +26,7 @@ class IvoryHttpAdapterClient implements HttpClient public function __construct(HttpAdapterInterface $adapter, $url) { $this->adapter = $adapter; - $this->url = $url; + $this->url = $url; } /** @@ -37,7 +37,7 @@ public function request($method, $url, array $params = []) list($params, $files) = $this->fixParams($params); try { - $response = $this->adapter->send($this->url.$url, $method, [], $params, $files); + $response = $this->adapter->send($this->url . $url, $method, [], $params, $files); return json_decode($response->getBody(), true); } catch (HttpAdapterException $e) { @@ -55,7 +55,7 @@ public function request($method, $url, array $params = []) private function fixParams(array $params) { $parameters = []; - $files = []; + $files = []; foreach ($params as $name => $value) { if (is_readable($value)) { //file @@ -77,9 +77,9 @@ private function fixParams(array $params) */ private function buildRequestError(HttpAdapterException $e) { - $data = $e->getResponse() ? json_decode($e->getResponse()->getBody(), true) : ['error' => $e->getMessage()]; + $data = $e->getResponse() ? json_decode($e->getResponse()->getBody(), true) : ['error' => $e->getMessage()]; $message = isset($data['error']) ? $data['error'] : 'Server Error'; - $status = $e->getResponse() ? $e->getResponse()->getStatusCode() : 500; + $status = $e->getResponse() ? $e->getResponse()->getStatusCode() : 500; return new CommunicationException(sprintf('%s : %s', $status, $message)); } diff --git a/src/Http/Pager.php b/src/Http/Pager.php index 6d61ce8..7bac261 100644 --- a/src/Http/Pager.php +++ b/src/Http/Pager.php @@ -9,10 +9,10 @@ */ class Pager implements \Iterator { - private $offset = 0; + private $offset = 0; private $current = 1; - private $max = 0; - private $result = []; + private $max = 0; + private $result = []; /** * @var HttpClient @@ -34,13 +34,13 @@ class Pager implements \Iterator public function __construct(array $result, $key, HttpClient $client, $method, $url, array $params = []) { $this->current = $result['paging']['current_page']; - $this->max = $result['paging']['total_entries']; - $this->result = $result[$key]; + $this->max = $result['paging']['total_entries']; + $this->result = $result[$key]; - $this->key = $key; + $this->key = $key; $this->client = $client; $this->method = $method; - $this->url = $url; + $this->url = $url; $this->params = $params; } @@ -75,7 +75,7 @@ public function valid() { if (!isset($this->result[$this->offset]) && $this->offset < $this->max) { ++$this->current; - $url = preg_replace('/page=[0-9]+/', 'page='.$this->current, $this->url); + $url = preg_replace('/page=[0-9]+/', 'page=' . $this->current, $this->url); $result = $this->client->request($this->method, $url, $this->params); $this->result = array_merge($this->result, $result[$this->key]); diff --git a/src/Output/BaseOutput.php b/src/Output/BaseOutput.php index 9b8a064..150a376 100644 --- a/src/Output/BaseOutput.php +++ b/src/Output/BaseOutput.php @@ -54,9 +54,9 @@ protected function printTable(OutputInterface $output, array $headings, array $k protected function printBoolean(OutputInterface $output, $success, $fail, $value, $line = true) { if ($value) { - $message = ''.$success.''; + $message = '' . $success . ''; } else { - $message = ''.$fail.''; + $message = '' . $fail . ''; } if (false === $line) { @@ -78,7 +78,7 @@ protected function printBoolean(OutputInterface $output, $success, $fail, $value protected function printList(OutputInterface $output, array $headings, array $keys, array $data, \Closure $callback = null) { $width = $this->getColumnWidth($headings); - $data = array_merge(array_flip($keys), array_intersect_key($data, array_flip($keys))); + $data = array_merge(array_flip($keys), array_intersect_key($data, array_flip($keys))); foreach ($headings as $key => $heading) { $value = array_values($data)[$key]; diff --git a/src/Output/Projects.php b/src/Output/Projects.php index d331792..6d2efee 100644 --- a/src/Output/Projects.php +++ b/src/Output/Projects.php @@ -50,7 +50,7 @@ public function licenses(OutputInterface $output, array $response) foreach ($response['licenses'] as $license => $projects) { foreach ($projects as $project) { - $name = $license === 'unknown' ? ''.$project['name'].'' : $project['name']; + $name = $license === 'unknown' ? '' . $project['name'] . '' : $project['name']; $license = $license === 'unknown' ? 'unknown' : $license; $table->addRow([$license, $name]);