@@ -30,6 +30,10 @@ |
||
30 | 30 | |
31 | 31 | private $unitOfWork; |
32 | 32 | |
33 | + /** |
|
34 | + * @param string $class |
|
35 | + * @param string $property |
|
36 | + */ |
|
33 | 37 | public function __construct(EntityManager $em, $class, $property, $queryBuilder, $multiple) |
34 | 38 | { |
35 | 39 | if (!(null === $queryBuilder || $queryBuilder instanceof QueryBuilder || $queryBuilder instanceof \Closure)) { |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | /** |
127 | 127 | * Sets the value of uri. |
128 | 128 | * |
129 | - * @param string $name $uri the uri |
|
130 | 129 | * |
130 | + * @param string $uri |
|
131 | 131 | * @return self |
132 | 132 | */ |
133 | 133 | public function setUri($uri) |
@@ -150,8 +150,8 @@ discard block |
||
150 | 150 | /** |
151 | 151 | * Sets the value of secretKey. |
152 | 152 | * |
153 | - * @param string $name $secretKey the secret key |
|
154 | 153 | * |
154 | + * @param string $secretKey |
|
155 | 155 | * @return self |
156 | 156 | */ |
157 | 157 | public function setSecretKey($secretKey) |
@@ -174,8 +174,8 @@ discard block |
||
174 | 174 | /** |
175 | 175 | * Sets the value of mime. |
176 | 176 | * |
177 | - * @param string $name $mime the mime |
|
178 | 177 | * |
178 | + * @param string $mime |
|
179 | 179 | * @return self |
180 | 180 | */ |
181 | 181 | public function setMime($mime) |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | /** |
199 | 199 | * Sets the value of lifetime. |
200 | 200 | * |
201 | - * @param string $label $lifetime the lifetime |
|
202 | 201 | * |
202 | + * @param null|\DateTime $lifetime |
|
203 | 203 | * @return self |
204 | 204 | */ |
205 | 205 | public function setLifetime($lifetime) |
@@ -60,6 +60,9 @@ |
||
60 | 60 | return (array_key_exists($mime, $this->previewIcon)) ? $this->previewIcon[$mime] : $this->previewIcon['unknown']; |
61 | 61 | } |
62 | 62 | |
63 | + /** |
|
64 | + * @param boolean $isIcon |
|
65 | + */ |
|
63 | 66 | protected function generatePath($isIcon, $str) |
64 | 67 | { |
65 | 68 | if($isIcon === true) { |
@@ -46,6 +46,9 @@ |
||
46 | 46 | return $url; |
47 | 47 | } |
48 | 48 | |
49 | + /** |
|
50 | + * @param string $url |
|
51 | + */ |
|
49 | 52 | protected function downloadMedia($url) |
50 | 53 | { |
51 | 54 | $filepath = sys_get_temp_dir().'/tmp.jpg'; |
@@ -15,14 +15,14 @@ discard block |
||
15 | 15 | $this->mediaManager = $mediaManager; |
16 | 16 | } |
17 | 17 | |
18 | - public function randomMedia ($width = null, $height = null, $type = "color") |
|
18 | + public function randomMedia($width = null, $height = null, $type = "color") |
|
19 | 19 | { |
20 | 20 | $file = $this->downloadMedia($this->generateUrl($width, $height, $type)); |
21 | 21 | $media = $this->mediaManager->upload($file); |
22 | 22 | return $media; |
23 | 23 | } |
24 | 24 | |
25 | - protected function generateUrl ($width = null, $height = null, $type = "color") |
|
25 | + protected function generateUrl($width = null, $height = null, $type = "color") |
|
26 | 26 | { |
27 | 27 | $url = "http://lorempixel.com/"; |
28 | 28 | |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $url .= 'g/'; |
31 | 31 | } |
32 | 32 | |
33 | - if($width === null && $height !== null) { |
|
33 | + if ($width === null && $height !== null) { |
|
34 | 34 | $width = round($height * 4 / 3); |
35 | 35 | } elseif ($width !== null && $height === null) { |
36 | 36 | $height = round($width * 3 / 4); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | { |
51 | 51 | $filepath = sys_get_temp_dir().'/tmp.jpg'; |
52 | 52 | $ch = curl_init($url); |
53 | - $fp = fopen($filepath,'wb'); |
|
53 | + $fp = fopen($filepath, 'wb'); |
|
54 | 54 | curl_setopt($ch, CURLOPT_FILE, $fp); |
55 | 55 | curl_setopt($ch, CURLOPT_HEADER, 0); |
56 | 56 | curl_exec($ch); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | public function __construct(EntityManager $entityManager, $uploadDir, $allowedMimetypes) |
32 | 32 | { |
33 | 33 | $this->entityManager = $entityManager; |
34 | -if(substr($uploadDir, -1) !== '/') { |
|
34 | +if (substr($uploadDir, -1) !== '/') { |
|
35 | 35 | $uploadDir = $uploadDir.'/'; |
36 | 36 | } |
37 | 37 | $this->uploadDir = $uploadDir; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | // Sanitizing the filename |
73 | 73 | $slugify = new Slugify(); |
74 | -if($file instanceof UploadedFile) { |
|
74 | +if ($file instanceof UploadedFile) { |
|
75 | 75 | $filename = $slugify->slugify($file->getClientOriginalName()); |
76 | 76 | } else { |
77 | 77 | $filename = $slugify->slugify($file->getFilename()); |