Skip to content

Commit

Permalink
style: 💄
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcFRICOU committed Oct 21, 2015
1 parent e0d8c7d commit 11d9443
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Command/Scan.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Iadvize\SwaggerizeFastRoute\Command;

use Iadvize\SwaggerizeFastRoute\OperationParser\LumenControllerOperationParser;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -54,7 +55,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$routeStream = 'php://output';
}

$operationParser = new \Iadvize\SwaggerizeFastRoute\OperationParser\LumenControllerOperationParser($controllerNamespace);
$operationParser = new LumenControllerOperationParser($controllerNamespace);

$routes = \Iadvize\SwaggerizeFastRoute\scan($swaggerFile, $operationParser);

Expand Down
6 changes: 3 additions & 3 deletions src/OperationParser/LumenControllerOperationParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public function getHandler(OperationReference $operation)
$paths = explode('/', $path);
// path start with a /
unset($paths[0]);
foreach ($paths as &$path) {
$path[0] = strtoupper($path[0]);
}
$paths = array_map(function ($path) {
return ucfirst($path);
}, $paths);
// path to 'relative' namespace
$path = implode('\\', $paths);

Expand Down
4 changes: 4 additions & 0 deletions src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ function addRoutes($swaggerJson, RouteCollector $routeCollector, OperationParser
*/
function cacheRoutes(array $routes, $stream)
{
if (is_writable($stream)) {
throw new \LogicException($stream . ' is not writable');
}

$routeResource = fopen($stream, 'w');

$serializedRoutes = var_export($routes, true);
Expand Down

0 comments on commit 11d9443

Please sign in to comment.