Test Setup Failed
Push — develop ( 175c43...8626a8 )
by Carsten
05:34
created
src/WorldFilterIterator.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@  discard block
 block discarded – undo
5 5
 {
6 6
     public $world_id;
7 7
 
8
-    public function __construct(\Traversable $iterator , WorldInterface $world)
8
+    public function __construct(\Traversable $iterator, WorldInterface $world)
9 9
     {
10
-        parent::__construct( $iterator instanceOf \IteratorAggregate ? $iterator->getIterator() : $iterator);
10
+        parent::__construct($iterator instanceOf \IteratorAggregate ? $iterator->getIterator() : $iterator);
11 11
 
12 12
         $this->world_id = $world->getId();
13 13
     }
@@ -16,6 +16,6 @@  discard block
 block discarded – undo
16 16
     {
17 17
         $current = $this->getInnerIterator()->current();
18 18
         return ($current instanceOf WorldsProviderInterface
19
-            and $current->getWorlds()->has( $this->world_id ));
19
+            and $current->getWorlds()->has($this->world_id));
20 20
     }
21 21
 }
Please login to merge, or discard this patch.
src/WorldsProviderInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,5 +4,5 @@
 block discarded – undo
4 4
 interface WorldsProviderInterface
5 5
 {
6 6
     public function getWorlds();
7
-    public function setWorlds( WorldsInterface $worlds);
7
+    public function setWorlds(WorldsInterface $worlds);
8 8
 }
Please login to merge, or discard this patch.
src/PdoWorlds.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
      * @param WorldInterface|null $world        WorldsInterface instance result template (optional)
15 15
      * @param [type]              $worlds_table Custom table name (optional)
16 16
      */
17
-    public function __construct( \PDO $pdo, WorldInterface $world = null, $worlds_table = null )
17
+    public function __construct(\PDO $pdo, WorldInterface $world = null, $worlds_table = null)
18 18
     {
19 19
         $this->worlds = new \ArrayObject;
20 20
         $this->worlds_table = $worlds_table ?: $this->worlds_table;
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
         FROM {$this->worlds_table}
32 32
         WHERE is_active > 0";
33 33
 
34
-        $stmt = $pdo->prepare( $sql );
34
+        $stmt = $pdo->prepare($sql);
35 35
 
36
-        $stmt->setFetchMode( \PDO::FETCH_CLASS, $world ? get_class($world) : World::class );
36
+        $stmt->setFetchMode(\PDO::FETCH_CLASS, $world ? get_class($world) : World::class);
37 37
 
38 38
         if (!$stmt->execute()):
39 39
             throw new DatabaseException("Could not retrieve Worlds from database");
Please login to merge, or discard this patch.
src/Worlds.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     public $worlds = array();
10 10
 
11 11
 
12
-    public function push( WorldInterface $world )
12
+    public function push(WorldInterface $world)
13 13
     {
14 14
         $this->worlds[ $world->getId() ] = $world;
15 15
         return $this;
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
      * @implements ContainerInterface
20 20
      * @return WorldInterface
21 21
      */
22
-    public function get( $id_or_slug )
22
+    public function get($id_or_slug)
23 23
     {
24
-        $filter = function( $world, $id ) use ($id_or_slug) {
24
+        $filter = function($world, $id) use ($id_or_slug) {
25 25
             return ($world->getId() == $id_or_slug
26 26
             or $world->getSlug() == $id_or_slug);
27 27
         };
28 28
 
29
-        $worlds = new \CallbackFilterIterator( $this->getIterator(), $filter);
29
+        $worlds = new \CallbackFilterIterator($this->getIterator(), $filter);
30 30
         $worlds->rewind();
31 31
         if ($worlds->valid()):
32 32
             return $worlds->current();
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      * @implements ContainerInterface
42 42
      * @return boolean
43 43
      */
44
-    public function has ($id_or_slug )
44
+    public function has($id_or_slug)
45 45
     {
46 46
         foreach ($this->worlds as $world) {
47 47
             if ($world->getId() == $id_or_slug
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,8 +30,10 @@
 block discarded – undo
30 30
         $worlds->rewind();
31 31
         if ($worlds->valid()):
32 32
             return $worlds->current();
33
-        else:
33
+        else {
34
+            :
34 35
             throw new WorldNotFoundException("Could not find product world with ID or slug '$id_or_slug'");
36
+        }
35 37
         endif;
36 38
     }
37 39
 
Please login to merge, or discard this patch.
src/World.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,35 +4,35 @@
 block discarded – undo
4 4
 class World extends WorldAbstract implements WorldInterface
5 5
 {
6 6
 
7
-    public function setId( $id )
7
+    public function setId($id)
8 8
     {
9 9
         $this->id = $id;
10 10
         return $this;
11 11
     }
12 12
 
13 13
 
14
-    public function setName( $name )
14
+    public function setName($name)
15 15
     {
16 16
         $this->name = $name;
17 17
         return $this;
18 18
     }
19 19
 
20 20
 
21
-    public function setSlug( $slug )
21
+    public function setSlug($slug)
22 22
     {
23 23
         $this->slug = $slug;
24 24
         return $this;
25 25
     }
26 26
 
27 27
 
28
-    public function setDescription( $description )
28
+    public function setDescription($description)
29 29
     {
30 30
         $this->description = $description;
31 31
         return $this;
32 32
     }
33 33
 
34 34
 
35
-    public function setPhoto( $photo )
35
+    public function setPhoto($photo)
36 36
     {
37 37
         $this->photo = $photo;
38 38
         return $this;
Please login to merge, or discard this patch.
src/PimpleServiceProvider.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@  discard block
 block discarded – undo
20 20
     /**
21 21
      * @param array|null $config Service Configuration
22 22
      */
23
-    public function __construct( array $config = array() )
23
+    public function __construct(array $config = array())
24 24
     {
25
-        $this->config = array_merge($this->config, $config );
25
+        $this->config = array_merge($this->config, $config);
26 26
     }
27 27
 
28 28
 
@@ -35,14 +35,14 @@  discard block
 block discarded – undo
35 35
         /**
36 36
          * @return array
37 37
          */
38
-        $dic['Worlds.Config'] = function( $dic ) {
38
+        $dic[ 'Worlds.Config' ] = function($dic) {
39 39
             return $this->config;
40 40
         };
41 41
 
42 42
         /**
43 43
          * @return PDO
44 44
          */
45
-        $dic['Worlds.PDO'] = function( $dic ) {
45
+        $dic[ 'Worlds.PDO' ] = function($dic) {
46 46
             return null;
47 47
         };
48 48
 
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
         /**
51 51
          * @return PdoWorlds
52 52
          */
53
-        $dic['Worlds.All'] = function( $dic ) {
54
-            $worlds_config = $dic['Worlds.Config'];
55
-            $worlds_table  = $worlds_config['worlds_table'];
53
+        $dic[ 'Worlds.All' ] = function($dic) {
54
+            $worlds_config = $dic[ 'Worlds.Config' ];
55
+            $worlds_table  = $worlds_config[ 'worlds_table' ];
56 56
 
57
-            $pdo           = $dic['Worlds.PDO' ];
58
-            return new PdoWorlds( $pdo, null, $worlds_table );
57
+            $pdo           = $dic[ 'Worlds.PDO' ];
58
+            return new PdoWorlds($pdo, null, $worlds_table);
59 59
         };
60 60
 
61 61
 
Please login to merge, or discard this patch.
src/WorldsInterface.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,5 +6,5 @@
 block discarded – undo
6 6
 
7 7
 interface WorldsInterface extends \IteratorAggregate, \Countable, ContainerInterface, InteropContainerInterface
8 8
 {
9
-    public function push( WorldInterface $world );
9
+    public function push(WorldInterface $world);
10 10
 }
Please login to merge, or discard this patch.