Skip to content

Commit

Permalink
Merge pull request #31 from mpociot/analysis-qo72jZ
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
mpociot committed Jun 6, 2016
2 parents b8b6557 + cbcad1e commit 56a9760
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Mpociot/ApiDoc/Commands/GenerateDocumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,11 @@ private function processDingoRoutes(AbstractGenerator $generator, $allowedRoutes

/**
* @param $route
*
* @return bool
*/
private function isValidRoute($route)
{
return !is_callable($route->getAction()['uses']);
return ! is_callable($route->getAction()['uses']);
}
}
8 changes: 5 additions & 3 deletions tests/GenerateDocumentationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Mpociot\ApiDoc\ApiDocGeneratorServiceProvider;
use Mpociot\ApiDoc\Generators\LaravelGenerator;
use Orchestra\Testbench\TestCase;
use Mpociot\ApiDoc\Tests\Fixtures\TestRequest;
use Mpociot\ApiDoc\Tests\Fixtures\TestController;
use Illuminate\Support\Facades\Route as RouteFacade;

Expand All @@ -30,6 +29,7 @@ public function setUp()

/**
* @param \Illuminate\Foundation\Application $app
*
* @return array
*/
protected function getPackageProviders($app)
Expand All @@ -45,13 +45,13 @@ public function testConsoleCommandNeedsAPrefixOrRoute()

public function testConsoleCommandDoesNotWorkWithClosure()
{
RouteFacade::get('/api/closure', function(){
RouteFacade::get('/api/closure', function () {
return 'foo';
});
RouteFacade::get('/api/test', TestController::class.'@parseMethodDescription');

$output = $this->artisan('api:generate', [
'--routePrefix' => 'api/*'
'--routePrefix' => 'api/*',
]);
$this->assertContains('Skipping route: api/closure - contains closure.', $output);
$this->assertContains('Processed route: api/test', $output);
Expand All @@ -60,11 +60,13 @@ public function testConsoleCommandDoesNotWorkWithClosure()
/**
* @param string $command
* @param array $parameters
*
* @return mixed
*/
public function artisan($command, $parameters = [])
{
$this->app[Kernel::class]->call($command, $parameters);

return $this->app[Kernel::class]->output();
}
}

0 comments on commit 56a9760

Please sign in to comment.