@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $xml->registerXPathNamespace('A', 'http://www.w3.org/2005/Atom'); |
88 | 88 | foreach ($xml->xpath('//A:feed/A:entry') as $node) { |
89 | 89 | $summary = (string) $node->summary; |
90 | - if (! $node->content) { |
|
90 | + if (!$node->content) { |
|
91 | 91 | // Atom 1.0 does not require <content> elements, so |
92 | 92 | // ensure it is at least populated with $summary |
93 | 93 | $content = $summary; |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | if ($cache->has($key)) { |
133 | 133 | $items = $cache->get($key); |
134 | 134 | } else { |
135 | - $client = new Client($this->options + [ 'timeout' => 2 ]); |
|
135 | + $client = new Client($this->options + ['timeout' => 2]); |
|
136 | 136 | $response = $client->request('GET', $this->url); |
137 | 137 | $code = $response->getStatusCode(); |
138 | 138 | $data = $response->getBody()->getContents(); |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | |
31 | 31 | public function getCMSFields() |
32 | 32 | { |
33 | - $t_FeedUrl = _t(__CLASS__.'.FEED_URL', 'Feed URL'); |
|
34 | - $t_SummaryLen = _t(__CLASS__.'.SUMMARY_LEN', 'Summary length'); |
|
35 | - $d_SummaryLen = _t(__CLASS__.'.SUMMARY_LEN_COMMENT', 'Maximum length of the summary field (in bytes) when it is generated programmatically'); |
|
36 | - $t_Expiration = _t(__CLASS__.'.EXPIRATION', 'Cache timeout'); |
|
37 | - $d_Expiration = _t(__CLASS__.'.EXPIRATION_COMMENT', 'How many seconds a cached copy must be accessed instead of downloading the real feed'); |
|
33 | + $t_FeedUrl = _t(__CLASS__ . '.FEED_URL', 'Feed URL'); |
|
34 | + $t_SummaryLen = _t(__CLASS__ . '.SUMMARY_LEN', 'Summary length'); |
|
35 | + $d_SummaryLen = _t(__CLASS__ . '.SUMMARY_LEN_COMMENT', 'Maximum length of the summary field (in bytes) when it is generated programmatically'); |
|
36 | + $t_Expiration = _t(__CLASS__ . '.EXPIRATION', 'Cache timeout'); |
|
37 | + $d_Expiration = _t(__CLASS__ . '.EXPIRATION_COMMENT', 'How many seconds a cached copy must be accessed instead of downloading the real feed'); |
|
38 | 38 | |
39 | 39 | $fields = parent::getCMSFields(); |
40 | 40 | $fields->addFieldsToTab('Root.Feed', [ |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | public function getService() |
51 | 51 | { |
52 | - if (! $this->service) { |
|
52 | + if (!$this->service) { |
|
53 | 53 | $this->service = Injector::inst()->create( |
54 | 54 | 'eNTiDi\FeedReader\FeedReaderService', |
55 | 55 | $this->FeedUrl, |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | ]); |
31 | 31 | $handler = HandlerStack::create($mock); |
32 | 32 | |
33 | - $service = new FeedReaderService($url, 3600, [ 'handler' => $handler ]); |
|
33 | + $service = new FeedReaderService($url, 3600, ['handler' => $handler]); |
|
34 | 34 | $service->clearCache(); |
35 | 35 | |
36 | 36 | // First read |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | ]); |
101 | 101 | $handler = HandlerStack::create($mock); |
102 | 102 | |
103 | - $service = new FeedReaderService($url, 3600, [ 'handler' => $handler ]); |
|
103 | + $service = new FeedReaderService($url, 3600, ['handler' => $handler]); |
|
104 | 104 | $service->clearCache(); |
105 | 105 | |
106 | 106 | // First read |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | new Response(200, [], file_get_contents(__DIR__ . '/sample1.rss')), |
169 | 169 | ]); |
170 | 170 | $handler = HandlerStack::create($mock); |
171 | - $service = new FeedReaderService('http://localhost/', 3600, [ 'handler' => $handler ]); |
|
171 | + $service = new FeedReaderService('http://localhost/', 3600, ['handler' => $handler]); |
|
172 | 172 | $service->clearCache(); |
173 | 173 | |
174 | 174 | // Check the default summary length |