Completed
Pull Request — master (#14)
by
unknown
03:04
created
Serializer/ArraySerializationVisitor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
             $this->root = $data;
44 44
         }
45 45
 
46
-        return (string)$data;
46
+        return (string) $data;
47 47
     }
48 48
 
49 49
     public function visitBoolean($data, array $type, Context $context)
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             $this->root = $data;
53 53
         }
54 54
 
55
-        return (boolean)$data;
55
+        return (boolean) $data;
56 56
     }
57 57
 
58 58
     public function visitInteger($data, array $type, Context $context)
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
             $this->root = $data;
62 62
         }
63 63
 
64
-        return (int)$data;
64
+        return (int) $data;
65 65
     }
66 66
 
67 67
     public function visitDouble($data, array $type, Context $context)
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             $this->root = $data;
71 71
         }
72 72
 
73
-        return (float)$data;
73
+        return (float) $data;
74 74
     }
75 75
 
76 76
     /**
Please login to merge, or discard this patch.
DependencyInjection/SerializationCacheCompilerPass.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,11 +43,11 @@
 block discarded – undo
43 43
 
44 44
             // Test that the Visitor classes in the config exist
45 45
             $vistorClasses = $config[self::CONFIG_NODE]['cached_visitors'];
46
-            foreach($vistorClasses as $class){
47
-                if(!class_exists($class)){
46
+            foreach ($vistorClasses as $class) {
47
+                if (!class_exists($class)) {
48 48
                     throw new \Exception("The class '$class' configured in smartbox_core.serialization_cache.cached_visitors does not exist.");
49 49
                 }
50
-                if(!property_exists($class, CacheEventsSubscriber::DATA_PROPERTY)){
50
+                if (!property_exists($class, CacheEventsSubscriber::DATA_PROPERTY)) {
51 51
                     throw new \Exception("The class '$class' configured in smartbox_core.serialization_cache.cached_visitors does not have the data property and can not be cached.");
52 52
                 }
53 53
             }
Please login to merge, or discard this patch.
Serializer/Cache/CacheEventsSubscriber.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
     const DATA_PROPERTY = 'data';
18 18
 
19 19
     /** @var array */
20
-    private $reflectors  = [];
20
+    private $reflectors = [];
21 21
 
22 22
     public function __construct(array $vistorClasses)
23 23
     {
24
-        foreach ($vistorClasses as $class){
24
+        foreach ($vistorClasses as $class) {
25 25
             $reflector = new \ReflectionProperty($class, self::DATA_PROPERTY);
26 26
             $reflector->setAccessible(true);
27 27
             $this->reflectors[$class] = $reflector;
@@ -49,14 +49,14 @@  discard block
 block discarded – undo
49 49
     {
50 50
         $data = $event->getObject();
51 51
 
52
-        if( !$data instanceof SerializerCacheableInterface ){
52
+        if (!$data instanceof SerializerCacheableInterface) {
53 53
             return;
54 54
         }
55 55
 
56 56
         $visitor = $event->getVisitor();
57 57
         $visitorClass = get_class($visitor);
58 58
 
59
-        if ( array_key_exists($visitorClass, $this->reflectors) ) {
59
+        if (array_key_exists($visitorClass, $this->reflectors)) {
60 60
             $key = CachedObjectHandler::getDataCacheKey($data, $event->getContext());
61 61
             if ($key !== null && $this->getCacheService()->exists($key, self::KEY_EXISTS_TIMEOUT)) {
62 62
                 $event->setType(CachedObjectHandler::TYPE);
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         $object = $event->getObject();
70 70
         $typeName = $event->getType()['name'];
71 71
 
72
-        if( $typeName === CachedObjectHandler::TYPE || !$object instanceof SerializerCacheableInterface ){
72
+        if ($typeName === CachedObjectHandler::TYPE || !$object instanceof SerializerCacheableInterface) {
73 73
             return;
74 74
         }
75 75
 
Please login to merge, or discard this patch.