Skip to content

Commit 9a7ecc9

Browse files
committed
psr2
1 parent e30d0eb commit 9a7ecc9

File tree

11 files changed

+27
-28
lines changed

11 files changed

+27
-28
lines changed

src/Adapters/Adapter.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -250,12 +250,12 @@ public function getProviderIconsUrls()
250250

251251
Utils::unshiftValue($icons, [
252252
'value' => $this->request->url->getAbsolute('/favicon.ico'),
253-
'providers' => ['adapter']
253+
'providers' => ['adapter'],
254254
]);
255255

256256
Utils::unshiftValue($icons, [
257257
'value' => $this->request->url->getAbsolute('/favicon.png'),
258-
'providers' => ['adapter']
258+
'providers' => ['adapter'],
259259
]);
260260

261261
return $icons;
@@ -277,7 +277,7 @@ public function getProviderIcon()
277277
if ($this->config['getBiggerIcon']) {
278278
return Utils::getBiggerValue($this->providerIcons);
279279
}
280-
280+
281281
return Utils::getFirstValue($this->providerIcons);
282282
}
283283

src/Adapters/Archive.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,15 @@ public function getImagesUrls()
128128
if (($url = $this->api->get('misc', 'image'))) {
129129
Utils::unshiftValue($images, [
130130
'value' => $this->request->url->getAbsolute($url),
131-
'providers' => ['api']
131+
'providers' => ['api'],
132132
]);
133133
}
134134

135135
if (is_array($files = $this->api->get('files'))) {
136136
foreach ($files as $url => $info) {
137137
Utils::unshiftValue($images, [
138138
'value' => $this->request->url->getAbsolute($url),
139-
'providers' => ['api']
139+
'providers' => ['api'],
140140
]);
141141
}
142142
}

src/Adapters/Facebook.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,14 @@ public function getImagesUrls()
180180
if (($cover = $this->api->get('cover')) && !empty($cover['source'])) {
181181
Utils::unshiftValue($images, [
182182
'value' => $cover['source'],
183-
'providers' => ['api']
183+
'providers' => ['api'],
184184
]);
185185
}
186186

187187
if (($id = $this->api->get('id'))) {
188188
Utils::unshiftValue($images, [
189189
'value' => 'https://graph.facebook.com/'.$id.'/picture',
190-
'providers' => ['api']
190+
'providers' => ['api'],
191191
]);
192192
}
193193

src/Adapters/File.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ public function getImagesUrls()
8585
return [
8686
[
8787
'value' => $this->getUrl(),
88-
'providers' => ['adapter']
89-
]
88+
'providers' => ['adapter'],
89+
],
9090
];
9191
}
9292

src/Adapters/Soundcloud.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getImagesUrls()
8585
if (!$this->api->get('artwork_url') && ($img = $this->api->get('user', 'avatar_url'))) {
8686
Utils::unshiftValue($images, [
8787
'value' => str_replace('-large.jpg', '-t500x500.jpg', $img),
88-
'providers' => ['api']
88+
'providers' => ['api'],
8989
]);
9090
}
9191

src/ImageInfo/Curl.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ public function writeCallback($connection, $string)
184184
'width' => $info[0],
185185
'height' => $info[1],
186186
'size' => $info[0] * $info[1],
187-
'mime' => $this->mime
187+
'mime' => $this->mime,
188188
];
189189

190190
return -1;

src/Providers/OEmbed.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ public function run()
2626

2727
if (($html = $this->request->getHtmlContent()) && ($endPoint = self::getEndPointFromDom($html))) {
2828
$params['url'] = $this->request->url->getUrl();
29-
}
30-
elseif (($info = self::getEndPointFromRequest($this->request, $this->config))) {
29+
} elseif (($info = self::getEndPointFromRequest($this->request, $this->config))) {
3130
$endPoint = $info['endPoint'];
3231
$params += $info['params'];
3332
}

src/Providers/OEmbed/Deviantart.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static function getParams(Url $url)
2828
{
2929
return [
3030
'url' => $url->getUrl(),
31-
'for' => 'embed'
31+
'for' => 'embed',
3232
];
3333
}
3434
}

src/Providers/OEmbed/Embedly.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ public static function getParams(Url $url)
661661
{
662662
return [
663663
'url' => $url->getUrl(),
664-
'format' => 'json'
664+
'format' => 'json',
665665
];
666666
}
667667
}

src/Utils.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static function getData(array $providers, $name, Url $url = null)
8383
if (!isset($values[$v])) {
8484
$values[$v] = [
8585
'value' => $v,
86-
'providers' => [$key]
86+
'providers' => [$key],
8787
];
8888
} else {
8989
$values[$v]['providers'][] = $key;
@@ -121,8 +121,8 @@ public static function sortByProviders(array $values)
121121
/**
122122
* Unshifts a new value if it does not exists
123123
*
124-
* @param array $values The array provided by self::getData()
125-
* @param array $value The value to insert
124+
* @param array $values The array provided by self::getData()
125+
* @param array $value The value to insert
126126
*/
127127
public static function unshiftValue(array &$values, $value)
128128
{
@@ -142,9 +142,9 @@ public static function unshiftValue(array &$values, $value)
142142
/**
143143
* Search by a value and returns its key
144144
*
145-
* @param array $values The array provided by self::getData()
146-
* @param string $value The value to search
147-
* @param boolean $returnKey Whether or not return the key instead the value
145+
* @param array $values The array provided by self::getData()
146+
* @param string $value The value to search
147+
* @param boolean $returnKey Whether or not return the key instead the value
148148
*
149149
* @return array|false
150150
*/
@@ -177,7 +177,7 @@ public static function getFirstValue(array $values, $returnKey = false)
177177
/**
178178
* Returns the most popular value in an array
179179
*
180-
* @param array $values The array provided by self::getData()
180+
* @param array $values The array provided by self::getData()
181181
* @param boolean $returnKey Whether or not return the key instead the value
182182
*
183183
* @return mixed
@@ -200,7 +200,7 @@ public static function getMostPopularValue(array $values, $returnKey = false)
200200
/**
201201
* Returns the bigger value
202202
*
203-
* @param array $values The array provided by self::getData()
203+
* @param array $values The array provided by self::getData()
204204
* @param boolean $returnKey Whether or not return the key instead the value
205205
*
206206
* @return null|string

tests/ImageInfoTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ class ImageInfoTest extends PHPUnit_Framework_TestCase
44
public function testOne()
55
{
66
$info = Embed\ImageInfo\Curl::getImageInfo([
7-
'value' => 'http://a.images.blip.tv/NostalgiaCritic-NCTheMatrix187.jpg'
7+
'value' => 'http://a.images.blip.tv/NostalgiaCritic-NCTheMatrix187.jpg',
88
]);
99

1010
$this->assertEquals($info, [
11-
'width' => 620,
12-
'height' => 274,
13-
'size' => 169880,
14-
'mime' => 'image/jpeg'
11+
'width' => 620,
12+
'height' => 274,
13+
'size' => 169880,
14+
'mime' => 'image/jpeg',
1515
]);
1616
}
1717
}

0 commit comments

Comments
 (0)