Skip to content

Commit 912e53d

Browse files
committed
psr-2 fixes
1 parent 326b939 commit 912e53d

File tree

10 files changed

+26
-24
lines changed

10 files changed

+26
-24
lines changed

demo/index.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,13 @@ function printCode($code, $asHtml = true)
8080
'providerIconsUrls' => 'printArray',
8181
'providerName' => 'printText',
8282
'providerUrl' => 'printUrl',
83-
'publishedTime' => 'printText'
83+
'publishedTime' => 'printText',
8484
];
8585

8686
$adapterData = $providerData;
8787

88-
function array_insert (&$array, $position, $insert_array) {
88+
function array_insert(&$array, $position, $insert_array)
89+
{
8990
$first_array = array_splice($array, 0, $position);
9091
$array = array_merge($first_array, $insert_array, $array);
9192
}
@@ -156,7 +157,7 @@ function array_insert (&$array, $position, $insert_array) {
156157
<div id="advanced-data">
157158
<?php if (isset($info->api)): ?>
158159
<h2>Data provider by the custom API</h2>
159-
160+
160161
<table>
161162
<tr>
162163
<th>Data provider by the API</th>

src/Adapters/Adapter.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
* @property null|string $providerUrl
3131
* @property null|string $publishedTime
3232
*/
33-
3433
abstract class Adapter
3534
{
3635
protected $request;
@@ -47,7 +46,7 @@ abstract class Adapter
4746
'getBiggerImage' => false,
4847
'getBiggerIcon' => false,
4948
'facebookKey' => null,
50-
'soundcloudKey' => 'YOUR_CLIENT_ID'
49+
'soundcloudKey' => 'YOUR_CLIENT_ID',
5150
];
5251

5352
/**
@@ -100,7 +99,7 @@ public function getRequest()
10099
protected function addProvider($name, ProviderInterface $provider)
101100
{
102101
$config = isset($this->providersConfig[$name]) ? $this->providersConfig[$name] : null;
103-
102+
104103
$provider->init($this->request, $config);
105104
$provider->run();
106105

src/Adapters/Parleys.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Parleys extends Webpage implements AdapterInterface
1414
public static function check(Request $request)
1515
{
1616
return $request->match([
17-
'*://www.parleys.com/play/*'
17+
'*://www.parleys.com/play/*',
1818
]);
1919
}
2020

src/ImageInfo/Curl.php

+2
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ public function writeCallback($connection, $string)
171171

172172
if (!in_array($this->mime, static::$mimetypes, true)) {
173173
$this->mime = null;
174+
174175
return -1;
175176
}
176177
}
@@ -180,6 +181,7 @@ public function writeCallback($connection, $string)
180181
}
181182

182183
$this->info = array($info[0], $info[1], $this->mime);
184+
183185
return -1;
184186
}
185187
}

src/ImageInfo/ImageInfoInterface.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
namespace Embed\ImageInfo;
33

44
/**
5-
* Inteface used by all imageinfo interfaces
5+
* Inteface used by all imageinfo interfaces
66
*/
77
interface ImageInfoInterface
88
{

src/Providers/Html.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
class Html extends Provider implements ProviderInterface
1414
{
1515
protected $config = [
16-
'maxImages' => -1
16+
'maxImages' => -1,
1717
];
1818

1919
/**

src/Providers/OEmbed.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class OEmbed extends Provider implements ProviderInterface
1313
{
1414
protected $config = [
1515
'parameters' => [],
16-
'embedlyKey' => null
16+
'embedlyKey' => null,
1717
];
1818

1919
/**

src/Sources/Source.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/**
55
* Base Source extended by all sources
66
* Provide default functionalities
7-
*
7+
*
88
* @property null|string $providerUrl
99
* @property string $sourceUrl
1010
* @property array $items

src/Utils.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public static function getBiggerImage(array $images)
7777
/**
7878
* Search and returns the first value retrieved by the providers
7979
*
80-
* @param null|array $providers The providers used to retrieve the data
81-
* @param string $name The data name (title, description, image, etc)
80+
* @param null|array $providers The providers used to retrieve the data
81+
* @param string $name The data name (title, description, image, etc)
8282
*
8383
* @return mixed
8484
*/
@@ -96,8 +96,8 @@ public static function getFirstData(array $providers, $name)
9696
/**
9797
* Search and returns all data retrieved by the providers
9898
*
99-
* @param null|array $providers The providers used to retrieve the data
100-
* @param string $name The data name (title, description, image, etc)
99+
* @param null|array $providers The providers used to retrieve the data
100+
* @param string $name The data name (title, description, image, etc)
101101
*
102102
* @return array
103103
*/
@@ -124,9 +124,9 @@ public static function getAllData(array $providers, $name)
124124
/**
125125
* Search and returns the first url value retrieved by the providers
126126
*
127-
* @param Url $url The base url used to resolve relative urls
128-
* @param null|array $providers The providers used to retrieve the data
129-
* @param string $name The data name (title, description, image, etc)
127+
* @param Url $url The base url used to resolve relative urls
128+
* @param null|array $providers The providers used to retrieve the data
129+
* @param string $name The data name (title, description, image, etc)
130130
*
131131
* @return string|null
132132
*/
@@ -142,9 +142,9 @@ public static function getFirstUrlData(Url $url, array $providers, $name)
142142
/**
143143
* Search and returns all data retrieved by the providers
144144
*
145-
* @param Url $url The base url used to resolve relative urls
146-
* @param null|array $providers The providers used to retrieve the data
147-
* @param string $name The data name (title, description, image, etc)
145+
* @param Url $url The base url used to resolve relative urls
146+
* @param null|array $providers The providers used to retrieve the data
147+
* @param string $name The data name (title, description, image, etc)
148148
*
149149
* @return array
150150
*/

tests/TwitterTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public function testOmitScript()
1313
$info = Embed\Embed::create('https://twitter.com/pepephone/status/436461658601713664', [
1414
'providers' => [
1515
'oembed' => [
16-
'parameters' => ['omit_script' => true]
17-
]
18-
]
16+
'parameters' => ['omit_script' => true],
17+
],
18+
],
1919
]);
2020

2121
$this->assertEquals($info->code, '<blockquote class="twitter-tweet"><p>RT <a href="https://twitter.com/PabloHerreros">@PabloHerreros</a> Pepephone rompe la baraja - <a href="http://t.co/mFn7mcB1vy">http://t.co/mFn7mcB1vy</a></p>&mdash; pepephone (@pepephone) <a href="https://twitter.com/pepephone/status/436461658601713664">February 20, 2014</a></blockquote>'."\n");

0 commit comments

Comments
 (0)