@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | /* |
4 | 4 | * Wolnościowiec / WebProxy |
@@ -1,10 +1,10 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | $settings = [ |
4 | 4 | 'apiKey' => getenv('WW_TOKEN') ? getenv('WW_TOKEN') : 'your-api-key-here', |
5 | 5 | 'externalProxyProviders' => getenv('WW_EXTERNAL_PROXIES') !== false ? getenv('WW_EXTERNAL_PROXIES') : '', |
6 | 6 | 'cache' => new \Doctrine\Common\Cache\FilesystemCache(__DIR__ . '/var/cache'), |
7 | - 'connectionTimeout' => getenv('WW_TIMEOUT') !== false ? (int)getenv('WW_TIMEOUT') : 10, |
|
7 | + 'connectionTimeout' => getenv('WW_TIMEOUT') !== false ? (int) getenv('WW_TIMEOUT') : 10, |
|
8 | 8 | |
9 | 9 | // examples |
10 | 10 | #'externalProxyProviders' => 'FreeProxyListProvider', |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Wolnosciowiec\WebProxy\Entity; |
4 | 4 |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Wolnosciowiec\WebProxy\Factory; |
4 | 4 |
@@ -59,11 +59,9 @@ |
||
59 | 59 | foreach ($names as $name) { |
60 | 60 | if (class_exists($defaultNamespace . $name)) { |
61 | 61 | $fullName = $defaultNamespace . $name; |
62 | - } |
|
63 | - elseif (class_exists($name)) { |
|
62 | + } elseif (class_exists($name)) { |
|
64 | 63 | $fullName = $name; |
65 | - } |
|
66 | - else { |
|
64 | + } else { |
|
67 | 65 | throw new \Exception('Invalid provider name "' . $name . '", please check the configuration'); |
68 | 66 | } |
69 | 67 |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Wolnosciowiec\WebProxy\Factory; |
4 | 4 |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Wolnosciowiec\WebProxy\Factory; |
4 | 4 |
@@ -29,15 +29,15 @@ discard block |
||
29 | 29 | $crawler = $this->client->request('GET', 'http://free-proxy-list.net'); |
30 | 30 | $rows = $crawler->filter('#proxylisttable tr'); |
31 | 31 | |
32 | - $addresses = $rows->each(function (Crawler $node) { |
|
32 | + $addresses = $rows->each(function(Crawler $node) { |
|
33 | 33 | $collection = $node->filter('td'); |
34 | 34 | |
35 | 35 | // cells mapping |
36 | 36 | $lastVerificationTime = @$collection->getNode(7)->textContent; |
37 | 37 | $proxyType = @$collection->getNode(4)->textContent; |
38 | - $proxyPort = (int)@$collection->getNode(1)->textContent; |
|
38 | + $proxyPort = (int) @$collection->getNode(1)->textContent; |
|
39 | 39 | $proxyIP = @$collection->getNode(0)->textContent; |
40 | - $proxySchema =@ $collection->getNode(6)->textContent == 'yes' ? 'https' : 'http'; |
|
40 | + $proxySchema = @ $collection->getNode(6)->textContent == 'yes' ? 'https' : 'http'; |
|
41 | 41 | |
42 | 42 | if (!$proxyIP || !$proxyPort || strlen($lastVerificationTime) === 0 || !$proxyType) { |
43 | 43 | return null; |
@@ -84,6 +84,6 @@ discard block |
||
84 | 84 | $multiply = 1; |
85 | 85 | } |
86 | 86 | |
87 | - return ((int)$parts[0] * $multiply) <= (60 * 5); // 5 minutes |
|
87 | + return ((int) $parts[0] * $multiply) <= (60 * 5); // 5 minutes |
|
88 | 88 | } |
89 | 89 | } |
@@ -73,14 +73,11 @@ |
||
73 | 73 | |
74 | 74 | if (in_array($parts[1], ['minute', 'minutes'])) { |
75 | 75 | $multiply = 60; |
76 | - } |
|
77 | - elseif (in_array($parts[1], ['hour', 'hours'])) { |
|
76 | + } elseif (in_array($parts[1], ['hour', 'hours'])) { |
|
78 | 77 | $multiply = 60 * 60; |
79 | - } |
|
80 | - elseif (in_array($parts[1], ['day', 'days'])) { |
|
78 | + } elseif (in_array($parts[1], ['day', 'days'])) { |
|
81 | 79 | $multiply = 60 * 60 * 24; |
82 | - } |
|
83 | - elseif (in_array($parts[1], ['second', 'seconds'])) { |
|
80 | + } elseif (in_array($parts[1], ['second', 'seconds'])) { |
|
84 | 81 | $multiply = 1; |
85 | 82 | } |
86 | 83 |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Wolnosciowiec\WebProxy\Providers\Proxy; |
4 | 4 |
@@ -1,4 +1,4 @@ |
||
1 | -<?php declare(strict_types=1); |
|
1 | +<?php declare(strict_types = 1); |
|
2 | 2 | |
3 | 3 | namespace Wolnosciowiec\WebProxy\Providers\Proxy; |
4 | 4 |