Passed
Push — master ( 050f56...e249f1 )
by Alain
02:43
created
src/View.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
      */
90 90
     public static function getDefaultConfig()
91 91
     {
92
-        return ConfigFactory::create(__DIR__ . '/../config/defaults.php')
92
+        return ConfigFactory::create(__DIR__.'/../config/defaults.php')
93 93
                             ->getSubConfig('BrightNucleus\View');
94 94
     }
95 95
 
Please login to merge, or discard this patch.
Indentation   +91 added lines, -91 removed lines patch added patch discarded remove patch
@@ -28,104 +28,104 @@
 block discarded – undo
28 28
 class View
29 29
 {
30 30
 
31
-    /**
32
-     * ViewBuilder Instance.
33
-     *
34
-     * @since 0.1.0
35
-     *
36
-     * @var ViewBuilder
37
-     */
38
-    protected static $viewBuilder;
31
+	/**
32
+	 * ViewBuilder Instance.
33
+	 *
34
+	 * @since 0.1.0
35
+	 *
36
+	 * @var ViewBuilder
37
+	 */
38
+	protected static $viewBuilder;
39 39
 
40
-    /**
41
-     * Add a location to the ViewBuilder.
42
-     *
43
-     * @since 0.1.0
44
-     *
45
-     * @param LocationInterface $location Location to add.
46
-     */
47
-    public static function addLocation(LocationInterface $location)
48
-    {
49
-        $viewBuilder = static::getViewBuilder();
50
-        $viewBuilder->addLocation($location);
51
-    }
40
+	/**
41
+	 * Add a location to the ViewBuilder.
42
+	 *
43
+	 * @since 0.1.0
44
+	 *
45
+	 * @param LocationInterface $location Location to add.
46
+	 */
47
+	public static function addLocation(LocationInterface $location)
48
+	{
49
+		$viewBuilder = static::getViewBuilder();
50
+		$viewBuilder->addLocation($location);
51
+	}
52 52
 
53
-    /**
54
-     * Get the ViewBuilder instance.
55
-     *
56
-     * @since 0.1.0
57
-     *
58
-     * @return ViewBuilder
59
-     */
60
-    public static function getViewBuilder()
61
-    {
62
-        if (null === static::$viewBuilder) {
63
-            static::$viewBuilder = static::instantiateViewBuilder();
64
-        }
53
+	/**
54
+	 * Get the ViewBuilder instance.
55
+	 *
56
+	 * @since 0.1.0
57
+	 *
58
+	 * @return ViewBuilder
59
+	 */
60
+	public static function getViewBuilder()
61
+	{
62
+		if (null === static::$viewBuilder) {
63
+			static::$viewBuilder = static::instantiateViewBuilder();
64
+		}
65 65
 
66
-        return static::$viewBuilder;
67
-    }
66
+		return static::$viewBuilder;
67
+	}
68 68
 
69
-    /**
70
-     * Instantiate the ViewBuilder.
71
-     *
72
-     * @since 0.1.0
73
-     *
74
-     * @param ConfigInterface|null $config Optional. Configuration to pass into the ViewBuilder.
75
-     *
76
-     * @return ViewBuilder Instance of the ViewBuilder.
77
-     */
78
-    public static function instantiateViewBuilder(ConfigInterface $config = null)
79
-    {
80
-        return static::$viewBuilder = new ViewBuilder($config ?: static::getDefaultConfig());
81
-    }
69
+	/**
70
+	 * Instantiate the ViewBuilder.
71
+	 *
72
+	 * @since 0.1.0
73
+	 *
74
+	 * @param ConfigInterface|null $config Optional. Configuration to pass into the ViewBuilder.
75
+	 *
76
+	 * @return ViewBuilder Instance of the ViewBuilder.
77
+	 */
78
+	public static function instantiateViewBuilder(ConfigInterface $config = null)
79
+	{
80
+		return static::$viewBuilder = new ViewBuilder($config ?: static::getDefaultConfig());
81
+	}
82 82
 
83
-    /**
84
-     * Get the default configuration to inject into the ViewBuilder.
85
-     *
86
-     * @since 0.1.0
87
-     *
88
-     * @return ConfigInterface Default configuration.
89
-     */
90
-    public static function getDefaultConfig()
91
-    {
92
-        return ConfigFactory::create(__DIR__ . '/../config/defaults.php')
93
-                            ->getSubConfig('BrightNucleus\View');
94
-    }
83
+	/**
84
+	 * Get the default configuration to inject into the ViewBuilder.
85
+	 *
86
+	 * @since 0.1.0
87
+	 *
88
+	 * @return ConfigInterface Default configuration.
89
+	 */
90
+	public static function getDefaultConfig()
91
+	{
92
+		return ConfigFactory::create(__DIR__ . '/../config/defaults.php')
93
+							->getSubConfig('BrightNucleus\View');
94
+	}
95 95
 
96
-    /**
97
-     * Create a new view for a given URI.
98
-     *
99
-     * @since 0.1.0
100
-     *
101
-     * @param string      $view View identifier to create a view for.
102
-     * @param string|null $type Type of view to create.
103
-     *
104
-     * @return ViewInterface Instance of the requested view.
105
-     */
106
-    public static function create($view, $type = null)
107
-    {
108
-        $viewBuilder = static::getViewBuilder();
96
+	/**
97
+	 * Create a new view for a given URI.
98
+	 *
99
+	 * @since 0.1.0
100
+	 *
101
+	 * @param string      $view View identifier to create a view for.
102
+	 * @param string|null $type Type of view to create.
103
+	 *
104
+	 * @return ViewInterface Instance of the requested view.
105
+	 */
106
+	public static function create($view, $type = null)
107
+	{
108
+		$viewBuilder = static::getViewBuilder();
109 109
 
110
-        return $viewBuilder->create($view, $type);
111
-    }
110
+		return $viewBuilder->create($view, $type);
111
+	}
112 112
 
113
-    /**
114
-     * Render a view for a given URI.
115
-     *
116
-     * @since 0.1.0
117
-     *
118
-     * @param string      $view    View identifier to create a view for.
119
-     * @param array       $context Optional. The context in which to render the view.
120
-     * @param string|null $type    Type of view to create.
121
-     *
122
-     * @return string Rendered HTML content.
123
-     */
124
-    public static function render($view, array $context = [], $type = null)
125
-    {
126
-        $viewBuilder = static::getViewBuilder();
127
-        $viewObject  = $viewBuilder->create($view, $type);
113
+	/**
114
+	 * Render a view for a given URI.
115
+	 *
116
+	 * @since 0.1.0
117
+	 *
118
+	 * @param string      $view    View identifier to create a view for.
119
+	 * @param array       $context Optional. The context in which to render the view.
120
+	 * @param string|null $type    Type of view to create.
121
+	 *
122
+	 * @return string Rendered HTML content.
123
+	 */
124
+	public static function render($view, array $context = [], $type = null)
125
+	{
126
+		$viewBuilder = static::getViewBuilder();
127
+		$viewObject  = $viewBuilder->create($view, $type);
128 128
 
129
-        return $viewObject->render($context);
130
-    }
129
+		return $viewObject->render($context);
130
+	}
131 131
 }
Please login to merge, or discard this patch.
src/View/Engine/EngineInterface.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,15 +22,15 @@
 block discarded – undo
22 22
 interface EngineInterface
23 23
 {
24 24
 
25
-    /**
26
-     * Render a given URI.
27
-     *
28
-     * @since 0.1.0
29
-     *
30
-     * @param string $uri     URI to render.
31
-     * @param array  $context Context in which to render.
32
-     *
33
-     * @return string Rendered HTML.
34
-     */
35
-    public function render($uri, array $context = []);
25
+	/**
26
+	 * Render a given URI.
27
+	 *
28
+	 * @since 0.1.0
29
+	 *
30
+	 * @param string $uri     URI to render.
31
+	 * @param array  $context Context in which to render.
32
+	 *
33
+	 * @return string Rendered HTML.
34
+	 */
35
+	public function render($uri, array $context = []);
36 36
 }
Please login to merge, or discard this patch.
src/View/View/BaseView.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -22,17 +22,17 @@
 block discarded – undo
22 22
 class BaseView extends AbstractView
23 23
 {
24 24
 
25
-    /**
26
-     * Check whether the Findable can handle an individual criterion.
27
-     *
28
-     * @since 0.1.0
29
-     *
30
-     * @param mixed $criterion Criterion to check.
31
-     *
32
-     * @return bool Whether the Findable can handle the criterion.
33
-     */
34
-    public function canHandle($criterion)
35
-    {
36
-        return true;
37
-    }
25
+	/**
26
+	 * Check whether the Findable can handle an individual criterion.
27
+	 *
28
+	 * @since 0.1.0
29
+	 *
30
+	 * @param mixed $criterion Criterion to check.
31
+	 *
32
+	 * @return bool Whether the Findable can handle the criterion.
33
+	 */
34
+	public function canHandle($criterion)
35
+	{
36
+		return true;
37
+	}
38 38
 }
Please login to merge, or discard this patch.
src/View/Support/Findable.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -22,14 +22,14 @@
 block discarded – undo
22 22
 interface Findable
23 23
 {
24 24
 
25
-    /**
26
-     * Check whether the Findable can handle an individual criterion.
27
-     *
28
-     * @since 0.1.0
29
-     *
30
-     * @param mixed $criterion Criterion to check.
31
-     *
32
-     * @return bool Whether the Findable can handle the criterion.
33
-     */
34
-    public function canHandle($criterion);
25
+	/**
26
+	 * Check whether the Findable can handle an individual criterion.
27
+	 *
28
+	 * @since 0.1.0
29
+	 *
30
+	 * @param mixed $criterion Criterion to check.
31
+	 *
32
+	 * @return bool Whether the Findable can handle the criterion.
33
+	 */
34
+	public function canHandle($criterion);
35 35
 }
Please login to merge, or discard this patch.
src/View/Engine/NullEngine.php 1 patch
Indentation   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -24,32 +24,32 @@
 block discarded – undo
24 24
 class NullEngine implements EngineInterface, NullObject
25 25
 {
26 26
 
27
-    /**
28
-     * Check whether the Findable can handle an individual criterion.
29
-     *
30
-     * @since 0.1.0
31
-     *
32
-     * @param mixed $criterion Criterion to check.
33
-     *
34
-     * @return bool Whether the Findable can handle the criterion.
35
-     */
36
-    public function canHandle($criterion)
37
-    {
38
-        return true;
39
-    }
27
+	/**
28
+	 * Check whether the Findable can handle an individual criterion.
29
+	 *
30
+	 * @since 0.1.0
31
+	 *
32
+	 * @param mixed $criterion Criterion to check.
33
+	 *
34
+	 * @return bool Whether the Findable can handle the criterion.
35
+	 */
36
+	public function canHandle($criterion)
37
+	{
38
+		return true;
39
+	}
40 40
 
41
-    /**
42
-     * Render a given URI.
43
-     *
44
-     * @since 0.1.0
45
-     *
46
-     * @param string $uri     URI to render.
47
-     * @param array  $context Context in which to render.
48
-     *
49
-     * @return string Rendered HTML.
50
-     */
51
-    public function render($uri, array $context = [])
52
-    {
53
-        return '';
54
-    }
41
+	/**
42
+	 * Render a given URI.
43
+	 *
44
+	 * @since 0.1.0
45
+	 *
46
+	 * @param string $uri     URI to render.
47
+	 * @param array  $context Context in which to render.
48
+	 *
49
+	 * @return string Rendered HTML.
50
+	 */
51
+	public function render($uri, array $context = [])
52
+	{
53
+		return '';
54
+	}
55 55
 }
Please login to merge, or discard this patch.
src/View/Support/FinderInterface.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -22,23 +22,23 @@
 block discarded – undo
22 22
 interface FinderInterface
23 23
 {
24 24
 
25
-    /**
26
-     * Find a result based on a specific criteria.
27
-     *
28
-     * @since 0.1.0
29
-     *
30
-     * @param array $criteria Criteria to search for.
31
-     *
32
-     * @return mixed Result of the search.
33
-     */
34
-    public function find(array $criteria);
25
+	/**
26
+	 * Find a result based on a specific criteria.
27
+	 *
28
+	 * @since 0.1.0
29
+	 *
30
+	 * @param array $criteria Criteria to search for.
31
+	 *
32
+	 * @return mixed Result of the search.
33
+	 */
34
+	public function find(array $criteria);
35 35
 
36
-    /**
37
-     * Get the NullObject.
38
-     *
39
-     * @since 0.1.1
40
-     *
41
-     * @return NullObject NullObject for the current Finder.
42
-     */
43
-    public function getNullObject();
36
+	/**
37
+	 * Get the NullObject.
38
+	 *
39
+	 * @since 0.1.1
40
+	 *
41
+	 * @return NullObject NullObject for the current Finder.
42
+	 */
43
+	public function getNullObject();
44 44
 }
Please login to merge, or discard this patch.
src/View/Support/AbstractFinder.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -146,7 +146,7 @@
 block discarded – undo
146 146
      */
147 147
     protected function initializeNullObject()
148 148
     {
149
-        if (! is_object($this->nullObject)) {
149
+        if ( ! is_object($this->nullObject)) {
150 150
             $this->nullObject = new $this->nullObject();
151 151
         }
152 152
     }
Please login to merge, or discard this patch.
Indentation   +113 added lines, -113 removed lines patch added patch discarded remove patch
@@ -26,128 +26,128 @@
 block discarded – undo
26 26
 abstract class AbstractFinder implements FinderInterface
27 27
 {
28 28
 
29
-    use ConfigTrait;
29
+	use ConfigTrait;
30 30
 
31
-    /**
32
-     * Array of Findables that the Finder can iterate through to find a match.
33
-     *
34
-     * @since 0.1.0
35
-     *
36
-     * @var Findable[]
37
-     */
38
-    protected $findables;
31
+	/**
32
+	 * Array of Findables that the Finder can iterate through to find a match.
33
+	 *
34
+	 * @since 0.1.0
35
+	 *
36
+	 * @var Findable[]
37
+	 */
38
+	protected $findables;
39 39
 
40
-    /**
41
-     * NullObject that is returned if the Finder could not find a match.
42
-     *
43
-     * @since 0.1.0
44
-     *
45
-     * @var NullObject
46
-     */
47
-    protected $nullObject;
40
+	/**
41
+	 * NullObject that is returned if the Finder could not find a match.
42
+	 *
43
+	 * @since 0.1.0
44
+	 *
45
+	 * @var NullObject
46
+	 */
47
+	protected $nullObject;
48 48
 
49
-    /**
50
-     * Instantiate an AbstractFinder object.
51
-     *
52
-     * @since 0.1.0
53
-     *
54
-     * @param ConfigInterface $config Configuration of the EngineFinder.
55
-     *
56
-     * @throws FailedToProcessConfigException If the config could not be processed.
57
-     */
58
-    public function __construct(ConfigInterface $config)
59
-    {
60
-        $this->processConfig($config);
61
-        $this->registerFindables($this->config);
62
-        $this->registerNullObject($this->config);
63
-    }
49
+	/**
50
+	 * Instantiate an AbstractFinder object.
51
+	 *
52
+	 * @since 0.1.0
53
+	 *
54
+	 * @param ConfigInterface $config Configuration of the EngineFinder.
55
+	 *
56
+	 * @throws FailedToProcessConfigException If the config could not be processed.
57
+	 */
58
+	public function __construct(ConfigInterface $config)
59
+	{
60
+		$this->processConfig($config);
61
+		$this->registerFindables($this->config);
62
+		$this->registerNullObject($this->config);
63
+	}
64 64
 
65
-    /**
66
-     * Register the Findables defined in the given configuration.
67
-     *
68
-     * @since 0.1.0
69
-     *
70
-     * @param ConfigInterface $config Configuration to register the Findables from.
71
-     */
72
-    public function registerFindables(ConfigInterface $config)
73
-    {
74
-        foreach ($config->getKey($this->getFindablesConfigKey()) as $findableKey => $findableObject) {
75
-            $this->registerFindable($findableKey, $findableObject);
76
-        }
77
-    }
65
+	/**
66
+	 * Register the Findables defined in the given configuration.
67
+	 *
68
+	 * @since 0.1.0
69
+	 *
70
+	 * @param ConfigInterface $config Configuration to register the Findables from.
71
+	 */
72
+	public function registerFindables(ConfigInterface $config)
73
+	{
74
+		foreach ($config->getKey($this->getFindablesConfigKey()) as $findableKey => $findableObject) {
75
+			$this->registerFindable($findableKey, $findableObject);
76
+		}
77
+	}
78 78
 
79
-    /**
80
-     * Register the NullObject defined in the given configuration.
81
-     *
82
-     * @since 0.1.0
83
-     *
84
-     * @param ConfigInterface $config Configuration to register the NullObject from.
85
-     */
86
-    public function registerNullObject(ConfigInterface $config)
87
-    {
88
-        $this->nullObject = $config->getKey($this->getNullObjectConfigKey());
89
-    }
79
+	/**
80
+	 * Register the NullObject defined in the given configuration.
81
+	 *
82
+	 * @since 0.1.0
83
+	 *
84
+	 * @param ConfigInterface $config Configuration to register the NullObject from.
85
+	 */
86
+	public function registerNullObject(ConfigInterface $config)
87
+	{
88
+		$this->nullObject = $config->getKey($this->getNullObjectConfigKey());
89
+	}
90 90
 
91
-    /**
92
-     * Get the NullObject.
93
-     *
94
-     * @since 0.1.1
95
-     *
96
-     * @return NullObject NullObject for the current Finder.
97
-     */
98
-    public function getNullObject()
99
-    {
100
-        $this->initializeNullObject();
91
+	/**
92
+	 * Get the NullObject.
93
+	 *
94
+	 * @since 0.1.1
95
+	 *
96
+	 * @return NullObject NullObject for the current Finder.
97
+	 */
98
+	public function getNullObject()
99
+	{
100
+		$this->initializeNullObject();
101 101
 
102
-        return $this->nullObject;
103
-    }
102
+		return $this->nullObject;
103
+	}
104 104
 
105
-    /**
106
-     * Register a single Findable.
107
-     *
108
-     * @since 0.1.0
109
-     *
110
-     * @param string $key      Key used to reference the Findable.
111
-     * @param mixed  $findable Findable as a FQCN, callable or object.
112
-     */
113
-    protected function registerFindable($key, $findable)
114
-    {
115
-        $this->findables[$key] = $findable;
116
-    }
105
+	/**
106
+	 * Register a single Findable.
107
+	 *
108
+	 * @since 0.1.0
109
+	 *
110
+	 * @param string $key      Key used to reference the Findable.
111
+	 * @param mixed  $findable Findable as a FQCN, callable or object.
112
+	 */
113
+	protected function registerFindable($key, $findable)
114
+	{
115
+		$this->findables[$key] = $findable;
116
+	}
117 117
 
118
-    /**
119
-     * Get the config key for the Findables definitions.
120
-     *
121
-     * @since 0.1.0
122
-     *
123
-     * @return string Config key use to define the Findables.
124
-     */
125
-    protected function getFindablesConfigKey()
126
-    {
127
-        return 'Findables';
128
-    }
118
+	/**
119
+	 * Get the config key for the Findables definitions.
120
+	 *
121
+	 * @since 0.1.0
122
+	 *
123
+	 * @return string Config key use to define the Findables.
124
+	 */
125
+	protected function getFindablesConfigKey()
126
+	{
127
+		return 'Findables';
128
+	}
129 129
 
130
-    /**
131
-     * Get the config key for the NullObject definitions.
132
-     *
133
-     * @since 0.1.0
134
-     *
135
-     * @return string Config key use to define the NullObject.
136
-     */
137
-    protected function getNullObjectConfigKey()
138
-    {
139
-        return 'NullObject';
140
-    }
130
+	/**
131
+	 * Get the config key for the NullObject definitions.
132
+	 *
133
+	 * @since 0.1.0
134
+	 *
135
+	 * @return string Config key use to define the NullObject.
136
+	 */
137
+	protected function getNullObjectConfigKey()
138
+	{
139
+		return 'NullObject';
140
+	}
141 141
 
142
-    /**
143
-     * Initialize the NullObject.
144
-     *
145
-     * @since 0.1.1
146
-     */
147
-    protected function initializeNullObject()
148
-    {
149
-        if (! is_object($this->nullObject)) {
150
-            $this->nullObject = new $this->nullObject();
151
-        }
152
-    }
142
+	/**
143
+	 * Initialize the NullObject.
144
+	 *
145
+	 * @since 0.1.1
146
+	 */
147
+	protected function initializeNullObject()
148
+	{
149
+		if (! is_object($this->nullObject)) {
150
+			$this->nullObject = new $this->nullObject();
151
+		}
152
+	}
153 153
 }
Please login to merge, or discard this patch.
src/View/View/NullView.php 2 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -24,20 +24,20 @@
 block discarded – undo
24 24
 class NullView implements ViewInterface, NullObject
25 25
 {
26 26
 
27
-    /**
28
-     * Render the view.
29
-     *
30
-     * @since 0.1.0
31
-     *
32
-     * @param array $context Optional. The context in which to render the view.
33
-     * @param bool  $echo    Optional. Whether to echo the output immediately. Defaults to false.
34
-     *
35
-     * @return string|void Rendered HTML or nothing, depending on $echo argument.
36
-     */
37
-    public function render(array $context = [], $echo = false)
38
-    {
39
-        if (! $echo) {
40
-            return '';
41
-        }
42
-    }
27
+	/**
28
+	 * Render the view.
29
+	 *
30
+	 * @since 0.1.0
31
+	 *
32
+	 * @param array $context Optional. The context in which to render the view.
33
+	 * @param bool  $echo    Optional. Whether to echo the output immediately. Defaults to false.
34
+	 *
35
+	 * @return string|void Rendered HTML or nothing, depending on $echo argument.
36
+	 */
37
+	public function render(array $context = [], $echo = false)
38
+	{
39
+		if (! $echo) {
40
+			return '';
41
+		}
42
+	}
43 43
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
      */
37 37
     public function render(array $context = [], $echo = false)
38 38
     {
39
-        if (! $echo) {
39
+        if ( ! $echo) {
40 40
             return '';
41 41
         }
42 42
     }
Please login to merge, or discard this patch.
src/View/View/ViewFinderInterface.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -25,15 +25,15 @@
 block discarded – undo
25 25
 interface ViewFinderInterface extends FinderInterface
26 26
 {
27 27
 
28
-    /**
29
-     * Find a result based on a specific criteria.
30
-     *
31
-     * @since 0.1.0
32
-     *
33
-     * @param array                $criteria Criteria to search for.
34
-     * @param EngineInterface|null $engine   Optional. Engine to use with the view.
35
-     *
36
-     * @return ViewInterface View that was found.
37
-     */
38
-    public function find(array $criteria, EngineInterface $engine = null);
28
+	/**
29
+	 * Find a result based on a specific criteria.
30
+	 *
31
+	 * @since 0.1.0
32
+	 *
33
+	 * @param array                $criteria Criteria to search for.
34
+	 * @param EngineInterface|null $engine   Optional. Engine to use with the view.
35
+	 *
36
+	 * @return ViewInterface View that was found.
37
+	 */
38
+	public function find(array $criteria, EngineInterface $engine = null);
39 39
 }
Please login to merge, or discard this patch.