Skip to content

Commit

Permalink
style updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kiroushi committed Apr 17, 2019
1 parent 1a71ea8 commit 453f28a
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 18 deletions.
7 changes: 7 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
build:
nodes:
analysis:
tests:
override:
- php-scrutinizer-run

filter:
excluded_paths: [tests/*]

Expand Down
1 change: 0 additions & 1 deletion src/Compilers/DbBladeCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Kiroushi\DbBlade\Compilers;

use Illuminate\Config\Repository;
use Illuminate\Database\Eloquent\Model;
use Illuminate\View\Compilers\BladeCompiler;
use Illuminate\View\Compilers\CompilerInterface;
Expand Down
7 changes: 3 additions & 4 deletions src/DbBladeCompilerServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Collection;
use Illuminate\Support\ServiceProvider;
use Illuminate\View\Engines\CompilerEngine;
use Kiroushi\DbBlade\Compilers\DbBladeCompiler;

class DbBladeCompilerServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -60,7 +59,7 @@ public function register()

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

return new Compilers\DbBladeCompiler($app['files'], $cachePath);
return new DbBladeCompiler($app['files'], $cachePath);

});
}
Expand Down Expand Up @@ -95,7 +94,7 @@ public function registerFactory()
*
* @param \Kiroushi\DbBlade\DbViewFinder $finder
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return \Kiroushi\DbBlade\Factory;
* @return \Kiroushi\DbBlade\Factory
*/
protected function createFactory($finder, $events)
{
Expand Down Expand Up @@ -129,7 +128,7 @@ public function registerDbViewFinder()
protected function getMigrationFileName(Filesystem $filesystem): string
{
$timestamp = date('Y_m_d_His');

return Collection::make($this->app->databasePath() . DIRECTORY_SEPARATOR . 'migrations' . DIRECTORY_SEPARATOR)
->flatMap(function ($path) use ($filesystem) {
return $filesystem->glob($path . '*_create_db_views_table.php');
Expand Down
5 changes: 2 additions & 3 deletions src/DbView.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace Kiroushi\DbBlade;

use View, Closure, ArrayAccess;
use ArrayAccess;
use Illuminate\Contracts\Support\Arrayable;
use Illuminate\Contracts\Support\Renderable;
use Illuminate\Config\Repository;
use Illuminate\Database\Eloquent\Model;
use View;

use Kiroushi\DbBlade\Compilers\DbBladeCompiler;
use Kiroushi\DbBlade\Engines\DbBladeCompilerEngine;
Expand All @@ -25,7 +25,6 @@ class DbView extends \Illuminate\View\View implements ArrayAccess, Renderable
* @param Model $model
* @param mixed $data
* @param string|null $contentField
* @return void
*/
public function __construct(Factory $factory, $view, $model, $data = [], $contentField = null)
{
Expand Down
3 changes: 2 additions & 1 deletion src/DbViewFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function model(string $modelName, string $nameField = null)
{
$this->modelName = $modelName;

if ($nameField) {
if ($nameField !== null) {
$this->nameField = $nameField;
}
}
Expand All @@ -38,6 +38,7 @@ public function field(string $nameField)
*/
public function find($name)
{
// To do: expose this callback.
return ($this->modelName)::where($this->nameField, $name)->firstOrFail();
}

Expand Down
1 change: 0 additions & 1 deletion src/Engines/DbBladeCompilerEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ class DbBladeCompilerEngine extends CompilerEngine
* Create a new DbView engine instance.
*
* @param \Kiroushi\DbBlade\Compilers\DbBladeCompiler $compiler
* @return void
*/
public function __construct(DbBladeCompiler $compiler)
{
Expand Down
3 changes: 1 addition & 2 deletions src/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ class Factory extends ViewFactory
*
* @param \Kiroushi\DbBlade\DbViewFinder $finder
* @param \Illuminate\Contracts\Events\Dispatcher $events
* @return void
*/
public function __construct(DbViewFinder $finder, Dispatcher $events)
{
Expand Down Expand Up @@ -69,7 +68,7 @@ public function contentField(string $contentField)
* Create a new view instance from the given arguments.
*
* @param string $view
* @param string $path
* @param Model $model
* @param \Illuminate\Contracts\Support\Arrayable|array $data
* @return \Kiroushi\DbBlade\DbView
*/
Expand Down
6 changes: 0 additions & 6 deletions src/Models/DbView.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
class DbView extends Model
{

/**
* Create a new Eloquent model instance.
*
* @param array $attributes
* @return void
*/
public function __construct()
{
parent::__construct(...func_get_args());
Expand Down

0 comments on commit 453f28a

Please sign in to comment.