Skip to content

Commit 64a0f5e

Browse files
committed
Code style
1 parent b6b5fde commit 64a0f5e

8 files changed

Lines changed: 78 additions & 82 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ vendor/
22
composer.phar
33
composer.lock
44
.phpunit.result.cache
5+
.php-cs-fixer.cache
56

67
.DS_Store
78
.phpstorm.meta.php

src/Exceptions/UnnamedRouteException.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Glhd\Gretel\Exceptions;
44

5-
use Glhd\Gretel\Macros;
6-
75
class UnnamedRouteException extends \InvalidArgumentException
86
{
97
public function __construct()

src/Resolvers/TitleResolver.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Glhd\Gretel\Resolvers;
44

5-
use Closure;
6-
use Glhd\Gretel\Breadcrumb;
75
use Glhd\Gretel\Registry;
86
use Illuminate\Routing\Route;
97

src/Routing/Breadcrumbs.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php /** @noinspection JsonEncodingApiUsageInspection */
1+
<?php
2+
3+
/** @noinspection JsonEncodingApiUsageInspection */
24

35
namespace Glhd\Gretel\Routing;
46

Lines changed: 73 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,73 @@
1-
<?php
2-
3-
namespace Glhd\Gretel\Support;
4-
5-
use Glhd\Gretel\Macros;
6-
use Glhd\Gretel\Registry;
7-
use Illuminate\Contracts\Container\Container;
8-
use Illuminate\Contracts\Foundation\Application;
9-
use Illuminate\Support\Facades\Blade;
10-
use Illuminate\Support\ServiceProvider;
11-
12-
class GretelServiceProvider extends ServiceProvider
13-
{
14-
protected string $base_dir;
15-
16-
public function __construct($app)
17-
{
18-
parent::__construct($app);
19-
20-
$this->base_dir = dirname(__DIR__, 2);
21-
}
22-
23-
public function boot()
24-
{
25-
require_once __DIR__.'/helpers.php';
26-
27-
$this->bootConfig();
28-
$this->bootViews();
29-
$this->bootBladeComponents();
30-
}
31-
32-
public function register()
33-
{
34-
$this->mergeConfigFrom("{$this->base_dir}/config.php", 'gretel');
35-
36-
$this->app->singleton(Registry::class);
37-
$this->app->booting(fn(Container $app) => Macros::register($app->make(Registry::class)));
38-
}
39-
40-
protected function bootViews() : self
41-
{
42-
$views_directory = "{$this->base_dir}/resources/views";
43-
44-
$this->loadViewsFrom($views_directory, 'gretel');
45-
46-
if (method_exists($this->app, 'resourcePath')) {
47-
$this->publishes([
48-
$views_directory => $this->app->resourcePath('views/vendor/gretel'),
49-
], 'gretel-views');
50-
}
51-
52-
return $this;
53-
}
54-
55-
protected function bootBladeComponents() : self
56-
{
57-
if (version_compare($this->app->version(), '8.0.0', '>=')) {
58-
Blade::componentNamespace('Glhd\\Gretel\\Components', 'gretel');
59-
}
60-
61-
return $this;
62-
}
63-
64-
protected function bootConfig() : self
65-
{
66-
if (method_exists($this->app, 'configPath')) {
67-
$this->publishes([
68-
"{$this->base_dir}/config.php" => $this->app->configPath('gretel.php'),
69-
], 'gretel-config');
70-
}
71-
72-
return $this;
73-
}
74-
}
1+
<?php
2+
3+
namespace Glhd\Gretel\Support;
4+
5+
use Glhd\Gretel\Macros;
6+
use Glhd\Gretel\Registry;
7+
use Illuminate\Contracts\Container\Container;
8+
use Illuminate\Support\Facades\Blade;
9+
use Illuminate\Support\ServiceProvider;
10+
11+
class GretelServiceProvider extends ServiceProvider
12+
{
13+
protected string $base_dir;
14+
15+
public function __construct($app)
16+
{
17+
parent::__construct($app);
18+
19+
$this->base_dir = dirname(__DIR__, 2);
20+
}
21+
22+
public function boot()
23+
{
24+
require_once __DIR__.'/helpers.php';
25+
26+
$this->bootConfig();
27+
$this->bootViews();
28+
$this->bootBladeComponents();
29+
}
30+
31+
public function register()
32+
{
33+
$this->mergeConfigFrom("{$this->base_dir}/config.php", 'gretel');
34+
35+
$this->app->singleton(Registry::class);
36+
$this->app->booting(fn(Container $app) => Macros::register($app->make(Registry::class)));
37+
}
38+
39+
protected function bootViews(): self
40+
{
41+
$views_directory = "{$this->base_dir}/resources/views";
42+
43+
$this->loadViewsFrom($views_directory, 'gretel');
44+
45+
if (method_exists($this->app, 'resourcePath')) {
46+
$this->publishes([
47+
$views_directory => $this->app->resourcePath('views/vendor/gretel'),
48+
], 'gretel-views');
49+
}
50+
51+
return $this;
52+
}
53+
54+
protected function bootBladeComponents(): self
55+
{
56+
if (version_compare($this->app->version(), '8.0.0', '>=')) {
57+
Blade::componentNamespace('Glhd\\Gretel\\Components', 'gretel');
58+
}
59+
60+
return $this;
61+
}
62+
63+
protected function bootConfig(): self
64+
{
65+
if (method_exists($this->app, 'configPath')) {
66+
$this->publishes([
67+
"{$this->base_dir}/config.php" => $this->app->configPath('gretel.php'),
68+
], 'gretel-config');
69+
}
70+
71+
return $this;
72+
}
73+
}

tests/Mocks/Note.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
class Note extends MockModel
66
{
7-
87
}

tests/Mocks/User.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,4 @@
44

55
class User extends MockModel
66
{
7-
87
}

tests/TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
abstract class TestCase extends Orchestra
1010
{
11-
protected function setUp() : void
11+
protected function setUp(): void
1212
{
1313
parent::setUp();
1414

0 commit comments

Comments
 (0)