Completed
Pull Request — master (#105)
by Kristof
18:24 queued 13:13
created
src/Media/MediaManager.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 use CultuurNet\UDB3\Variations\Model\Properties\Description;
10 10
 use CultuurNet\UDB3\Variations\Model\Properties\Id;
11 11
 use JsonSchema\Validator;
12
-use ValueObjects\String\String;
13 12
 use stdClass;
14 13
 
15 14
 class EditDescriptionJSONDeserializer extends JSONDeserializer
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -77,10 +77,10 @@  discard block
 block discarded – undo
77 77
     private function generateUrl(MediaObject $mediaObject)
78 78
     {
79 79
         $extensionGuesser = ExtensionGuesser::getInstance();
80
-        $fileExtension = $extensionGuesser->guess((string) $mediaObject->getMimeType());
80
+        $fileExtension = $extensionGuesser->guess((string)$mediaObject->getMimeType());
81 81
         $fileId = $mediaObject->getFileId();
82 82
 
83
-        return Url::fromNative($this->iriGenerator->iri($fileId.'.'.$fileExtension));
83
+        return Url::fromNative($this->iriGenerator->iri($fileId . '.' . $fileExtension));
84 84
     }
85 85
 
86 86
     /**
@@ -91,12 +91,12 @@  discard block
 block discarded – undo
91 91
         $fileId = $uploadImage->getFileId();
92 92
         $mimeType = $uploadImage->getMimeType();
93 93
         $extensionGuesser = ExtensionGuesser::getInstance();
94
-        $extension = $extensionGuesser->guess((string) $mimeType);
95
-        $fileName = (string) $uploadImage->getFileId().'.'.$extension;
94
+        $extension = $extensionGuesser->guess((string)$mimeType);
95
+        $fileName = (string)$uploadImage->getFileId() . '.' . $extension;
96 96
 
97 97
         $this->filesystem->rename(
98
-            $this->uploadDirectory.'/'.$fileName,
99
-            $this->mediaDirectory.'/'.$fileName
98
+            $this->uploadDirectory . '/' . $fileName,
99
+            $this->mediaDirectory . '/' . $fileName
100 100
         );
101 101
 
102 102
         $this->create(
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             $uploadImage->getCopyrightHolder()
107 107
         );
108 108
 
109
-        $jobInfo = ['file_id' => (string) $fileId];
109
+        $jobInfo = ['file_id' => (string)$fileId];
110 110
         $this->logger->info('job_info', $jobInfo);
111 111
     }
112 112
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
      */
116 116
     public function get(UUID $fileId)
117 117
     {
118
-        $mediaObject = $this->repository->load((string) $fileId);
118
+        $mediaObject = $this->repository->load((string)$fileId);
119 119
         $mediaObject->setUrl($this->generateUrl($mediaObject));
120 120
 
121 121
         return $mediaObject;
Please login to merge, or discard this patch.
src/Media/MediaObject.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -116,7 +116,7 @@
 block discarded – undo
116 116
     }
117 117
 
118 118
     /**
119
-     * @return string
119
+     * @return UUID
120 120
      */
121 121
     public function getFileId()
122 122
     {
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -146,11 +146,11 @@  discard block
 block discarded – undo
146 146
     {
147 147
         return [
148 148
             'mime_type' => $this->mimeType,
149
-            'url' => (string) $this->url,
150
-            'thumbnail_url' => (string) $this->thumbnailUrl,
151
-            'description' => (string) $this->description,
152
-            'copyright_holder' => (string) $this->copyrightHolder,
153
-            'file_id' => (string) $this->fileId,
149
+            'url' => (string)$this->url,
150
+            'thumbnail_url' => (string)$this->thumbnailUrl,
151
+            'description' => (string)$this->description,
152
+            'copyright_holder' => (string)$this->copyrightHolder,
153
+            'file_id' => (string)$this->fileId,
154 154
         ];
155 155
     }
156 156
 
@@ -162,13 +162,13 @@  discard block
 block discarded – undo
162 162
     {
163 163
         $jsonLd = [
164 164
             // TODO: use an iri generator to generate a proper id
165
-            '@id' => (string) $this->getFileId(),
165
+            '@id' => (string)$this->getFileId(),
166 166
             // TODO: base type off of MIME
167 167
             '@type' => 'schema:MediaObject',
168
-            'contentUrl' => (string) $this->url,
169
-            'thumbnailUrl' => (string) $this->thumbnailUrl,
170
-            'description' => (string) $this->description,
171
-            'copyrightHolder' => (string) $this->copyrightHolder,
168
+            'contentUrl' => (string)$this->url,
169
+            'thumbnailUrl' => (string)$this->thumbnailUrl,
170
+            'description' => (string)$this->description,
171
+            'copyrightHolder' => (string)$this->copyrightHolder,
172 172
         ];
173 173
 
174 174
         return $jsonLd;
Please login to merge, or discard this patch.
src/Place/Events/ImageAdded.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     }
29 29
 
30 30
     /**
31
-     * @return mixed The object instance
31
+     * @return ImageAdded The object instance
32 32
      */
33 33
     public static function deserialize(array $data)
34 34
     {
Please login to merge, or discard this patch.
src/Place/Events/ImageUpdated.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     }
31 31
 
32 32
     /**
33
-     * @return mixed The object instance
33
+     * @return ImageUpdated The object instance
34 34
      */
35 35
     public static function deserialize(array $data)
36 36
     {
Please login to merge, or discard this patch.
src/Event/Events/ImageAdded.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
     }
29 29
 
30 30
     /**
31
-     * @return mixed The object instance
31
+     * @return ImageAdded The object instance
32 32
      */
33 33
     public static function deserialize(array $data)
34 34
     {
Please login to merge, or discard this patch.
src/Event/Events/ImageUpdated.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
     }
31 31
 
32 32
     /**
33
-     * @return mixed The object instance
33
+     * @return ImageUpdated The object instance
34 34
      */
35 35
     public static function deserialize(array $data)
36 36
     {
Please login to merge, or discard this patch.