Completed
Push — master ( 5f50d9...cf27fb )
by Vladimir
02:07
created
tests/sanitize-fixtures.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-$auth = json_decode(file_get_contents(__DIR__ . '/../phpunit-auth.json'), true);
4
-$findAndReplace = json_decode(file_get_contents(__DIR__ . '/sanitize-values.json'), true);
5
-$fixtures = file_get_contents(__DIR__ . '/fixtures/PhpPulseVCR');
3
+$auth = json_decode(file_get_contents(__DIR__.'/../phpunit-auth.json'), true);
4
+$findAndReplace = json_decode(file_get_contents(__DIR__.'/sanitize-values.json'), true);
5
+$fixtures = file_get_contents(__DIR__.'/fixtures/PhpPulseVCR');
6 6
 
7 7
 $sanitized = str_replace($auth['apiToken'], 'YourApiKeyHere', $fixtures);
8 8
 
@@ -11,4 +11,4 @@  discard block
 block discarded – undo
11 11
     $sanitized = str_replace($key, $value, $sanitized);
12 12
 }
13 13
 
14
-file_put_contents(__DIR__ . '/fixtures/PhpPulseVCR-sanitized', $sanitized);
15 14
\ No newline at end of file
15
+file_put_contents(__DIR__.'/fixtures/PhpPulseVCR-sanitized', $sanitized);
16 16
\ No newline at end of file
Please login to merge, or discard this patch.
src/PulseGroup.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@
 block discarded – undo
50 50
 
51 51
     public function isArchived ()
52 52
     {
53
-        return (bool)$this->archived;
53
+        return (bool) $this->archived;
54 54
     }
55 55
 
56 56
     public function isDeleted ()
57 57
     {
58
-        return (bool)$this->deleted;
58
+        return (bool) $this->deleted;
59 59
     }
60 60
 
61 61
     /**
Please login to merge, or discard this patch.
src/Objects/ApiObject.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
     {
316 316
         if (self::lazyCastNeeded($target, $objectType))
317 317
         {
318
-            $object = ($objectType[0] == "\\") ? $objectType : self::OBJ_NAMESPACE . $objectType;
318
+            $object = ($objectType[0] == "\\") ? $objectType : self::OBJ_NAMESPACE.$objectType;
319 319
             $target = new $object($target);
320 320
         }
321 321
     }
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
      */
355 355
     final protected static function lazyCastNeeded ($target, $objectType)
356 356
     {
357
-        $objectDefinition = ($objectType[0] === "\\") ? $objectType : self::OBJ_NAMESPACE . $objectType;
357
+        $objectDefinition = ($objectType[0] === "\\") ? $objectType : self::OBJ_NAMESPACE.$objectType;
358 358
 
359 359
         return !($target instanceof $objectDefinition);
360 360
     }
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
      */
392 392
     final protected static function castArrayToObjectArray ($className, $objects)
393 393
     {
394
-        $class = self::OBJ_NAMESPACE . $className;
394
+        $class = self::OBJ_NAMESPACE.$className;
395 395
         $array = [];
396 396
 
397 397
         foreach ($objects as $post)
Please login to merge, or discard this patch.
src/Objects/PulseColumnTextValue.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
         $url        = sprintf("%s/%d/columns/%s/text.json", self::apiEndpoint(), $this->board_id, $this->column_id);
52 52
         $postParams = [
53 53
             "pulse_id" => $this->pulse_id,
54
-            "text"     => (string)$text
54
+            "text"     => (string) $text
55 55
         ];
56 56
 
57 57
         $result = self::sendPut($url, $postParams);
Please login to merge, or discard this patch.
src/Utilities/UrlQuery.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function __construct ($url, $urlParams)
56 56
     {
57
-        $this->url  = $url . "?" . self::formatParameters($urlParams);
57
+        $this->url  = $url."?".self::formatParameters($urlParams);
58 58
         $this->cURL = curl_init();
59 59
 
60 60
         $this->configureCurl();
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
         curl_setopt_array($this->cURL, [
89 89
             CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
90
-            CURLOPT_USERPWD  => $username . ":" . $password
90
+            CURLOPT_USERPWD  => $username.":".$password
91 91
         ]);
92 92
     }
93 93
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
                 continue;
312 312
             }
313 313
 
314
-            $parameters[] = rawurlencode($key) . "=" . rawurlencode($value);
314
+            $parameters[] = rawurlencode($key)."=".rawurlencode($value);
315 315
         }
316 316
 
317 317
         return implode("&", $parameters);
Please login to merge, or discard this patch.
docs/sami-config.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,8 @@
 block discarded – undo
32 32
  * Include this section if you want sami to document
33 33
  * private and protected functions/properties
34 34
  */
35
-$sami['filter'] = function () {
35
+$sami['filter'] = function ()
36
+{
36 37
     return new ApiFilter();
37 38
 };
38 39
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-require_once __DIR__ . '/ApiFilter.php';
3
+require_once __DIR__.'/ApiFilter.php';
4 4
 
5 5
 use allejo\Sami\ApiFilter;
6 6
 use Sami\RemoteRepository\GitHubRemoteRepository;
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 $iterator = Finder::create()
12 12
     ->files()
13 13
     ->name('*.php')
14
-    ->in($dir = __DIR__ . '/../src')
14
+    ->in($dir = __DIR__.'/../src')
15 15
 ;
16 16
 
17 17
 // generate documentation for all 0.* branches and the master branch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
 $sami = new Sami($iterator, array(
25 25
     'versions'             => $versions,
26 26
     'title'                => 'PhpPulse API',
27
-    'build_dir'            => __DIR__ . '/api/build/PhpPulse/%version%',
28
-    'cache_dir'            => __DIR__ . '/api/cache/PhpPulse/%version%',
27
+    'build_dir'            => __DIR__.'/api/build/PhpPulse/%version%',
28
+    'cache_dir'            => __DIR__.'/api/cache/PhpPulse/%version%',
29 29
     'remote_repository'    => new GitHubRemoteRepository('allejo/PhpPulse', dirname($dir)),
30 30
     'default_opened_level' => 2,
31 31
 ));
Please login to merge, or discard this patch.
tests/PulseColumnSettersTestCase.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
      */
16 16
     private $pulse;
17 17
 
18
-    public static function invalidColorValueProvider()
18
+    public static function invalidColorValueProvider ()
19 19
     {
20 20
         return array(
21 21
             array(-1),
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
         );
26 26
     }
27 27
 
28
-    public static function invalidTextProvider()
28
+    public static function invalidTextProvider ()
29 29
     {
30 30
         return [
31 31
             [new \stdClass()],
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
         ];
34 34
     }
35 35
 
36
-    public static function invalidNumericProvider()
36
+    public static function invalidNumericProvider ()
37 37
     {
38 38
         return [
39 39
             ['hello'],
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         ];
44 44
     }
45 45
 
46
-    public static function invalidDateTimeProvider()
46
+    public static function invalidDateTimeProvider ()
47 47
     {
48 48
         return [
49 49
             [1483228800],
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         ];
54 54
     }
55 55
 
56
-    public static function invalidPersonProvider()
56
+    public static function invalidPersonProvider ()
57 57
     {
58 58
         return [
59 59
             [130.4],
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         ];
65 65
     }
66 66
 
67
-    public static function invalidTimelineProvider()
67
+    public static function invalidTimelineProvider ()
68 68
     {
69 69
         return [
70 70
             [new \DateTime('2017-01-01'), null],
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
         ];
73 73
     }
74 74
 
75
-    public function setUp()
75
+    public function setUp ()
76 76
     {
77 77
         parent::setUp();
78 78
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
         $this->pulse = new Pulse(27168882);
81 81
     }
82 82
 
83
-    public function testSettingStatusColumn()
83
+    public function testSettingStatusColumn ()
84 84
     {
85 85
         $value = PulseColumnStatusValue::Gold;
86 86
         $column = $this->pulse->getStatusColumn('status');
@@ -92,14 +92,14 @@  discard block
 block discarded – undo
92 92
     /**
93 93
      * @dataProvider invalidColorValueProvider
94 94
      */
95
-    public function testSettingStatusColumnWithWrongTypes($color)
95
+    public function testSettingStatusColumnWithWrongTypes ($color)
96 96
     {
97 97
         $this->setExpectedException('\InvalidArgumentException');
98 98
 
99 99
         $this->pulse->getStatusColumn('status')->updateValue($color);
100 100
     }
101 101
 
102
-    public function testSettingTextColumn()
102
+    public function testSettingTextColumn ()
103 103
     {
104 104
         $value = 'Elastic Water Bottle';
105 105
         $column = $this->pulse->getTextColumn('text');
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
     /**
112 112
      * @dataProvider invalidTextProvider
113 113
      */
114
-    public function testSettingTextColumnWithWrongTypes($value)
114
+    public function testSettingTextColumnWithWrongTypes ($value)
115 115
     {
116 116
         $this->setExpectedException(\InvalidArgumentException::class);
117 117
 
118 118
         $this->pulse->getTextColumn('text')->updateValue($value);
119 119
     }
120 120
 
121
-    public function testSettingNumericColumn()
121
+    public function testSettingNumericColumn ()
122 122
     {
123 123
         $value = 25;
124 124
         $column = $this->pulse->getNumericColumn('numbers');
@@ -130,14 +130,14 @@  discard block
 block discarded – undo
130 130
     /**
131 131
      * @dataProvider invalidNumericProvider
132 132
      */
133
-    public function testSettingNumericColumnWithWrongTypes($value)
133
+    public function testSettingNumericColumnWithWrongTypes ($value)
134 134
     {
135 135
         $this->setExpectedException(\InvalidArgumentException::class);
136 136
 
137 137
         $this->pulse->getNumericColumn('numbers')->updateValue($value);
138 138
     }
139 139
 
140
-    public function testSettingDateColumn()
140
+    public function testSettingDateColumn ()
141 141
     {
142 142
         $value = new \DateTime('2017-02-01');
143 143
         $column = $this->pulse->getDateColumn('due_date');
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
     /**
150 150
      * @dataProvider invalidDateTimeProvider
151 151
      */
152
-    public function testSettingDateColumnWithWrongTypes($value)
152
+    public function testSettingDateColumnWithWrongTypes ($value)
153 153
     {
154 154
         $this->setExpectedException(\InvalidArgumentException::class);
155 155
 
156 156
         $this->pulse->getDateColumn('due_date')->updateValue($value);
157 157
     }
158 158
 
159
-    public function testSettingTimelineColumn()
159
+    public function testSettingTimelineColumn ()
160 160
     {
161 161
         $from = new \DateTime('2016-01-01');
162 162
         $to   = new \DateTime('2016-01-26');
@@ -169,14 +169,14 @@  discard block
 block discarded – undo
169 169
     /**
170 170
      * @dataProvider invalidTimelineProvider
171 171
      */
172
-    public function testSettingTimelineColumnWithWrongTypes($dateOne, $dateTwo)
172
+    public function testSettingTimelineColumnWithWrongTypes ($dateOne, $dateTwo)
173 173
     {
174 174
         $this->setExpectedException(\InvalidArgumentException::class);
175 175
 
176 176
         $this->pulse->getTimelineColumn('timeline')->updateValue($dateOne, $dateTwo);
177 177
     }
178 178
 
179
-    public function testSettingPersonColumnFromInt()
179
+    public function testSettingPersonColumnFromInt ()
180 180
     {
181 181
         $column = $this->pulse->getPersonColumn('person');
182 182
         $column->updateValue($this->userId);
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
         $this->assertEquals($this->userId, $column->getValue()->getId());
185 185
     }
186 186
 
187
-    public function testSettingPersonColumnFromObject()
187
+    public function testSettingPersonColumnFromObject ()
188 188
     {
189 189
         $user = new PulseUser($this->userId);
190 190
         $column = $this->pulse->getPersonColumn('person');
@@ -196,14 +196,14 @@  discard block
 block discarded – undo
196 196
     /**
197 197
      * @dataProvider invalidPersonProvider
198 198
      */
199
-    public function testSettingPersonColumnWithWrongTypes($value)
199
+    public function testSettingPersonColumnWithWrongTypes ($value)
200 200
     {
201 201
         $this->setExpectedException(\InvalidArgumentException::class);
202 202
 
203 203
         $this->pulse->getPersonColumn('person')->updateValue($value);
204 204
     }
205 205
 
206
-    public function testSettingNonExistentColumn()
206
+    public function testSettingNonExistentColumn ()
207 207
     {
208 208
         $this->markTestIncomplete('I need to get the response from DaPulse to create the mock');
209 209
 
Please login to merge, or discard this patch.
tests/PulseColumnGettersTestCase.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
      */
25 25
     private $pulses;
26 26
 
27
-    public function setUp()
27
+    public function setUp ()
28 28
     {
29 29
         parent::setUp();
30 30
 
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $this->pulses = $this->board->getPulses();
36 36
     }
37 37
 
38
-    public function testGetNameColumnValues()
38
+    public function testGetNameColumnValues ()
39 39
     {
40 40
         $expectedValues = array(
41 41
             "Mock Pulse One",
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
         }
52 52
     }
53 53
 
54
-    public function testGetTextColumnValues()
54
+    public function testGetTextColumnValues ()
55 55
     {
56 56
         $expectedValues = array(
57 57
             "Silver Pet Rock",
@@ -67,24 +67,24 @@  discard block
 block discarded – undo
67 67
         }
68 68
     }
69 69
 
70
-    public function testGetPersonColumnValues()
70
+    public function testGetPersonColumnValues ()
71 71
     {
72 72
         $user = new PulseUser($this->userId);
73 73
 
74 74
         $this->assertEquals($user, $this->pulses[0]->getPersonColumn('person')->getValue());
75 75
     }
76 76
 
77
-    public function testGetPersonNullColumn()
77
+    public function testGetPersonNullColumn ()
78 78
     {
79 79
         $this->assertNull($this->pulses[1]->getPersonColumn('person')->getValue());
80 80
     }
81 81
 
82
-    public function testGetDateNullColumn()
82
+    public function testGetDateNullColumn ()
83 83
     {
84 84
         $this->assertNull($this->pulses[2]->getDateColumn('due_date')->getValue());
85 85
     }
86 86
 
87
-    public function testGetDateColumnValues()
87
+    public function testGetDateColumnValues ()
88 88
     {
89 89
         $date = array(
90 90
             new \DateTime("2017-01-03"),
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         $this->assertEquals($date[2], $this->pulses[2]->getDateColumn('due_date')->getValue());
98 98
     }
99 99
 
100
-    public function testGetStatusColumnValues()
100
+    public function testGetStatusColumnValues ()
101 101
     {
102 102
         $expectedValues = array(
103 103
             PulseColumnStatusValue::Orange,
@@ -113,18 +113,18 @@  discard block
 block discarded – undo
113 113
         }
114 114
     }
115 115
 
116
-    public function testGetNumericColumnValue()
116
+    public function testGetNumericColumnValue ()
117 117
     {
118 118
         $this->assertEquals(100.5, $this->pulses[0]->getNumericColumn('numbers')->getValue());
119 119
         $this->assertEquals(50, $this->pulses[1]->getNumericColumn('numbers')->getValue());
120 120
     }
121 121
 
122
-    public function testGetNumericColumnNullValue()
122
+    public function testGetNumericColumnNullValue ()
123 123
     {
124 124
         $this->assertNull($this->pulses[2]->getNumericColumn('numbers')->getValue());
125 125
     }
126 126
 
127
-    public function testGetTimelineColumnValue()
127
+    public function testGetTimelineColumnValue ()
128 128
     {
129 129
         $this->assertEquals([
130 130
             'from' => new \DateTime('2017-01-09'),
@@ -132,26 +132,26 @@  discard block
 block discarded – undo
132 132
         ], $this->pulses[0]->getTimelineColumn('timeline')->getValue());
133 133
     }
134 134
 
135
-    public function testGetTimelineColumnNullValue()
135
+    public function testGetTimelineColumnNullValue ()
136 136
     {
137 137
         $this->assertNull($this->pulses[1]->getTimelineColumn('timeline')->getValue());
138 138
     }
139 139
 
140
-    public function testGetBadColumnType()
140
+    public function testGetBadColumnType ()
141 141
     {
142 142
         $this->setExpectedException('allejo\DaPulse\Exceptions\InvalidObjectException');
143 143
 
144 144
         PulseColumnValue::_createColumnType("non-existent", array());
145 145
     }
146 146
 
147
-    public function testGetNonExistentColumn()
147
+    public function testGetNonExistentColumn ()
148 148
     {
149 149
         $this->setExpectedException('allejo\DaPulse\Exceptions\ColumnNotFoundException');
150 150
 
151 151
         $this->pulses[1]->getDateColumn("non-existent")->getValue();
152 152
     }
153 153
 
154
-    public function testGetWrongColumnType()
154
+    public function testGetWrongColumnType ()
155 155
     {
156 156
         $this->setExpectedException('allejo\DaPulse\Exceptions\InvalidColumnException');
157 157
 
Please login to merge, or discard this patch.
tests/Utilities/AuthenticatedClient.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
         return (isset($this->apiToken));
26 26
     }
27 27
 
28
-    public function getApiToken()
28
+    public function getApiToken ()
29 29
     {
30 30
         return $this->apiToken;
31 31
     }
Please login to merge, or discard this patch.