@@ -133,7 +133,7 @@ |
||
| 133 | 133 | |
| 134 | 134 | foreach($path as $step) |
| 135 | 135 | { |
| 136 | - $loc = &$loc[$step]; |
|
| 136 | + $loc = &$loc[$step]; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | return $loc = $val; |
@@ -131,7 +131,7 @@ |
||
| 131 | 131 | |
| 132 | 132 | array_pop($path); |
| 133 | 133 | |
| 134 | - foreach($path as $step) |
|
| 134 | + foreach ($path as $step) |
|
| 135 | 135 | { |
| 136 | 136 | $loc = &$loc[$step]; |
| 137 | 137 | } |
@@ -28,8 +28,7 @@ |
||
| 28 | 28 | { |
| 29 | 29 | if (str_contains($subset, '.')) { |
| 30 | 30 | $this->addCascadeSubset($subset, $closure); |
| 31 | - } |
|
| 32 | - else { |
|
| 31 | + } else { |
|
| 33 | 32 | $this->addSimpleSubset($subset, $closure); |
| 34 | 33 | } |
| 35 | 34 | } |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Illuminate\Support\Collection; |
| 6 | 6 | use Illuminate\Support\ServiceProvider; |
| 7 | 7 | |
| 8 | -class ChartServiceProvider extends ServiceProvider{ |
|
| 8 | +class ChartServiceProvider extends ServiceProvider { |
|
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Indicates if loading of the provider is deferred. |
@@ -7,27 +7,27 @@ |
||
| 7 | 7 | |
| 8 | 8 | class ChartServiceProvider extends ServiceProvider{ |
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - * Indicates if loading of the provider is deferred. |
|
| 12 | - * |
|
| 13 | - * @var bool |
|
| 14 | - */ |
|
| 15 | - protected $defer = false; |
|
| 16 | - |
|
| 17 | - public function boot() |
|
| 18 | - { |
|
| 19 | - // |
|
| 20 | - } |
|
| 21 | - |
|
| 22 | - public function register() |
|
| 23 | - { |
|
| 24 | - $this->app->bind('chart', function($app) { |
|
| 25 | - |
|
| 26 | - $collection = new Collection; |
|
| 27 | - |
|
| 28 | - return new Chart($collection); |
|
| 29 | - }); |
|
| 30 | - } |
|
| 10 | + /** |
|
| 11 | + * Indicates if loading of the provider is deferred. |
|
| 12 | + * |
|
| 13 | + * @var bool |
|
| 14 | + */ |
|
| 15 | + protected $defer = false; |
|
| 16 | + |
|
| 17 | + public function boot() |
|
| 18 | + { |
|
| 19 | + // |
|
| 20 | + } |
|
| 21 | + |
|
| 22 | + public function register() |
|
| 23 | + { |
|
| 24 | + $this->app->bind('chart', function($app) { |
|
| 25 | + |
|
| 26 | + $collection = new Collection; |
|
| 27 | + |
|
| 28 | + return new Chart($collection); |
|
| 29 | + }); |
|
| 30 | + } |
|
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | |
@@ -13,9 +13,9 @@ discard block |
||
| 13 | 13 | protected $criteriaList; |
| 14 | 14 | public $cascade = null; |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * [__construct description] |
|
| 18 | - */ |
|
| 16 | + /** |
|
| 17 | + * [__construct description] |
|
| 18 | + */ |
|
| 19 | 19 | public function __construct() |
| 20 | 20 | { |
| 21 | 21 | $this->criteriaList = collect(); |
@@ -51,10 +51,10 @@ discard block |
||
| 51 | 51 | return $render->handle($this->resolveKey(), $formatedSubset); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * [setCascade description] |
|
| 56 | - * @param string $cascade |
|
| 57 | - */ |
|
| 54 | + /** |
|
| 55 | + * [setCascade description] |
|
| 56 | + * @param string $cascade |
|
| 57 | + */ |
|
| 58 | 58 | public function setCascade($cascade) |
| 59 | 59 | { |
| 60 | 60 | $this->cascade = $cascade; |
@@ -4,6 +4,6 @@ |
||
| 4 | 4 | |
| 5 | 5 | interface Rendered { |
| 6 | 6 | |
| 7 | - public function handle($key, $content); |
|
| 7 | + public function handle($key, $content); |
|
| 8 | 8 | |
| 9 | 9 | } |
| 10 | 10 | \ No newline at end of file |
@@ -9,33 +9,33 @@ |
||
| 9 | 9 | |
| 10 | 10 | abstract class Builder implements Contracts\Criteria { |
| 11 | 11 | |
| 12 | - use Traits\BuilderService; |
|
| 13 | - |
|
| 14 | - protected $content; |
|
| 15 | - |
|
| 16 | - /** |
|
| 17 | - * [__construct description] |
|
| 18 | - * @param mixed $content |
|
| 19 | - */ |
|
| 20 | - public function __construct($content) |
|
| 21 | - { |
|
| 22 | - $this->content = $content; |
|
| 23 | - } |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * [render description] |
|
| 27 | - * @return array |
|
| 28 | - */ |
|
| 29 | - public function render() |
|
| 30 | - { |
|
| 31 | - $render = new Rendered\Render(); |
|
| 32 | - $render = new Rendered\Criteria($render); |
|
| 33 | - |
|
| 34 | - if ($this->content instanceof Contracts\Expression) { |
|
| 35 | - $this->content = $this->content->render(); |
|
| 36 | - $render = new Rendered\Expression($render); |
|
| 37 | - } |
|
| 38 | - |
|
| 39 | - return $render->handle($this->resolveKey(), $this->content); |
|
| 40 | - } |
|
| 12 | + use Traits\BuilderService; |
|
| 13 | + |
|
| 14 | + protected $content; |
|
| 15 | + |
|
| 16 | + /** |
|
| 17 | + * [__construct description] |
|
| 18 | + * @param mixed $content |
|
| 19 | + */ |
|
| 20 | + public function __construct($content) |
|
| 21 | + { |
|
| 22 | + $this->content = $content; |
|
| 23 | + } |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * [render description] |
|
| 27 | + * @return array |
|
| 28 | + */ |
|
| 29 | + public function render() |
|
| 30 | + { |
|
| 31 | + $render = new Rendered\Render(); |
|
| 32 | + $render = new Rendered\Criteria($render); |
|
| 33 | + |
|
| 34 | + if ($this->content instanceof Contracts\Expression) { |
|
| 35 | + $this->content = $this->content->render(); |
|
| 36 | + $render = new Rendered\Expression($render); |
|
| 37 | + } |
|
| 38 | + |
|
| 39 | + return $render->handle($this->resolveKey(), $this->content); |
|
| 40 | + } |
|
| 41 | 41 | } |
@@ -4,14 +4,14 @@ |
||
| 4 | 4 | |
| 5 | 5 | class Render implements rendered { |
| 6 | 6 | |
| 7 | - /** |
|
| 8 | - * [handle description] |
|
| 9 | - * @param string $key |
|
| 10 | - * @param string $content |
|
| 11 | - * @return array |
|
| 12 | - */ |
|
| 13 | - public function handle($key, $content) |
|
| 14 | - { |
|
| 15 | - return [$key => $content]; |
|
| 16 | - } |
|
| 7 | + /** |
|
| 8 | + * [handle description] |
|
| 9 | + * @param string $key |
|
| 10 | + * @param string $content |
|
| 11 | + * @return array |
|
| 12 | + */ |
|
| 13 | + public function handle($key, $content) |
|
| 14 | + { |
|
| 15 | + return [$key => $content]; |
|
| 16 | + } |
|
| 17 | 17 | } |
@@ -4,40 +4,40 @@ |
||
| 4 | 4 | |
| 5 | 5 | class Subset implements Rendered { |
| 6 | 6 | |
| 7 | - protected $render; |
|
| 8 | - protected $cascade = null; |
|
| 7 | + protected $render; |
|
| 8 | + protected $cascade = null; |
|
| 9 | 9 | |
| 10 | - /** |
|
| 11 | - * [__construct description] |
|
| 12 | - * @param \EnergieProduction\Chart\Rendered\Rendered $render |
|
| 13 | - */ |
|
| 14 | - public function __construct(Rendered $render) |
|
| 15 | - { |
|
| 16 | - $this->render = $render; |
|
| 17 | - } |
|
| 10 | + /** |
|
| 11 | + * [__construct description] |
|
| 12 | + * @param \EnergieProduction\Chart\Rendered\Rendered $render |
|
| 13 | + */ |
|
| 14 | + public function __construct(Rendered $render) |
|
| 15 | + { |
|
| 16 | + $this->render = $render; |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * [setCascade description] |
|
| 21 | - * @param string |
|
| 22 | - * @return void |
|
| 23 | - */ |
|
| 24 | - public function setCascade($cascade = null) |
|
| 25 | - { |
|
| 26 | - $this->cascade = $cascade; |
|
| 27 | - } |
|
| 19 | + /** |
|
| 20 | + * [setCascade description] |
|
| 21 | + * @param string |
|
| 22 | + * @return void |
|
| 23 | + */ |
|
| 24 | + public function setCascade($cascade = null) |
|
| 25 | + { |
|
| 26 | + $this->cascade = $cascade; |
|
| 27 | + } |
|
| 28 | 28 | |
| 29 | - /** |
|
| 30 | - * [handle description] |
|
| 31 | - * @param string $key |
|
| 32 | - * @param string $content |
|
| 33 | - * @return array |
|
| 34 | - */ |
|
| 35 | - public function handle($key, $content) |
|
| 36 | - { |
|
| 37 | - if ($key == 'series' && (! $this->cascade || starts_with($this->cascade, 'series.'))) { |
|
| 38 | - $content = [$content]; |
|
| 39 | - } |
|
| 29 | + /** |
|
| 30 | + * [handle description] |
|
| 31 | + * @param string $key |
|
| 32 | + * @param string $content |
|
| 33 | + * @return array |
|
| 34 | + */ |
|
| 35 | + public function handle($key, $content) |
|
| 36 | + { |
|
| 37 | + if ($key == 'series' && (! $this->cascade || starts_with($this->cascade, 'series.'))) { |
|
| 38 | + $content = [$content]; |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - return $this->render->handle($key, $content); |
|
| 42 | - } |
|
| 41 | + return $this->render->handle($key, $content); |
|
| 42 | + } |
|
| 43 | 43 | } |
| 44 | 44 | \ No newline at end of file |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | */ |
| 35 | 35 | public function handle($key, $content) |
| 36 | 36 | { |
| 37 | - if ($key == 'series' && (! $this->cascade || starts_with($this->cascade, 'series.'))) { |
|
| 37 | + if ($key == 'series' && (!$this->cascade || starts_with($this->cascade, 'series.'))) { |
|
| 38 | 38 | $content = [$content]; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -10,19 +10,19 @@ |
||
| 10 | 10 | * [__construct description] |
| 11 | 11 | * @param \EnergieProduction\Chart\Rendered\Rendered $render |
| 12 | 12 | */ |
| 13 | - public function __construct(Rendered $render) |
|
| 14 | - { |
|
| 15 | - $this->render = $render; |
|
| 16 | - } |
|
| 13 | + public function __construct(Rendered $render) |
|
| 14 | + { |
|
| 15 | + $this->render = $render; |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * [handle description] |
|
| 20 | - * @param string $key |
|
| 21 | - * @param string $content |
|
| 22 | - * @return array |
|
| 23 | - */ |
|
| 24 | - public function handle($key, $content) |
|
| 25 | - { |
|
| 26 | - return $this->render->handle($key, $content); |
|
| 27 | - } |
|
| 18 | + /** |
|
| 19 | + * [handle description] |
|
| 20 | + * @param string $key |
|
| 21 | + * @param string $content |
|
| 22 | + * @return array |
|
| 23 | + */ |
|
| 24 | + public function handle($key, $content) |
|
| 25 | + { |
|
| 26 | + return $this->render->handle($key, $content); |
|
| 27 | + } |
|
| 28 | 28 | } |
@@ -10,19 +10,19 @@ |
||
| 10 | 10 | * [__construct description] |
| 11 | 11 | * @param \EnergieProduction\Chart\Rendered\Rendered $render |
| 12 | 12 | */ |
| 13 | - public function __construct(Rendered $render) |
|
| 14 | - { |
|
| 15 | - $this->render = $render; |
|
| 16 | - } |
|
| 13 | + public function __construct(Rendered $render) |
|
| 14 | + { |
|
| 15 | + $this->render = $render; |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * [handle description] |
|
| 20 | - * @param string $key |
|
| 21 | - * @param string $content |
|
| 22 | - * @return array |
|
| 23 | - */ |
|
| 24 | - public function handle($key, $content) |
|
| 25 | - { |
|
| 26 | - return $this->render->handle($key, "#!!" . $content . "!!#"); |
|
| 27 | - } |
|
| 18 | + /** |
|
| 19 | + * [handle description] |
|
| 20 | + * @param string $key |
|
| 21 | + * @param string $content |
|
| 22 | + * @return array |
|
| 23 | + */ |
|
| 24 | + public function handle($key, $content) |
|
| 25 | + { |
|
| 26 | + return $this->render->handle($key, "#!!" . $content . "!!#"); |
|
| 27 | + } |
|
| 28 | 28 | } |