Skip to content

Commit bb53593

Browse files
committed
format src
1 parent 4533642 commit bb53593

File tree

3 files changed

+231
-229
lines changed

3 files changed

+231
-229
lines changed

src/Flynsarmy/DbBladeCompiler/DbBladeCompiler.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ public function __construct($filesystem, $cache_path, $config, $app)
1515
$blade = app('view')->getEngineResolver()->resolve('blade')->getCompiler();
1616

1717
parent::__construct($filesystem, $cache_path);
18-
$this->rawTags = $blade->getRawTags();
19-
$this->contentTags = $blade->getContentTags();
20-
$this->escapedTags = $blade->getEscapedContentTags();
21-
$this->extensions = $blade->getExtensions();
18+
$this->rawTags = $blade->getRawTags();
19+
$this->contentTags = $blade->getContentTags();
20+
$this->escapedTags = $blade->getEscapedContentTags();
21+
$this->extensions = $blade->getExtensions();
2222
$this->customDirectives = $blade->getCustomDirectives();
23-
$this->config = $config;
23+
$this->config = $config;
2424
}
2525

2626
/**
2727
* Compile the view at the given path.
2828
*
29-
* @param Illuminate\Database\Eloquent\Model $path
29+
* @param Illuminate\Database\Eloquent\Model $path
3030
* @return void
3131
*/
3232
public function compile($path)
@@ -48,7 +48,7 @@ public function compile($path)
4848
/**
4949
* Get the path to the compiled version of a view.
5050
*
51-
* @param Illuminate\Database\Eloquent\Model $model
51+
* @param Illuminate\Database\Eloquent\Model $model
5252
* @return string
5353
*/
5454
public function getCompiledPath($model)
@@ -61,7 +61,7 @@ public function getCompiledPath($model)
6161
* e.g db_table_name_id_4
6262
*/
6363
$field = $this->config->get('db-blade-compiler.model_property');
64-
$path = 'db_' . $model->getTable() . '_' . $model->{$field} . '_';
64+
$path = 'db_' . $model->getTable() . '_' . $model->{$field} . '_';
6565
if (is_null($model->primaryKey)) {
6666
$path .= $model->id;
6767
} else if (is_array($model->primaryKey)) {
@@ -78,7 +78,7 @@ public function getCompiledPath($model)
7878
/**
7979
* Determine if the view at the given path is expired.
8080
*
81-
* @param string $path
81+
* @param string $path
8282
* @return bool
8383
*/
8484
public function isExpired($path)

src/Flynsarmy/DbBladeCompiler/DbBladeCompilerServiceProvider.php

Lines changed: 48 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,63 @@
33
use Illuminate\Support\ServiceProvider;
44
use Illuminate\View\Engines\CompilerEngine;
55

6-
class DbBladeCompilerServiceProvider extends ServiceProvider {
6+
class DbBladeCompilerServiceProvider extends ServiceProvider
7+
{
78

8-
/**
9-
* Indicates if loading of the provider is deferred.
10-
*
11-
* @var bool
12-
*/
13-
protected $defer = false;
9+
/**
10+
* Indicates if loading of the provider is deferred.
11+
*
12+
* @var bool
13+
*/
14+
protected $defer = false;
1415

15-
/**
16-
* Bootstrap the application events.
17-
*
18-
* @return void
19-
*/
20-
public function boot()
21-
{
22-
$config_path = __DIR__ . '/../../../config/db-blade-compiler.php';
23-
$this->publishes([$config_path => config_path('db-blade-compiler.php')], 'config');
16+
/**
17+
* Bootstrap the application events.
18+
*
19+
* @return void
20+
*/
21+
public function boot()
22+
{
23+
$config_path = __DIR__ . '/../../../config/db-blade-compiler.php';
24+
$this->publishes([$config_path => config_path('db-blade-compiler.php')], 'config');
2425

25-
$views_path = __DIR__ . '/../../../config/.gitkeep';
26-
$this->publishes([$views_path => storage_path('app/db-blade-compiler/views/.gitkeep')]);
27-
}
26+
$views_path = __DIR__ . '/../../../config/.gitkeep';
27+
$this->publishes([$views_path => storage_path('app/db-blade-compiler/views/.gitkeep')]);
28+
}
2829

29-
/**
30-
* Register the service provider.
31-
*
32-
* @return void
33-
*/
34-
public function register()
35-
{
36-
$config_path = __DIR__ . '/../../../config/db-blade-compiler.php';
37-
$this->mergeConfigFrom($config_path, 'db-blade-compiler');
30+
/**
31+
* Register the service provider.
32+
*
33+
* @return void
34+
*/
35+
public function register()
36+
{
37+
$config_path = __DIR__ . '/../../../config/db-blade-compiler.php';
38+
$this->mergeConfigFrom($config_path, 'db-blade-compiler');
3839

39-
$this->app['dbview'] = $this->app->share(function($app)
40-
{
41-
$cache_path = storage_path('app/db-blade-compiler/views');
40+
$this->app['dbview'] = $this->app->share(function ($app) {
41+
$cache_path = storage_path('app/db-blade-compiler/views');
4242

43-
$db_view = new DbView($app['config']);
44-
$compiler = new DbBladeCompiler($app['files'], $cache_path, $app['config'], $app);
45-
$db_view->setEngine(new CompilerEngine($compiler));
43+
$db_view = new DbView($app['config']);
44+
$compiler = new DbBladeCompiler($app['files'], $cache_path, $app['config'], $app);
45+
$db_view->setEngine(new CompilerEngine($compiler));
4646

47-
return $db_view;
47+
return $db_view;
4848
});
49-
$this->app->booting(function()
50-
{
51-
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
52-
$loader->alias('DbView', 'Flynsarmy\DbBladeCompiler\Facades\DbView');
49+
$this->app->booting(function () {
50+
$loader = \Illuminate\Foundation\AliasLoader::getInstance();
51+
$loader->alias('DbView', 'Flynsarmy\DbBladeCompiler\Facades\DbView');
5352
});
54-
}
53+
}
5554

56-
/**
57-
* Get the services provided by the provider.
58-
*
59-
* @return array
60-
*/
61-
public function provides()
62-
{
63-
return array();
64-
}
55+
/**
56+
* Get the services provided by the provider.
57+
*
58+
* @return array
59+
*/
60+
public function provides()
61+
{
62+
return array();
63+
}
6564

6665
}

0 commit comments

Comments
 (0)