@@ -1,17 +1,17 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | // Requiring composer autoloader (local or global) |
4 | -foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/vendor/autoload.php'] as $file) { |
|
5 | - if (file_exists($file) && !defined('COMPOSER_AUTOLOADER')) { |
|
4 | +foreach ([__DIR__.'/../../autoload.php', __DIR__.'/vendor/autoload.php'] as $file) { |
|
5 | + if (file_exists($file)&&!defined('COMPOSER_AUTOLOADER')) { |
|
6 | 6 | define('COMPOSER_AUTOLOADER', $file); |
7 | 7 | break; |
8 | 8 | } |
9 | 9 | } |
10 | 10 | if (!defined('COMPOSER_AUTOLOADER')) { |
11 | 11 | die( |
12 | - 'You need to set up the project dependencies using the following commands:' . PHP_EOL . |
|
13 | - 'php -r "readfile(\'https://getcomposer.org/installer\');" | php' . PHP_EOL . |
|
14 | - 'php composer.phar install' . PHP_EOL |
|
12 | + 'You need to set up the project dependencies using the following commands:'.PHP_EOL. |
|
13 | + 'php -r "readfile(\'https://getcomposer.org/installer\');" | php'.PHP_EOL. |
|
14 | + 'php composer.phar install'.PHP_EOL |
|
15 | 15 | ); |
16 | 16 | } |
17 | 17 | require COMPOSER_AUTOLOADER; |
@@ -19,4 +19,4 @@ discard block |
||
19 | 19 | |
20 | 20 | $url = 'http://www.amazon.co.uk/dp/3836227622/ref=wl_it_dp_v_S_ttl/275-8449783-2161748?_encoding=UTF8&colid=3PNTY4VFL6H2Q&coliid=I1MY7ZKTP1IFRJ'; |
21 | 21 | $fetcher = new \Amazon\AsinParser($url); |
22 | -echo $fetcher->getAsin() . PHP_EOL; |
|
22 | +echo $fetcher->getAsin().PHP_EOL; |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | 2 | // Requiring composer autoloader (local or global) |
3 | -foreach ([__DIR__ . '/../../autoload.php', __DIR__ . '/vendor/autoload.php'] as $file) { |
|
4 | - if (file_exists($file) && !defined('COMPOSER_AUTOLOADER')) { |
|
3 | +foreach ([__DIR__.'/../../autoload.php', __DIR__.'/vendor/autoload.php'] as $file) { |
|
4 | + if (file_exists($file)&&!defined('COMPOSER_AUTOLOADER')) { |
|
5 | 5 | define('COMPOSER_AUTOLOADER', $file); |
6 | 6 | break; |
7 | 7 | } |
8 | 8 | } |
9 | 9 | if (!defined('COMPOSER_AUTOLOADER')) { |
10 | 10 | die( |
11 | - 'You need to set up the project dependencies using the following commands:' . PHP_EOL . |
|
12 | - 'php -r "readfile(\'https://getcomposer.org/installer\');" | php' . PHP_EOL . |
|
13 | - 'php composer.phar install' . PHP_EOL |
|
11 | + 'You need to set up the project dependencies using the following commands:'.PHP_EOL. |
|
12 | + 'php -r "readfile(\'https://getcomposer.org/installer\');" | php'.PHP_EOL. |
|
13 | + 'php composer.phar install'.PHP_EOL |
|
14 | 14 | ); |
15 | 15 | } |
16 | 16 | require COMPOSER_AUTOLOADER; |
@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | foreach ($pathParts as $index => $part) { |
46 | 46 | if (strlen($part) === self::LENGTH_ASIN) { |
47 | - if (array_key_exists($index - 1, $pathParts) && $pathParts[$index - 1] === 'dp') { |
|
47 | + if (array_key_exists($index - 1, $pathParts)&&$pathParts[$index - 1] === 'dp') { |
|
48 | 48 | $this->setAsin($part); |
49 | 49 | return; |
50 | 50 | } |
@@ -84,7 +84,7 @@ |
||
84 | 84 | $isAmazonDomain = false; |
85 | 85 | //ShortUrl |
86 | 86 | foreach ($this->amazonDomains as $domain) { |
87 | - if (preg_match('/' . $domain . '/', $this->getUrl())) { |
|
87 | + if (preg_match('/'.$domain.'/', $this->getUrl())) { |
|
88 | 88 | $isAmazonDomain = true; |
89 | 89 | } |
90 | 90 | } |
@@ -1,9 +1,9 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * User: ms |
|
4 | - * Date: 12.10.15 |
|
5 | - * Time: 22:16 |
|
6 | - */ |
|
3 | + * User: ms |
|
4 | + * Date: 12.10.15 |
|
5 | + * Time: 22:16 |
|
6 | + */ |
|
7 | 7 | |
8 | 8 | namespace Amazon; |
9 | 9 |