Skip to content

Commit 3a3e4fa

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 77b02e9 + dc312a5 commit 3a3e4fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+800
-644
lines changed

.styleci.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
preset: recommended
1+
preset: laravel
22

33
linting: true
44

55
enabled:
6-
- logical_not_operators_with_successor_space
7-
8-
disabled:
9-
- align_double_arrow
10-
- new_with_braces
11-
- ordered_use
6+
- phpdoc_order
7+
- phpdoc_separation
8+
- unalign_double_arrow

.travis.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ env:
1313
global:
1414
- setup=basic
1515

16+
cache:
17+
directories:
18+
- $HOME/.composer/cache
19+
1620
matrix:
1721
include:
1822
- php: 5.5.9
@@ -21,9 +25,9 @@ matrix:
2125
env: setup=stable
2226

2327
install:
24-
- if [[ $setup = 'basic' ]]; then travis_retry composer install --no-interaction --prefer-dist; fi
25-
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable; fi
26-
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable; fi
28+
- if [[ $setup = 'basic' ]]; then travis_retry composer install --prefer-dist --no-interaction --no-suggest; fi
29+
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable; fi
30+
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --no-suggest --prefer-stable --prefer-lowest; fi
2731

2832
script:
2933
- vendor/bin/phpunit

composer.json

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,21 @@
1616
],
1717
"require": {
1818
"php": "^5.5.9 || ^7.0",
19-
"dingo/blueprint": "0.1.*",
19+
"dingo/blueprint": "0.2.*",
2020
"doctrine/annotations": "1.2.*",
21-
"illuminate/routing": "5.1.* || 5.2.*",
22-
"illuminate/support": "5.1.* || 5.2.*",
23-
"league/fractal": ">=0.12.0",
24-
"phpdocumentor/reflection-docblock": "2.0.*"
21+
"illuminate/routing": "5.1.* || 5.2.* || 5.3.*",
22+
"illuminate/support": "5.1.* || 5.2.* || 5.3.*",
23+
"league/fractal": ">=0.12.0"
2524
},
2625
"require-dev": {
27-
"illuminate/auth": "5.1.* || 5.2.*",
28-
"illuminate/cache": "5.1.* || 5.2.*",
29-
"illuminate/console": "5.1.* || 5.2.*",
30-
"illuminate/database": "5.1.* || 5.2.*",
31-
"illuminate/events": "5.1.* || 5.2.*",
32-
"illuminate/filesystem": "5.1.* || 5.2.*",
33-
"illuminate/log": "5.1.* || 5.2.*",
34-
"illuminate/pagination": "5.1.* || 5.2.*",
26+
"illuminate/auth": "5.1.* || 5.2.* || 5.3.*",
27+
"illuminate/cache": "5.1.* || 5.2.* || 5.3.*",
28+
"illuminate/console": "5.1.* || 5.2.* || 5.3.*",
29+
"illuminate/database": "5.1.* || 5.2.* || 5.3.*",
30+
"illuminate/events": "5.1.* || 5.2.* || 5.3.*",
31+
"illuminate/filesystem": "5.1.* || 5.2.* || 5.3.*",
32+
"illuminate/log": "5.1.* || 5.2.* || 5.3.*",
33+
"illuminate/pagination": "5.1.* || 5.2.* || 5.3.*",
3534
"laravel/lumen-framework": "5.1.* || 5.2.*",
3635
"lucadegasperi/oauth2-server-laravel": "5.0.*",
3736
"mockery/mockery": "~0.9",
@@ -41,7 +40,7 @@
4140
},
4241
"suggest": {
4342
"lucadegasperi/oauth2-server-laravel": "Protect your API with OAuth 2.0.",
44-
"tymon/jwt-auth": "Protect your API with JSON Web Tokens"
43+
"tymon/jwt-auth": "Protect your API with JSON Web Tokens."
4544
},
4645
"autoload": {
4746
"psr-4": {

config/api.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
34
return [
45

56
/*

src/Console/Command/Cache.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Illuminate\Console\Command;
66
use Illuminate\Filesystem\Filesystem;
7+
use Illuminate\Contracts\Console\Kernel;
78

89
class Cache extends Command
910
{
@@ -85,7 +86,7 @@ protected function getFreshApplication()
8586
{
8687
$app = require $this->laravel->basePath().'/bootstrap/app.php';
8788

88-
$app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
89+
$app->make(Kernel::class)->bootstrap();
8990

9091
return $app;
9192
}

src/Console/Command/Docs.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ class Docs extends Command
1919
*/
2020
protected $router;
2121

22+
/**
23+
* The blueprint instance.
24+
*
25+
* @var \Dingo\Blueprint\Blueprint
26+
*/
27+
protected $blueprint;
28+
2229
/**
2330
* Blueprint instance.
2431
*

src/Console/Command/Routes.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,15 @@ protected function getRoutes()
8686
foreach ($this->router->getRoutes() as $collection) {
8787
foreach ($collection->getRoutes() as $route) {
8888
$routes[] = $this->filterRoute([
89-
'host' => $route->domain(),
90-
'method' => implode('|', $route->methods()),
91-
'uri' => $route->uri(),
92-
'name' => $route->getName(),
93-
'action' => $route->getActionName(),
89+
'host' => $route->domain(),
90+
'method' => implode('|', $route->methods()),
91+
'uri' => $route->uri(),
92+
'name' => $route->getName(),
93+
'action' => $route->getActionName(),
9494
'protected' => $route->isProtected() ? 'Yes' : 'No',
95-
'versions' => implode(', ', $route->versions()),
96-
'scopes' => implode(', ', $route->scopes()),
97-
'rate' => $this->routeRateLimit($route),
95+
'versions' => implode(', ', $route->versions()),
96+
'scopes' => implode(', ', $route->scopes()),
97+
'rate' => $this->routeRateLimit($route),
9898
]);
9999
}
100100
}

src/Dispatcher.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public function json($content)
247247

248248
$this->content = $content;
249249

250-
return $this->header('content-type', 'application/json');
250+
return $this->header('Content-Type', 'application/json');
251251
}
252252

253253
/**
@@ -539,7 +539,7 @@ protected function dispatch(InternalRequest $request)
539539

540540
$response = $this->router->dispatch($request);
541541

542-
if (! $response->isSuccessful()) {
542+
if (! $response->isSuccessful() && ! $response->isRedirection()) {
543543
throw new InternalHttpException($response);
544544
} elseif (! $this->raw) {
545545
$response = $response->getOriginalContent();

src/Event/RequestWasMatched.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class RequestWasMatched
2424
/**
2525
* Create a new request was matched event.
2626
*
27-
* @param \Dingo\Api\Http\Request $response
28-
* @param \Illuminate\Contracts\Container\Container $content
27+
* @param \Dingo\Api\Http\Request $request
28+
* @param \Illuminate\Contracts\Container\Container $app
2929
*
3030
* @return void
3131
*/

src/Exception/Handler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Illuminate\Http\Response;
88
use Dingo\Api\Contract\Debug\ExceptionHandler;
99
use Dingo\Api\Contract\Debug\MessageBagErrors;
10+
use Symfony\Component\HttpFoundation\Response as BaseResponse;
1011
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
1112
use Illuminate\Contracts\Debug\ExceptionHandler as IlluminateExceptionHandler;
1213

@@ -132,7 +133,7 @@ public function handle(Exception $exception)
132133
}
133134

134135
if ($response = $handler($exception)) {
135-
if (! $response instanceof Response) {
136+
if (! $response instanceof BaseResponse) {
136137
$response = new Response($response, $this->getExceptionStatusCode($exception));
137138
}
138139

0 commit comments

Comments
 (0)