Test Setup Failed
Push — master ( 801e50...18c44f )
by Chauncey
02:21
created
src/Charcoal/Model/ModelValidator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 
21 21
         $ret = true;
22 22
         foreach ($props as $ident => $p) {
23
-            if (!$p ||  !$p->active()) {
23
+            if (!$p || !$p->active()) {
24 24
                 continue;
25 25
             }
26 26
             $valid = $p->validate();
Please login to merge, or discard this patch.
src/Charcoal/Model/AbstractModel.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -171,7 +171,7 @@
 block discarded – undo
171 171
     public function propertyValue($propertyIdent)
172 172
     {
173 173
         $getter = $this->getter($propertyIdent);
174
-        $func   = [ $this, $getter ];
174
+        $func   = [$this, $getter];
175 175
 
176 176
         if (is_callable($func)) {
177 177
             return call_user_func($func);
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -92,7 +92,7 @@
 block discarded – undo
92 92
 
93 93
         // Optional StorableInterface dependencies
94 94
         if (isset($data['source'])) {
95
-             $this->setSource($data['source']);
95
+                $this->setSource($data['source']);
96 96
         }
97 97
         if (isset($data['source_factory'])) {
98 98
             $this->setSourceFactory($data['source_factory']);
Please login to merge, or discard this patch.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
      * Also add a special case, to merge values for l10n properties.
196 196
      *
197 197
      * @param array|\Traversable $data The data to merge.
198
-     * @return EntityInterface Chainable
198
+     * @return AbstractModel Chainable
199 199
      * @see \Charcoal\Config\AbstractEntity::offsetSet()
200 200
      */
201 201
     public function mergeData($data)
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
      * ValidatableInterface > create_validator().
523 523
      *
524 524
      * @param array $data Optional.
525
-     * @return ValidatorInterface
525
+     * @return ModelValidator
526 526
      */
527 527
     protected function createValidator(array $data = null)
528 528
     {
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 
536 536
     /**
537 537
      * @param array $data Optional. View data.
538
-     * @return ViewInterface
538
+     * @return GenericView
539 539
      */
540 540
     public function createView(array $data = null)
541 541
     {
Please login to merge, or discard this patch.
src/Charcoal/Source/AbstractSource.php 3 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -186,7 +186,7 @@
 block discarded – undo
186 186
                 'Property must be a string.'
187 187
             );
188 188
         }
189
-        if ($property=='') {
189
+        if ($property == '') {
190 190
             throw new InvalidArgumentException(
191 191
                 'Property can not be empty.'
192 192
             );
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,6 @@
 block discarded – undo
15 15
 
16 16
 // From 'charcoal-core'
17 17
 use Charcoal\Model\ModelInterface;
18
-
19 18
 use Charcoal\Source\SourceConfig;
20 19
 use Charcoal\Source\SourceInterface;
21 20
 use Charcoal\Source\Filter;
Please login to merge, or discard this patch.
Doc Comments   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      * If no properties are set, it is assumed that all the Model's properties are to be fetched.
154 154
      *
155 155
      * @param array $properties The properties.
156
-     * @return ColelectionLoader Chainable
156
+     * @return AbstractSource Chainable
157 157
      */
158 158
     public function setProperties(array $properties)
159 159
     {
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 
284 284
     /**
285 285
      * @param array $orders The orders to set.
286
-     * @return CollectionLoader Chainable
286
+     * @return AbstractSource Chainable
287 287
      */
288 288
     public function setOrders(array $orders)
289 289
     {
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
     /**
405 405
      * @param integer $page The page number.
406 406
      * @throws InvalidArgumentException If the page argument is not numeric.
407
-     * @return CollectionLoader Chainable
407
+     * @return AbstractSource Chainable
408 408
      */
409 409
     public function setPage($page)
410 410
     {
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
     /**
429 429
      * @param integer $num The number of items to retrieve per page.
430 430
      * @throws InvalidArgumentException If the num per page argument is not numeric.
431
-     * @return CollectionLoader Chainable
431
+     * @return AbstractSource Chainable
432 432
      */
433 433
     public function setNumPerPage($num)
434 434
     {
Please login to merge, or discard this patch.
src/Charcoal/Source/Pagination.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -115,6 +115,6 @@
 block discarded – undo
115 115
     {
116 116
         $first = $this->first();
117 117
         $numPerPage = $this->numPerPage();
118
-        return ($first + $numPerPage);
118
+        return ($first+$numPerPage);
119 119
     }
120 120
 }
Please login to merge, or discard this patch.
src/Charcoal/Source/Filter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -316,7 +316,7 @@
 block discarded – undo
316 316
             '>', '>=', '<', '<=',
317 317
             'IS NULL', 'IS NOT NULL',
318 318
             '%', 'MOD',
319
-            'IN','NOT IN',
319
+            'IN', 'NOT IN',
320 320
             'REGEXP', 'NOT REGEXP'
321 321
         ];
322 322
 
Please login to merge, or discard this patch.
src/Charcoal/Source/DatabaseSourceConfig.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -178,7 +178,7 @@
 block discarded – undo
178 178
     }
179 179
 
180 180
     /**
181
-     * @return bools
181
+     * @return boolean
182 182
      */
183 183
     public function disableUtf8()
184 184
     {
Please login to merge, or discard this patch.
src/Charcoal/Model/ServiceProvider/ModelServiceProvider.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -56,10 +56,10 @@  discard block
 block discarded – undo
56 56
          * @param Container $container A Pimple DI container instance.
57 57
          * @return ModelFactory
58 58
          */
59
-        $container['model/factory'] = function (Container $container) {
59
+        $container['model/factory'] = function(Container $container) {
60 60
             return new Factory([
61 61
                 'base_class' => ModelInterface::class,
62
-                'arguments'  => [ $container['model/dependencies'] ]
62
+                'arguments'  => [$container['model/dependencies']]
63 63
             ]);
64 64
         };
65 65
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
          * @param Container $container A Pimple DI container instance.
68 68
          * @return ModelBuilder
69 69
          */
70
-        $container['model/builder'] = function (Container $container) {
70
+        $container['model/builder'] = function(Container $container) {
71 71
             return new ModelBuilder([
72 72
                 'factory'           => $container['model/factory'],
73 73
                 'metadata_loader'   => $container['metadata/loader'],
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
          * @param Container $container A Pimple DI container instance.
80 80
          * @return ModelLoaderBuilder
81 81
          */
82
-        $container['model/loader/builder'] = function (Container $container) {
82
+        $container['model/loader/builder'] = function(Container $container) {
83 83
             return new ModelLoaderBuilder([
84 84
                 'factory' => $container['model/factory'],
85 85
                 'cache'     => $container['cache']
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
          * @param Container $container A Pimple DI container instance.
91 91
          * @return CollectionLoader
92 92
          */
93
-        $container['model/collection/loader'] = $container->factory(function (Container $container) {
93
+        $container['model/collection/loader'] = $container->factory(function(Container $container) {
94 94
             $factory = $container['model/collection/loader/factory'];
95 95
             return $factory->create($factory->defaultClass());
96 96
         });
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
          * @param Container $container A Pimple DI container instance.
100 100
          * @return FactoryInterface
101 101
          */
102
-        $container['model/collection/loader/factory'] = function (Container $container) {
102
+        $container['model/collection/loader/factory'] = function(Container $container) {
103 103
             return new Factory([
104 104
                 'default_class' => CollectionLoader::class,
105 105
                 'arguments'     => [[
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
          * @param Container $container A Pimple DI container instance.
115 115
          * @return ArrayAccess|\Traversable
116 116
          */
117
-        $container['model/collection'] = $container->factory(function (Container $container) {
117
+        $container['model/collection'] = $container->factory(function(Container $container) {
118 118
             return new $container['model/collection/class'];
119 119
         });
120 120
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
              * @param Container $container A Pimple DI container instance.
135 135
              * @return array The model dependencies array.
136 136
              */
137
-            $container['model/dependencies'] = function (Container $container) {
137
+            $container['model/dependencies'] = function(Container $container) {
138 138
                 return [
139 139
                     'container'        => $container,
140 140
                     'logger'           => $container['logger'],
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
              * @param Container $container A Pimple DI container instance.
153 153
              * @return \Charcoal\Factory\FactoryInterface
154 154
              */
155
-            $container['property/factory'] = function (Container $container) {
155
+            $container['property/factory'] = function(Container $container) {
156 156
                 return new Factory([
157 157
                     'base_class'       => PropertyInterface::class,
158 158
                     'default_class'    => GenericProperty::class,
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
              * @param Container $container A Pimple DI container instance.
174 174
              * @return MetadataLoader
175 175
              */
176
-            $container['metadata/loader'] = function (Container $container) {
176
+            $container['metadata/loader'] = function(Container $container) {
177 177
                 return new MetadataLoader([
178 178
                     'logger'    => $container['logger'],
179 179
                     'cache'     => $container['cache'],
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
              * @param Container $container A Pimple DI container instance.
189 189
              * @return \Charcoal\Factory\FactoryInterface
190 190
              */
191
-            $container['source/factory'] = function (Container $container) {
191
+            $container['source/factory'] = function(Container $container) {
192 192
                 return new Factory([
193 193
                     'map' => [
194 194
                         'database' => DatabaseSource::class
Please login to merge, or discard this patch.
src/Charcoal/Model/Collection.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
     /**
37 37
      * Create a new collection.
38 38
      *
39
-     * @param  array|Traversable|null $objs Array of objects to pre-populate this collection.
39
+     * @param  Collection $objs Array of objects to pre-populate this collection.
40 40
      * @return void
41 41
      */
42 42
     public function __construct($objs = null)
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     /**
215 215
      * Retrieve the primary keys of the objects in the collection.
216 216
      *
217
-     * @return array A sequential array of keys.
217
+     * @return integer[] A sequential array of keys.
218 218
      */
219 219
     public function keys()
220 220
     {
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
     {
317 317
         if (is_int($offset)) {
318 318
             if ($offset < 0) {
319
-                $offset = ($this->count() - abs($offset));
319
+                $offset = ($this->count()-abs($offset));
320 320
             }
321 321
         }
322 322
 
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
         } elseif ($value instanceof Traversable) {
449 449
             return iterator_to_array($value);
450 450
         } elseif ($value instanceof ModelInterface) {
451
-            return [ $value ];
451
+            return [$value];
452 452
         }
453 453
 
454 454
         return (array)$value;
Please login to merge, or discard this patch.
src/Charcoal/Model/Service/MetadataLoader.php 2 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
      * Validate a resolved path.
242 242
      *
243 243
      * @param  string $path The path to validate.
244
-     * @return string
244
+     * @return boolean
245 245
      */
246 246
     private function validatePath($path)
247 247
     {
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
     /**
456 456
      * Load the contents of a JSON file.
457 457
      *
458
-     * @param  mixed $filename The file path to retrieve.
458
+     * @param  string $filename The file path to retrieve.
459 459
      * @throws InvalidArgumentException If a JSON decoding error occurs.
460 460
      * @return array|null
461 461
      */
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
         $classname = $this->identToClassname($ident);
384 384
 
385 385
         if (!class_exists($classname) && !interface_exists($classname)) {
386
-            return [ $ident ];
386
+            return [$ident];
387 387
         }
388 388
 
389 389
         $classes   = array_values(class_parents($classname));
@@ -510,7 +510,7 @@  discard block
 block discarded – undo
510 510
      */
511 511
     private function filenameFromIdent($ident)
512 512
     {
513
-        $filename  = str_replace([ '\\' ], '.', $ident);
513
+        $filename  = str_replace(['\\'], '.', $ident);
514 514
         $filename .= '.json';
515 515
 
516 516
         return $filename;
Please login to merge, or discard this patch.