Skip to content

Commit 453f28a

Browse files
committed
style updates
1 parent 1a71ea8 commit 453f28a

File tree

8 files changed

+15
-18
lines changed

8 files changed

+15
-18
lines changed

.scrutinizer.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
build:
2+
nodes:
3+
analysis:
4+
tests:
5+
override:
6+
- php-scrutinizer-run
7+
18
filter:
29
excluded_paths: [tests/*]
310

src/Compilers/DbBladeCompiler.php

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

33
namespace Kiroushi\DbBlade\Compilers;
44

5-
use Illuminate\Config\Repository;
65
use Illuminate\Database\Eloquent\Model;
76
use Illuminate\View\Compilers\BladeCompiler;
87
use Illuminate\View\Compilers\CompilerInterface;

src/DbBladeCompilerServiceProvider.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Illuminate\Filesystem\Filesystem;
77
use Illuminate\Support\Collection;
88
use Illuminate\Support\ServiceProvider;
9-
use Illuminate\View\Engines\CompilerEngine;
109
use Kiroushi\DbBlade\Compilers\DbBladeCompiler;
1110

1211
class DbBladeCompilerServiceProvider extends ServiceProvider
@@ -60,7 +59,7 @@ public function register()
6059

6160
$cachePath = storage_path('app/db-blade/cache/views');
6261

63-
return new Compilers\DbBladeCompiler($app['files'], $cachePath);
62+
return new DbBladeCompiler($app['files'], $cachePath);
6463

6564
});
6665
}
@@ -95,7 +94,7 @@ public function registerFactory()
9594
*
9695
* @param \Kiroushi\DbBlade\DbViewFinder $finder
9796
* @param \Illuminate\Contracts\Events\Dispatcher $events
98-
* @return \Kiroushi\DbBlade\Factory;
97+
* @return \Kiroushi\DbBlade\Factory
9998
*/
10099
protected function createFactory($finder, $events)
101100
{
@@ -129,7 +128,7 @@ public function registerDbViewFinder()
129128
protected function getMigrationFileName(Filesystem $filesystem): string
130129
{
131130
$timestamp = date('Y_m_d_His');
132-
131+
133132
return Collection::make($this->app->databasePath() . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR)
134133
->flatMap(function ($path) use ($filesystem) {
135134
return $filesystem->glob($path . '*_create_db_views_table.php');

src/DbView.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
namespace Kiroushi\DbBlade;
44

5-
use View, Closure, ArrayAccess;
5+
use ArrayAccess;
66
use Illuminate\Contracts\Support\Arrayable;
77
use Illuminate\Contracts\Support\Renderable;
8-
use Illuminate\Config\Repository;
98
use Illuminate\Database\Eloquent\Model;
9+
use View;
1010

1111
use Kiroushi\DbBlade\Compilers\DbBladeCompiler;
1212
use Kiroushi\DbBlade\Engines\DbBladeCompilerEngine;
@@ -25,7 +25,6 @@ class DbView extends \Illuminate\View\View implements ArrayAccess, Renderable
2525
* @param Model $model
2626
* @param mixed $data
2727
* @param string|null $contentField
28-
* @return void
2928
*/
3029
public function __construct(Factory $factory, $view, $model, $data = [], $contentField = null)
3130
{

src/DbViewFinder.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function model(string $modelName, string $nameField = null)
2020
{
2121
$this->modelName = $modelName;
2222

23-
if ($nameField) {
23+
if ($nameField !== null) {
2424
$this->nameField = $nameField;
2525
}
2626
}
@@ -38,6 +38,7 @@ public function field(string $nameField)
3838
*/
3939
public function find($name)
4040
{
41+
// To do: expose this callback.
4142
return ($this->modelName)::where($this->nameField, $name)->firstOrFail();
4243
}
4344

src/Engines/DbBladeCompilerEngine.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class DbBladeCompilerEngine extends CompilerEngine
1313
* Create a new DbView engine instance.
1414
*
1515
* @param \Kiroushi\DbBlade\Compilers\DbBladeCompiler $compiler
16-
* @return void
1716
*/
1817
public function __construct(DbBladeCompiler $compiler)
1918
{

src/Factory.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class Factory extends ViewFactory
1515
*
1616
* @param \Kiroushi\DbBlade\DbViewFinder $finder
1717
* @param \Illuminate\Contracts\Events\Dispatcher $events
18-
* @return void
1918
*/
2019
public function __construct(DbViewFinder $finder, Dispatcher $events)
2120
{
@@ -69,7 +68,7 @@ public function contentField(string $contentField)
6968
* Create a new view instance from the given arguments.
7069
*
7170
* @param string $view
72-
* @param string $path
71+
* @param Model $model
7372
* @param \Illuminate\Contracts\Support\Arrayable|array $data
7473
* @return \Kiroushi\DbBlade\DbView
7574
*/

src/Models/DbView.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
class DbView extends Model
88
{
99

10-
/**
11-
* Create a new Eloquent model instance.
12-
*
13-
* @param array $attributes
14-
* @return void
15-
*/
1610
public function __construct()
1711
{
1812
parent::__construct(...func_get_args());

0 commit comments

Comments
 (0)