Completed
Push — master ( 4f84cc...331858 )
by Oleg
02:30
created
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/VariantResults.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
                 case 'value': $this->setValue($value); break;
89 89
                 case 'variation_id': $this->setVariationId($value); break;
90 90
                 default:
91
-                    throw new Exception('Unknown option: ' . $name);
91
+                    throw new Exception('Unknown option: '.$name);
92 92
             }
93 93
         }
94 94
     }
@@ -101,11 +101,11 @@  discard block
 block discarded – undo
101 101
         $options = array(
102 102
             'experiment_id' => $this->getExperimentId(),
103 103
             'is_baseline' => $this->getIsBaseline(),
104
-            'lift' => $this->getLift()?$this->getLift()->toArray():null,
104
+            'lift' => $this->getLift() ? $this->getLift()->toArray() : null,
105 105
             'name' => $this->getName(),
106 106
             'rate' => $this->getRate(),
107 107
             'scope' => $this->getScope(),
108
-            'total_increase' => $this->getTotalIncrease()?$this->getTotalIncrease()->toArray():null,
108
+            'total_increase' => $this->getTotalIncrease() ? $this->getTotalIncrease()->toArray() : null,
109 109
             'value' => $this->getValue(),
110 110
             'variation_id' => $this->getVariationId()
111 111
         );
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
         // Remove options with empty values
114 114
         $cleanedOptions = array();
115 115
         foreach ($options as $name=>$value) {
116
-            if ($value!==null)
116
+            if ($value !== null)
117 117
                 $cleanedOptions[$name] = $value;
118 118
         }
119 119
         
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
91 91
         // Remove options with empty values
92 92
         $cleanedOptions = array();
93 93
         foreach ($options as $name=>$value) {
94
-            if ($value!==null)
95
-                $cleanedOptions[$name] = $value;
94
+            if ($value!==null) {
95
+                            $cleanedOptions[$name] = $value;
96
+            }
96 97
         }
97 98
         
98 99
         return $cleanedOptions;
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/EventFilter.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                 case 'filter_type': $this->setFilterType($value); break;
36 36
                 case 'selector': $this->setSelector($value); break;
37 37
                 default:
38
-                    throw new Exception('Unknown option: ' . $name);
38
+                    throw new Exception('Unknown option: '.$name);
39 39
             }
40 40
         }
41 41
     }
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         // Remove options with empty values
54 54
         $cleanedOptions = array();
55 55
         foreach ($options as $name=>$value) {
56
-            if ($value!==null)
56
+            if ($value !== null)
57 57
                 $cleanedOptions[$name] = $value;
58 58
         }
59 59
         
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
91 91
         // Remove options with empty values
92 92
         $cleanedOptions = array();
93 93
         foreach ($options as $name=>$value) {
94
-            if ($value!==null)
95
-                $cleanedOptions[$name] = $value;
94
+            if ($value!==null) {
95
+                            $cleanedOptions[$name] = $value;
96
+            }
96 97
         }
97 98
         
98 99
         return $cleanedOptions;
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Variation.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                 case 'variation_id': $this->setVariationId($value); break;
72 72
                 case 'weight': $this->setWeight($value); break;
73 73
                 default:
74
-                    throw new Exception('Unknown option: ' . $name);
74
+                    throw new Exception('Unknown option: '.$name);
75 75
             }
76 76
         }
77 77
     }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         // Remove options with empty values
98 98
         $cleanedOptions = array();
99 99
         foreach ($options as $name=>$value) {
100
-            if ($value!==null)
100
+            if ($value !== null)
101 101
                 $cleanedOptions[$name] = $value;
102 102
         }
103 103
         
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
91 91
         // Remove options with empty values
92 92
         $cleanedOptions = array();
93 93
         foreach ($options as $name=>$value) {
94
-            if ($value!==null)
95
-                $cleanedOptions[$name] = $value;
94
+            if ($value!==null) {
95
+                            $cleanedOptions[$name] = $value;
96
+            }
96 97
         }
97 98
         
98 99
         return $cleanedOptions;
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/ExperimentVariationReach.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                     break;                
72 72
                 }
73 73
                 default:
74
-                    throw new Exception('Unknown option: ' . $name);
74
+                    throw new Exception('Unknown option: '.$name);
75 75
             }
76 76
         }
77 77
     }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         // Remove options with empty values
98 98
         $cleanedOptions = array();
99 99
         foreach ($options as $name=>$value) {
100
-            if ($value!==null)
100
+            if ($value !== null)
101 101
                 $cleanedOptions[$name] = $value;
102 102
         }
103 103
         
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
91 91
         // Remove options with empty values
92 92
         $cleanedOptions = array();
93 93
         foreach ($options as $name=>$value) {
94
-            if ($value!==null)
95
-                $cleanedOptions[$name] = $value;
94
+            if ($value!==null) {
95
+                            $cleanedOptions[$name] = $value;
96
+            }
96 97
         }
97 98
         
98 99
         return $cleanedOptions;
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/Campaign.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
                 case 'type': $this->setType($value); break;
135 135
                 case 'id': $this->setId($value); break;
136 136
                 default:
137
-                    throw new Exception('Unknown option: ' . $name);
137
+                    throw new Exception('Unknown option: '.$name);
138 138
             }
139 139
         }
140 140
     }
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
         // Remove options with empty values
173 173
         $cleanedOptions = array();
174 174
         foreach ($options as $name=>$value) {
175
-            if ($value!==null)
175
+            if ($value !== null)
176 176
                 $cleanedOptions[$name] = $value;
177 177
         }
178 178
         
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
91 91
         // Remove options with empty values
92 92
         $cleanedOptions = array();
93 93
         foreach ($options as $name=>$value) {
94
-            if ($value!==null)
95
-                $cleanedOptions[$name] = $value;
94
+            if ($value!==null) {
95
+                            $cleanedOptions[$name] = $value;
96
+            }
96 97
         }
97 98
         
98 99
         return $cleanedOptions;
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Resource/v2/VariationReach.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
                 case 'variation_id': $this->setVariationId($value); break;
50 50
                 case 'variation_reach': $this->setVariationReach($value); break;
51 51
                 default:
52
-                    throw new Exception('Unknown option: ' . $name);
52
+                    throw new Exception('Unknown option: '.$name);
53 53
             }
54 54
         }
55 55
     }
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         // Remove options with empty values
70 70
         $cleanedOptions = array();
71 71
         foreach ($options as $name=>$value) {
72
-            if ($value!==null)
72
+            if ($value !== null)
73 73
                 $cleanedOptions[$name] = $value;
74 74
         }
75 75
         
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -91,8 +91,9 @@
 block discarded – undo
91 91
         // Remove options with empty values
92 92
         $cleanedOptions = array();
93 93
         foreach ($options as $name=>$value) {
94
-            if ($value!==null)
95
-                $cleanedOptions[$name] = $value;
94
+            if ($value!==null) {
95
+                            $cleanedOptions[$name] = $value;
96
+            }
96 97
         }
97 98
         
98 99
         return $cleanedOptions;
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Exception.php 2 patches
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -55,20 +55,25 @@
 block discarded – undo
55 55
     {
56 56
         parent::__construct($message, $code);
57 57
         
58
-        if (isset($options['http_code']))
59
-            $this->setHttpCode($options['http_code']);
58
+        if (isset($options['http_code'])) {
59
+                    $this->setHttpCode($options['http_code']);
60
+        }
60 61
                 
61
-        if (isset($options['uuid']))
62
-            $this->setUuid($options['uuid']);
62
+        if (isset($options['uuid'])) {
63
+                    $this->setUuid($options['uuid']);
64
+        }
63 65
         
64
-        if (isset($options['rate_limit']))
65
-            $this->setRateLimit($options['rate_limit']);
66
+        if (isset($options['rate_limit'])) {
67
+                    $this->setRateLimit($options['rate_limit']);
68
+        }
66 69
         
67
-        if (isset($options['rate_limit_remaining']))
68
-            $this->setRateLimitRemaining($options['rate_limit_remaining']);
70
+        if (isset($options['rate_limit_remaining'])) {
71
+                    $this->setRateLimitRemaining($options['rate_limit_remaining']);
72
+        }
69 73
         
70
-        if (isset($options['rate_limit_reset']))
71
-            $this->setRateLimitReset($options['rate_limit_reset']);
74
+        if (isset($options['rate_limit_reset'])) {
75
+                    $this->setRateLimitReset($options['rate_limit_reset']);
76
+        }
72 77
     }
73 78
     
74 79
     /**
Please login to merge, or discard this patch.
Doc Comments   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -82,7 +82,6 @@  discard block
 block discarded – undo
82 82
             
83 83
     /**
84 84
      * Set HTTP response code.
85
-     * @param integer $code
86 85
      */
87 86
     public function setHttpCode($httpCode)
88 87
     {
@@ -100,7 +99,6 @@  discard block
 block discarded – undo
100 99
             
101 100
     /**
102 101
      * Set message
103
-     * @param string $message
104 102
      */
105 103
     public function setUuid($uuid)
106 104
     {
@@ -145,7 +143,7 @@  discard block
 block discarded – undo
145 143
     
146 144
     /**
147 145
      * Return the exact time that your fresh new rate limit kicks in.
148
-     * @return integer|null
146
+     * @return string
149 147
      */
150 148
     public function getRateLimitReset()
151 149
     {
Please login to merge, or discard this patch.
examples/Projects/CreateProject.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -17,10 +17,10 @@  discard block
 block discarded – undo
17 17
 use WebMarketingROI\OptimizelyPHP\Resource\v2\Project;
18 18
 
19 19
 // Init class autloading.
20
-include dirname(__FILE__) . '/../../vendor/autoload.php';
20
+include dirname(__FILE__).'/../../vendor/autoload.php';
21 21
 
22 22
 // Include Utils.php - a file containing helper functions
23
-include dirname(__FILE__) . '/../Utils.php';
23
+include dirname(__FILE__).'/../Utils.php';
24 24
 
25 25
 // Get OAuth 2.0 credentials from auth_credentials.json and access_token.json files.
26 26
 $credentials = load_credentials_from_file();
@@ -117,6 +117,6 @@  discard block
 block discarded – undo
117 117
 
118 118
 // Save access token for later use
119 119
 $accessToken = $optimizelyClient->getAccessToken();
120
-file_put_contents(dirname(__FILE__) . '/../access_token.json', json_encode($accessToken));
120
+file_put_contents(dirname(__FILE__).'/../access_token.json', json_encode($accessToken));
121 121
 
122 122
 echo "Done!\n";
123 123
\ No newline at end of file
Please login to merge, or discard this patch.
lib/WebMarketingROI/OptimizelyPHP/Result.php 1 patch
Doc Comments   +2 added lines, -5 removed lines patch added patch discarded remove patch
@@ -70,8 +70,6 @@  discard block
 block discarded – undo
70 70
     /**
71 71
      * Constructor.
72 72
      * @param array $decodedJsonData
73
-     * @param string $rawHttpResponseData
74
-     * @param array[string] $rawHttpResponseHeaders
75 73
      */
76 74
     public function __construct($decodedJsonData, $httpCode)
77 75
     {
@@ -90,7 +88,6 @@  discard block
 block discarded – undo
90 88
             
91 89
     /**
92 90
      * Set HTTP response code.
93
-     * @param integer $code
94 91
      */
95 92
     public function setHttpCode($httpCode)
96 93
     {
@@ -108,7 +105,7 @@  discard block
 block discarded – undo
108 105
     
109 106
     /**
110 107
      * Set payload (parsed and wrapped response data).
111
-     * @param mixed $payload
108
+     * @param integer $payload
112 109
      */
113 110
     public function setPayload($payload)
114 111
     {
@@ -225,7 +222,7 @@  discard block
 block discarded – undo
225 222
     
226 223
     /**
227 224
      * Return the exact time that your fresh new rate limit kicks in.
228
-     * @return integer|null
225
+     * @return string
229 226
      */
230 227
     public function getRateLimitReset()
231 228
     {
Please login to merge, or discard this patch.