Completed
Push — master ( 2cca03...332d8f )
by Francesco
02:39
created
src/repository/SegmentRepository.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
     public function add(Segment $segment)
55 55
     {
56 56
 
57
-        $compiledUrl = self::BASE_URL.$segment->getMemberId();
57
+        $compiledUrl = self::BASE_URL . $segment->getMemberId();
58 58
 
59 59
         $payload = [
60 60
             'segment' => $segment->torray(),
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
             $responseContent = json_decode($stream->getContents(), true);
71 71
             $stream->rewind();
72 72
 
73
-            if (!(isset($responseContent['response']['segment']['id']))) {
73
+            if ( ! (isset($responseContent['response']['segment']['id']))) {
74 74
                 throw RepositoryException::wrongFormat(serialize($responseContent));
75 75
             }
76 76
 
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
     public function remove($id, $memberId)
91 91
     {
92 92
 
93
-        $compiledUrl = self::BASE_URL.$memberId.'/'.$id;
93
+        $compiledUrl = self::BASE_URL . $memberId . '/' . $id;
94 94
 
95 95
         $response = $this->client->request('DELETE', $compiledUrl);
96 96
 
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
     public function update(Segment $segment)
110 110
     {
111 111
 
112
-        if (!$segment->getId()) {
112
+        if ( ! $segment->getId()) {
113 113
             throw new \Exception('name me - missing id');
114 114
         }
115 115
 
116
-        $compiledUrl = self::BASE_URL.$segment->getMemberId().'/'.$segment->getId();
116
+        $compiledUrl = self::BASE_URL . $segment->getMemberId() . '/' . $segment->getId();
117 117
 
118 118
         $payload = [
119 119
             'segment' => $segment->torray(),
@@ -136,13 +136,13 @@  discard block
 block discarded – undo
136 136
     public function findOneById($id, $memberId)
137 137
     {
138 138
 
139
-        $compiledUrl = self::BASE_URL.$memberId.'/'.$id;
139
+        $compiledUrl = self::BASE_URL . $memberId . '/' . $id;
140 140
 
141 141
         $response = $this->client->request('GET', $compiledUrl);
142 142
 
143 143
         $repositoryResponse = RepositoryResponse::fromResponse($response);
144 144
 
145
-        if (!$repositoryResponse->isSuccessful()) {
145
+        if ( ! $repositoryResponse->isSuccessful()) {
146 146
             return null;
147 147
         }
148 148
 
@@ -165,20 +165,20 @@  discard block
 block discarded – undo
165 165
     {
166 166
 
167 167
         if ($this->isCacheEnabled()) {
168
-            $cacheKey = self::CACHE_NAMESPACE.sha1($memberId.$start.$maxResults);
168
+            $cacheKey = self::CACHE_NAMESPACE . sha1($memberId . $start . $maxResults);
169 169
             if ($this->cache->contains($cacheKey)) {
170 170
                 return $this->cache->fetch($cacheKey);
171 171
             }
172 172
 
173 173
         }
174 174
 
175
-        $compiledUrl = self::BASE_URL.$memberId."?start_element=$start&num_elements=$maxResults";
175
+        $compiledUrl = self::BASE_URL . $memberId . "?start_element=$start&num_elements=$maxResults";
176 176
 
177 177
         $response = $this->client->request('GET', $compiledUrl);
178 178
 
179 179
         $repositoryResponse = RepositoryResponse::fromResponse($response);
180 180
 
181
-        if (!$repositoryResponse->isSuccessful()) {
181
+        if ( ! $repositoryResponse->isSuccessful()) {
182 182
             return null;
183 183
         }
184 184
 
Please login to merge, or discard this patch.