Skip to content

Commit fa5a004

Browse files
authored
Merge pull request vyuldashev#25 from vyuldashev/analysis-WN0DVy
Apply fixes from StyleCI
2 parents 100b110 + 3f0a0a4 commit fa5a004

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

src/Builders/Components/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function getAllClasses(string $collection): Collection
4343

4444
return
4545
($collectionAnnotation && $collectionAnnotation->name === ['*']) ||
46-
(!$collectionAnnotation && $collection === Generator::COLLECTION_DEFAULT) ||
46+
(! $collectionAnnotation && $collection === Generator::COLLECTION_DEFAULT) ||
4747
($collectionAnnotation && in_array($collection, $collectionAnnotation->name ?? [], true));
4848
})
4949
->map(static function (ReflectionClass $reflectionClass) {

src/Builders/PathsBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function build(
4343
});
4444

4545
return
46-
(!$collectionAnnotation && $collection === Generator::COLLECTION_DEFAULT) ||
46+
(! $collectionAnnotation && $collection === Generator::COLLECTION_DEFAULT) ||
4747
($collectionAnnotation && in_array($collection, $collectionAnnotation->name, true));
4848
})
4949
->map(static function (RouteInformation $item) use ($middlewares) {

src/Generator.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ public function __construct(
4141

4242
public function generate(string $collection = self::COLLECTION_DEFAULT): OpenApi
4343
{
44-
$middlewares = Arr::get($this->config, 'collections.' . $collection . '.middlewares');
44+
$middlewares = Arr::get($this->config, 'collections.'.$collection.'.middlewares');
4545

46-
$info = $this->infoBuilder->build(Arr::get($this->config, 'collections.' . $collection . '.info', []));
47-
$servers = $this->serversBuilder->build(Arr::get($this->config, 'collections.' . $collection . '.servers', []));
48-
$tags = $this->tagsBuilder->build(Arr::get($this->config, 'collections.' . $collection . '.tags', []));
46+
$info = $this->infoBuilder->build(Arr::get($this->config, 'collections.'.$collection.'.info', []));
47+
$servers = $this->serversBuilder->build(Arr::get($this->config, 'collections.'.$collection.'.servers', []));
48+
$tags = $this->tagsBuilder->build(Arr::get($this->config, 'collections.'.$collection.'.tags', []));
4949
$paths = $this->pathsBuilder->build($collection, Arr::get($middlewares, 'paths', []));
5050
$components = $this->componentsBuilder->build($collection);
5151

@@ -55,7 +55,7 @@ public function generate(string $collection = self::COLLECTION_DEFAULT): OpenApi
5555
->servers(...$servers)
5656
->paths(...$paths)
5757
->components($components)
58-
->security(...Arr::get($this->config, 'collections.' . $collection . '.security', []))
58+
->security(...Arr::get($this->config, 'collections.'.$collection.'.security', []))
5959
->tags(...$tags);
6060

6161
return $openApi;

src/OpenApiServiceProvider.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,29 @@ public function boot(): void
2424
{
2525
if ($this->app->runningInConsole()) {
2626
$this->publishes([
27-
__DIR__ . '/../config/openapi.php' => config_path('openapi.php'),
27+
__DIR__.'/../config/openapi.php' => config_path('openapi.php'),
2828
], 'openapi-config');
2929
}
3030

3131
$this->registerAnnotations();
3232

33-
$this->app->bind(CallbacksBuilder::class, function() {
33+
$this->app->bind(CallbacksBuilder::class, function () {
3434
return new CallbacksBuilder($this->getPathsFromConfig('callbacks'));
3535
});
3636

37-
$this->app->bind(RequestBodiesBuilder::class, function() {
37+
$this->app->bind(RequestBodiesBuilder::class, function () {
3838
return new RequestBodiesBuilder($this->getPathsFromConfig('request_bodies'));
3939
});
4040

41-
$this->app->bind(ResponsesBuilder::class, function() {
41+
$this->app->bind(ResponsesBuilder::class, function () {
4242
return new ResponsesBuilder($this->getPathsFromConfig('responses'));
4343
});
4444

45-
$this->app->bind(SchemasBuilder::class, function($app) {
45+
$this->app->bind(SchemasBuilder::class, function ($app) {
4646
return new SchemasBuilder($this->getPathsFromConfig('schemas'));
4747
});
4848

49-
$this->app->bind(SecuritySchemesBuilder::class, function() {
49+
$this->app->bind(SecuritySchemesBuilder::class, function () {
5050
return new SecuritySchemesBuilder($this->getPathsFromConfig('security_schemes'));
5151
});
5252

@@ -63,13 +63,13 @@ public function boot(): void
6363
);
6464
});
6565

66-
$this->loadRoutesFrom(__DIR__ . '/../routes/api.php');
66+
$this->loadRoutesFrom(__DIR__.'/../routes/api.php');
6767
}
6868

6969
public function register(): void
7070
{
7171
$this->mergeConfigFrom(
72-
__DIR__ . '/../config/openapi.php',
72+
__DIR__.'/../config/openapi.php',
7373
'openapi'
7474
);
7575

@@ -92,7 +92,7 @@ public function register(): void
9292

9393
protected function registerAnnotations(): void
9494
{
95-
$files = glob(__DIR__ . '/Annotations/*.php');
95+
$files = glob(__DIR__.'/Annotations/*.php');
9696

9797
foreach ($files as $file) {
9898
AnnotationRegistry::registerFile($file);
@@ -101,7 +101,7 @@ protected function registerAnnotations(): void
101101

102102
private function getPathsFromConfig(string $type): array
103103
{
104-
$directories = config('openapi.locations.' . $type, []);
104+
$directories = config('openapi.locations.'.$type, []);
105105

106106
foreach ($directories as &$directory) {
107107
$directory = glob($directory, GLOB_ONLYDIR);

src/RouteInformation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public static function createFromRoute(Route $route)
4444
return Str::lower($value);
4545
})
4646
->filter(static function ($value) {
47-
return !in_array($value, ['head', 'options'], true);
47+
return ! in_array($value, ['head', 'options'], true);
4848
})
4949
->first();
5050

tests/PetstoreTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ protected function setUp(): void
2222
protected function getEnvironmentSetUp($app): void
2323
{
2424
$app['config']->set('openapi.locations.schemas', [
25-
__DIR__ . '/../examples/petstore/OpenApi/Schemas',
25+
__DIR__.'/../examples/petstore/OpenApi/Schemas',
2626
]);
2727
}
2828

0 commit comments

Comments
 (0)