@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | * @param \Flugg\Responder\Resources\DataNormalizer $normalizer |
40 | 40 | * @param \Flugg\Responder\Contracts\Transformers\TransformerResolver $transformerResolver |
41 | 41 | */ |
42 | - public function __construct(DataNormalizer $normalizer, TransformerResolver $transformerResolver) |
|
42 | + public function __construct( DataNormalizer $normalizer, TransformerResolver $transformerResolver ) |
|
43 | 43 | { |
44 | 44 | $this->normalizer = $normalizer; |
45 | 45 | $this->transformerResolver = $transformerResolver; |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | * @param string|null $resourceKey |
54 | 54 | * @return \League\Fractal\Resource\ResourceInterface |
55 | 55 | */ |
56 | - public function make($data = null, $transformer = null, string $resourceKey = null): ResourceInterface |
|
56 | + public function make( $data = null, $transformer = null, string $resourceKey = null ): ResourceInterface |
|
57 | 57 | { |
58 | - if (is_null($data = $this->normalizer->normalize($data))) { |
|
59 | - return $this->instatiateResource($data); |
|
58 | + if ( is_null( $data = $this->normalizer->normalize( $data ) ) ) { |
|
59 | + return $this->instatiateResource( $data ); |
|
60 | 60 | } |
61 | 61 | |
62 | - $transformer = $this->resolveTransformer($data, $transformer); |
|
62 | + $transformer = $this->resolveTransformer( $data, $transformer ); |
|
63 | 63 | |
64 | - return $this->instatiateResource($data, $transformer, $resourceKey); |
|
64 | + return $this->instatiateResource( $data, $transformer, $resourceKey ); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -71,13 +71,13 @@ discard block |
||
71 | 71 | * @param \Flugg\Responder\Transformers\Transformer|string|callable|null $transformer |
72 | 72 | * @return \Flugg\Responder\Transformers\Transformer|callable |
73 | 73 | */ |
74 | - protected function resolveTransformer($data, $transformer) |
|
74 | + protected function resolveTransformer( $data, $transformer ) |
|
75 | 75 | { |
76 | - if (isset($transformer)) { |
|
77 | - return $this->transformerResolver->resolve($transformer); |
|
76 | + if ( isset($transformer) ) { |
|
77 | + return $this->transformerResolver->resolve( $transformer ); |
|
78 | 78 | } |
79 | 79 | |
80 | - return $this->transformerResolver->resolveFromData($data); |
|
80 | + return $this->transformerResolver->resolveFromData( $data ); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | * @param string|null $resourceKey |
89 | 89 | * @return \League\Fractal\Resource\ResourceInterface |
90 | 90 | */ |
91 | - protected function instatiateResource($data, $transformer = null, string $resourceKey = null): ResourceInterface |
|
91 | + protected function instatiateResource( $data, $transformer = null, string $resourceKey = null ): ResourceInterface |
|
92 | 92 | { |
93 | - if (is_null($data)) { |
|
93 | + if ( is_null( $data ) ) { |
|
94 | 94 | return new NullResource(); |
95 | - } elseif (is_iterable($data)) { |
|
96 | - return new CollectionResource($data, $transformer, $resourceKey); |
|
95 | + } elseif ( is_iterable( $data ) ) { |
|
96 | + return new CollectionResource( $data, $transformer, $resourceKey ); |
|
97 | 97 | } |
98 | 98 | |
99 | - return new ItemResource($data, $transformer, $resourceKey); |
|
99 | + return new ItemResource( $data, $transformer, $resourceKey ); |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | \ No newline at end of file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function getDefaultIncludes() |
32 | 32 | { |
33 | - return array_keys($this->with); |
|
33 | + return array_keys( $this->with ); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | /** |
@@ -41,10 +41,10 @@ discard block |
||
41 | 41 | * @param mixed $data |
42 | 42 | * @return \League\Fractal\Resource\ResourceInterface|false |
43 | 43 | */ |
44 | - protected function callIncludeMethod(Scope $scope, $relation, $data) |
|
44 | + protected function callIncludeMethod( Scope $scope, $relation, $data ) |
|
45 | 45 | { |
46 | - $parameters = $this->getScopedParameters($scope, $relation); |
|
47 | - $resource = $this->makeResource($relation, $data, $parameters); |
|
46 | + $parameters = $this->getScopedParameters( $scope, $relation ); |
|
47 | + $resource = $this->makeResource( $relation, $data, $parameters ); |
|
48 | 48 | |
49 | 49 | return $resource; |
50 | 50 | } |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | * |
17 | 17 | * @var string[] |
18 | 18 | */ |
19 | - protected $relations = ['*']; |
|
19 | + protected $relations = [ '*' ]; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * A list of autoloaded default relations. |
23 | 23 | * |
24 | 24 | * @var array |
25 | 25 | */ |
26 | - protected $load = []; |
|
26 | + protected $load = [ ]; |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Indicates if the transformer has whitelisted all relations. |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function allRelationsAllowed(): bool |
34 | 34 | { |
35 | - return $this->relations == ['*']; |
|
35 | + return $this->relations == [ '*' ]; |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | /** |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function getRelations(): array |
44 | 44 | { |
45 | - return array_filter($this->relations, function ($relation) { |
|
45 | + return array_filter( $this->relations, function ( $relation ) { |
|
46 | 46 | return $relation !== '*'; |
47 | 47 | }); |
48 | 48 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getDefaultRelations(): array |
56 | 56 | { |
57 | - return array_keys($this->load); |
|
57 | + return array_keys( $this->load ); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -64,12 +64,12 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function extractDefaultRelations(): array |
66 | 66 | { |
67 | - return collect($this->getDefaultRelations())->merge($this->load->map(function ($transformer, $relation) { |
|
68 | - return collect($this->resolveTransformer($transformer)->extractDefaultRelations()) |
|
67 | + return collect( $this->getDefaultRelations() )->merge( $this->load->map( function ( $transformer, $relation ) { |
|
68 | + return collect( $this->resolveTransformer( $transformer )->extractDefaultRelations() ) |
|
69 | 69 | ->keys() |
70 | - ->map(function ($nestedRelation) use ($relation) { |
|
70 | + ->map( function ( $nestedRelation ) use ($relation) { |
|
71 | 71 | return "$relation.$nestedRelation"; |
72 | 72 | }); |
73 | - }))->all(); |
|
73 | + }) )->all(); |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | \ No newline at end of file |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | * |
22 | 22 | * @var \League\Fractal\ResourceInterface |
23 | 23 | */ |
24 | - protected $resources = []; |
|
24 | + protected $resources = [ ]; |
|
25 | 25 | |
26 | 26 | /** |
27 | 27 | * The resource builder resolver callback. |
@@ -38,9 +38,9 @@ discard block |
||
38 | 38 | * @param string|null $resourceKey |
39 | 39 | * @return void |
40 | 40 | */ |
41 | - public function resource($data = null, $transformer = null, string $resourceKey = null) |
|
41 | + public function resource( $data = null, $transformer = null, string $resourceKey = null ) |
|
42 | 42 | { |
43 | - return static::resolveResourceBuilder()->make($data, $transformer)->withResourceKey($resourceKey)->get(); |
|
43 | + return static::resolveResourceBuilder()->make( $data, $transformer )->withResourceKey( $resourceKey )->get(); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param \Closure $resolver |
50 | 50 | * @return void |
51 | 51 | */ |
52 | - public static function resourceBuilderResolver(Closure $resolver) |
|
52 | + public static function resourceBuilderResolver( Closure $resolver ) |
|
53 | 53 | { |
54 | 54 | static::$resourceBuilderResolver = $resolver; |
55 | 55 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | protected static function resolveResourceBuilder() |
63 | 63 | { |
64 | - return call_user_func(static::$currentCursorResolver, $name); |
|
64 | + return call_user_func( static::$currentCursorResolver, $name ); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -72,10 +72,10 @@ discard block |
||
72 | 72 | * @param \League\Fractal\ParamBag $parameters |
73 | 73 | * @return \League\Fractal\Resource\ResourceInterface|false |
74 | 74 | */ |
75 | - protected function makeResource(string $relation, $data, ParamBag $parameters) |
|
75 | + protected function makeResource( string $relation, $data, ParamBag $parameters ) |
|
76 | 76 | { |
77 | - if (method_exists($this, $method = 'include' . ucfirst($relation))) { |
|
78 | - return $this->$method($data, $parameters); |
|
77 | + if ( method_exists( $this, $method = 'include' . ucfirst( $relation ) ) ) { |
|
78 | + return $this->$method( $data, $parameters ); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | return $data instanceof Model ? $this->makeResourceFromModel() : false; |
@@ -88,15 +88,15 @@ discard block |
||
88 | 88 | * @param \Illuminate\Database\Eloquent\Model $model |
89 | 89 | * @return \League\Fractal\Resource\ResourceInterface|bool |
90 | 90 | */ |
91 | - protected function makeResourceFromModel(string $relation, Model $model) |
|
91 | + protected function makeResourceFromModel( string $relation, Model $model ) |
|
92 | 92 | { |
93 | 93 | $data = $model->$relation; |
94 | 94 | |
95 | - if (key_exists($relation, $this->resources)) { |
|
96 | - return $this->resources[$relation]->setData($data); |
|
95 | + if ( key_exists( $relation, $this->resources ) ) { |
|
96 | + return $this->resources[ $relation ]->setData( $data ); |
|
97 | 97 | } |
98 | 98 | |
99 | - return $this->resource($data); |
|
99 | + return $this->resource( $data ); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | /** |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | * @param string $relation |
107 | 107 | * @return \League\Fractal\ParamBag |
108 | 108 | */ |
109 | - protected function getScopedParameters(Scope $scope, string $relation): ParamBag |
|
109 | + protected function getScopedParameters( Scope $scope, string $relation ): ParamBag |
|
110 | 110 | { |
111 | - return $scope->getManager()->getIncludeParams($scope->getIdentifier($relation)); |
|
111 | + return $scope->getManager()->getIncludeParams( $scope->getIdentifier( $relation ) ); |
|
112 | 112 | } |
113 | 113 | } |
114 | 114 | \ No newline at end of file |
@@ -29,14 +29,14 @@ discard block |
||
29 | 29 | * |
30 | 30 | * @var array |
31 | 31 | */ |
32 | - protected $bindings = []; |
|
32 | + protected $bindings = [ ]; |
|
33 | 33 | |
34 | 34 | /** |
35 | 35 | * Construct the resolver class. |
36 | 36 | * |
37 | 37 | * @param \Illuminate\Contracts\Container\Container $container |
38 | 38 | */ |
39 | - public function __construct(Container $container) |
|
39 | + public function __construct( Container $container ) |
|
40 | 40 | { |
41 | 41 | $this->container = $container; |
42 | 42 | } |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | * @param string|callback $transformer |
49 | 49 | * @return void |
50 | 50 | */ |
51 | - public function bind($transformable, $transformer) |
|
51 | + public function bind( $transformable, $transformer ) |
|
52 | 52 | { |
53 | - $this->bindings = array_merge($this->bindings, is_array($transformable) ? $transformable : [ |
|
53 | + $this->bindings = array_merge( $this->bindings, is_array( $transformable ) ? $transformable : [ |
|
54 | 54 | $transformable => $transformer, |
55 | - ]); |
|
55 | + ] ); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -62,13 +62,13 @@ discard block |
||
62 | 62 | * @return \Flugg\Responder\Transformers\Transformer|callable |
63 | 63 | * @throws \Flugg\Responder\Exceptions\InvalidTransformerException |
64 | 64 | */ |
65 | - public function resolve($transformer) |
|
65 | + public function resolve( $transformer ) |
|
66 | 66 | { |
67 | - if (is_string($transformer)) { |
|
68 | - return $this->container->make($transformer); |
|
67 | + if ( is_string( $transformer ) ) { |
|
68 | + return $this->container->make( $transformer ); |
|
69 | 69 | } |
70 | 70 | |
71 | - if (! is_callable($transformer) && ! $transformer instanceof Transformer) { |
|
71 | + if ( ! is_callable( $transformer ) && ! $transformer instanceof Transformer ) { |
|
72 | 72 | throw new InvalidTransformerException; |
73 | 73 | } |
74 | 74 | |
@@ -81,11 +81,11 @@ discard block |
||
81 | 81 | * @param mixed $data |
82 | 82 | * @return \Flugg\Responder\Transformers\Transformer|callable|null |
83 | 83 | */ |
84 | - public function resolveFromData($data) |
|
84 | + public function resolveFromData( $data ) |
|
85 | 85 | { |
86 | - if ($transformable = $this->resolveTransformable($data)) { |
|
87 | - if ($transformer = $this->resolveTransformer()) { |
|
88 | - return $this->resolve($transformer); |
|
86 | + if ( $transformable = $this->resolveTransformable( $data ) ) { |
|
87 | + if ( $transformer = $this->resolveTransformer() ) { |
|
88 | + return $this->resolve( $transformer ); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
@@ -98,11 +98,11 @@ discard block |
||
98 | 98 | * @param mixed $data |
99 | 99 | * @return \Flugg\Responder\Contracts\Transformable|null |
100 | 100 | */ |
101 | - protected function resolveTransformable($data) |
|
101 | + protected function resolveTransformable( $data ) |
|
102 | 102 | { |
103 | - if (is_iterable($data)) { |
|
104 | - foreach ($data as $item) { |
|
105 | - if ($item instanceof Transformable) { |
|
103 | + if ( is_iterable( $data ) ) { |
|
104 | + foreach ( $data as $item ) { |
|
105 | + if ( $item instanceof Transformable ) { |
|
106 | 106 | return $item; |
107 | 107 | } |
108 | 108 | } |
@@ -117,10 +117,10 @@ discard block |
||
117 | 117 | * @param \Flugg\Responder\Contracts\Transformable $transformable |
118 | 118 | * @return \Flugg\Responder\Contracts\Transformable|null |
119 | 119 | */ |
120 | - protected function resolveTransformer(Transformable $transformable) |
|
120 | + protected function resolveTransformer( Transformable $transformable ) |
|
121 | 121 | { |
122 | - if (key_exists($this->bindings, get_class($transformable))) { |
|
123 | - return $this->bindings[get_class($transformable)]; |
|
122 | + if ( key_exists( $this->bindings, get_class( $transformable ) ) ) { |
|
123 | + return $this->bindings[ get_class( $transformable ) ]; |
|
124 | 124 | } |
125 | 125 | |
126 | 126 | return $transformable->transformer(); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | protected function makeClosureTransformer(): callable |
135 | 135 | { |
136 | - return function ($data) { |
|
136 | + return function ( $data ) { |
|
137 | 137 | return $data instanceof Arrayable ? $data->toArray() : $data; |
138 | 138 | }; |
139 | 139 | } |
@@ -47,9 +47,9 @@ |
||
47 | 47 | * |
48 | 48 | * @param string|null $message |
49 | 49 | */ |
50 | - public function __construct(string $message = null) |
|
50 | + public function __construct( string $message = null ) |
|
51 | 51 | { |
52 | - parent::__construct($this->status, $this->message ?? $message); |
|
52 | + parent::__construct( $this->status, $this->message ?? $message ); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | /** |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function register() |
50 | 50 | { |
51 | - if ($this->app instanceof Laravel) { |
|
51 | + if ( $this->app instanceof Laravel ) { |
|
52 | 52 | $this->registerLaravelBindings(); |
53 | - } elseif ($this->app instanceof Lumen) { |
|
53 | + } elseif ( $this->app instanceof Lumen ) { |
|
54 | 54 | $this->registerLumenBindings(); |
55 | 55 | } |
56 | 56 | |
@@ -70,8 +70,8 @@ discard block |
||
70 | 70 | */ |
71 | 71 | protected function registerLaravelBindings() |
72 | 72 | { |
73 | - $this->app->singleton(ResponseFactoryContract::class, function ($app) { |
|
74 | - return $this->decorateResponseFactory($app->make(LaravelResponseFactory::class)); |
|
73 | + $this->app->singleton( ResponseFactoryContract::class, function ( $app ) { |
|
74 | + return $this->decorateResponseFactory( $app->make( LaravelResponseFactory::class ) ); |
|
75 | 75 | }); |
76 | 76 | } |
77 | 77 | |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | */ |
83 | 83 | protected function registerLumenBindings() |
84 | 84 | { |
85 | - $this->app->singleton(ResponseFactoryContract::class, function ($app) { |
|
86 | - return $this->decorateResponseFactory($app->make(LumenResponseFactory::class)); |
|
85 | + $this->app->singleton( ResponseFactoryContract::class, function ( $app ) { |
|
86 | + return $this->decorateResponseFactory( $app->make( LumenResponseFactory::class ) ); |
|
87 | 87 | }); |
88 | 88 | } |
89 | 89 | |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | * @param \Flugg\Responder\Contracts\ResponseFactory $factory |
94 | 94 | * @return void |
95 | 95 | */ |
96 | - protected function decorateResponseFactory(ResponseFactoryContract $factory) |
|
96 | + protected function decorateResponseFactory( ResponseFactoryContract $factory ) |
|
97 | 97 | { |
98 | - foreach ($this->app->config['responder.decorators'] as $decorator) { |
|
99 | - $factory = new $decorator($factory); |
|
98 | + foreach ( $this->app->config[ 'responder.decorators' ] as $decorator ) { |
|
99 | + $factory = new $decorator( $factory ); |
|
100 | 100 | }; |
101 | 101 | |
102 | 102 | return $factory; |
@@ -109,12 +109,12 @@ discard block |
||
109 | 109 | */ |
110 | 110 | protected function registerSerializerBindings() |
111 | 111 | { |
112 | - $this->app->bind(ErrorSerializerContract::class, function ($app) { |
|
113 | - return $app->make($app->config['responder.serializers.error']); |
|
112 | + $this->app->bind( ErrorSerializerContract::class, function ( $app ) { |
|
113 | + return $app->make( $app->config[ 'responder.serializers.error' ] ); |
|
114 | 114 | }); |
115 | 115 | |
116 | - $this->app->bind(SerializerAbstract::class, function ($app) { |
|
117 | - return $app->make($app->config['responder.serializers.success']); |
|
116 | + $this->app->bind( SerializerAbstract::class, function ( $app ) { |
|
117 | + return $app->make( $app->config[ 'responder.serializers.success' ] ); |
|
118 | 118 | }); |
119 | 119 | } |
120 | 120 | |
@@ -125,12 +125,12 @@ discard block |
||
125 | 125 | */ |
126 | 126 | protected function registerErrorBindings() |
127 | 127 | { |
128 | - $this->app->singleton(ErrorMessageResolverContract::class, function () { |
|
129 | - return $app->make(ErrorMessageResolver::class); |
|
128 | + $this->app->singleton( ErrorMessageResolverContract::class, function () { |
|
129 | + return $app->make( ErrorMessageResolver::class ); |
|
130 | 130 | }); |
131 | 131 | |
132 | - $this->app->singleton(ErrorFactoryContract::class, function ($app) { |
|
133 | - return $app->make(ErrorFactory::class); |
|
132 | + $this->app->singleton( ErrorFactoryContract::class, function ( $app ) { |
|
133 | + return $app->make( ErrorFactory::class ); |
|
134 | 134 | }); |
135 | 135 | } |
136 | 136 | |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | */ |
142 | 142 | protected function registerFractalBindings() |
143 | 143 | { |
144 | - $this->app->bind(Manager::class, function ($app) { |
|
145 | - return $app->make(Manager::class)->setRecursionLimit($app->config['responder.recursion_limit']); |
|
144 | + $this->app->bind( Manager::class, function ( $app ) { |
|
145 | + return $app->make( Manager::class )->setRecursionLimit( $app->config[ 'responder.recursion_limit' ] ); |
|
146 | 146 | }); |
147 | 147 | } |
148 | 148 | |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | */ |
154 | 154 | protected function registerResourceBindings() |
155 | 155 | { |
156 | - $this->app->singleton(ResourceFactoryContract::class, function ($app) { |
|
157 | - return $app->make(ResourceFactory::class); |
|
156 | + $this->app->singleton( ResourceFactoryContract::class, function ( $app ) { |
|
157 | + return $app->make( ResourceFactory::class ); |
|
158 | 158 | }); |
159 | 159 | } |
160 | 160 | |
@@ -165,8 +165,8 @@ discard block |
||
165 | 165 | */ |
166 | 166 | protected function registerPaginationBindings() |
167 | 167 | { |
168 | - $this->app->bind(PaginatorFactoryContract::class, function ($app) { |
|
169 | - return new PaginatorFactory($app->make(Request::class)->query()); |
|
168 | + $this->app->bind( PaginatorFactoryContract::class, function ( $app ) { |
|
169 | + return new PaginatorFactory( $app->make( Request::class )->query() ); |
|
170 | 170 | }); |
171 | 171 | } |
172 | 172 | |
@@ -177,19 +177,19 @@ discard block |
||
177 | 177 | */ |
178 | 178 | protected function registerTransformationBindings() |
179 | 179 | { |
180 | - $this->app->bind(TransformFactoryContract::class, function () { |
|
181 | - return $app->make(FractalTransformFactory::class); |
|
180 | + $this->app->bind( TransformFactoryContract::class, function () { |
|
181 | + return $app->make( FractalTransformFactory::class ); |
|
182 | 182 | }); |
183 | 183 | |
184 | - $this->app->bind(TransformBuilder::class, function ($app) { |
|
185 | - return $app->make(TransformBuilder::class) |
|
186 | - ->serializer($app->make(SerializerAbstract::class)) |
|
187 | - ->with($app->make(Request::class)->input($app->config['responder.load_relations_parameter'], [])) |
|
188 | - ->only($app->make(Request::class)->input($app->config['responder.filter_fields_parameter'], [])); |
|
184 | + $this->app->bind( TransformBuilder::class, function ( $app ) { |
|
185 | + return $app->make( TransformBuilder::class ) |
|
186 | + ->serializer( $app->make( SerializerAbstract::class ) ) |
|
187 | + ->with( $app->make( Request::class )->input( $app->config[ 'responder.load_relations_parameter' ], [ ] ) ) |
|
188 | + ->only( $app->make( Request::class )->input( $app->config[ 'responder.filter_fields_parameter' ], [ ] ) ); |
|
189 | 189 | }); |
190 | 190 | |
191 | - $this->app->singleton(TransformerResolverContract::class, function ($app) { |
|
192 | - return $app->make(TransformerResolver::class); |
|
191 | + $this->app->singleton( TransformerResolverContract::class, function ( $app ) { |
|
192 | + return $app->make( TransformerResolver::class ); |
|
193 | 193 | }); |
194 | 194 | } |
195 | 195 | |
@@ -200,12 +200,12 @@ discard block |
||
200 | 200 | */ |
201 | 201 | protected function registerServiceBindings() |
202 | 202 | { |
203 | - $this->app->singleton(ResponderContract::class, function ($app) { |
|
204 | - return $app->make(Responder::class); |
|
203 | + $this->app->singleton( ResponderContract::class, function ( $app ) { |
|
204 | + return $app->make( Responder::class ); |
|
205 | 205 | }); |
206 | 206 | |
207 | - $this->app->singleton(TransformerContract::class, function ($app) { |
|
208 | - return $app->make(Transformer::class); |
|
207 | + $this->app->singleton( TransformerContract::class, function ( $app ) { |
|
208 | + return $app->make( Transformer::class ); |
|
209 | 209 | }); |
210 | 210 | } |
211 | 211 | |
@@ -216,14 +216,14 @@ discard block |
||
216 | 216 | */ |
217 | 217 | public function boot() |
218 | 218 | { |
219 | - if ($this->app instanceof Laravel) { |
|
219 | + if ( $this->app instanceof Laravel ) { |
|
220 | 220 | $this->bootLaravelApplication(); |
221 | - } elseif ($this->app instanceof Lumen) { |
|
221 | + } elseif ( $this->app instanceof Lumen ) { |
|
222 | 222 | $this->bootLumenApplication(); |
223 | 223 | } |
224 | 224 | |
225 | - $this->mergeConfigFrom(__DIR__ . '/../config/responder.php', 'responder'); |
|
226 | - $this->commands(MakeTransformer::class); |
|
225 | + $this->mergeConfigFrom( __DIR__ . '/../config/responder.php', 'responder' ); |
|
226 | + $this->commands( MakeTransformer::class ); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
@@ -233,14 +233,14 @@ discard block |
||
233 | 233 | */ |
234 | 234 | protected function bootLaravelApplication() |
235 | 235 | { |
236 | - if ($this->app->runningInConsole()) { |
|
237 | - $this->publishes([ |
|
238 | - __DIR__ . '/../resources/config/responder.php' => config_path('responder.php'), |
|
239 | - ], 'config'); |
|
236 | + if ( $this->app->runningInConsole() ) { |
|
237 | + $this->publishes( [ |
|
238 | + __DIR__ . '/../resources/config/responder.php' => config_path( 'responder.php' ), |
|
239 | + ], 'config' ); |
|
240 | 240 | |
241 | - $this->publishes([ |
|
242 | - __DIR__ . '/../resources/lang/en/errors.php' => base_path('resources/lang/en/errors.php'), |
|
243 | - ], 'lang'); |
|
241 | + $this->publishes( [ |
|
242 | + __DIR__ . '/../resources/lang/en/errors.php' => base_path( 'resources/lang/en/errors.php' ), |
|
243 | + ], 'lang' ); |
|
244 | 244 | } |
245 | 245 | } |
246 | 246 | |
@@ -251,6 +251,6 @@ discard block |
||
251 | 251 | */ |
252 | 252 | protected function bootLumenApplication() |
253 | 253 | { |
254 | - $this->app->configure('responder'); |
|
254 | + $this->app->configure( 'responder' ); |
|
255 | 255 | } |
256 | 256 | } |
257 | 257 | \ No newline at end of file |