@@ -57,7 +57,7 @@ |
||
| 57 | 57 | OAuth\Consumer $consumer, |
| 58 | 58 | OAuth\HttpClient $httpClient, |
| 59 | 59 | Configuration $config |
| 60 | - ){ |
|
| 60 | + ) { |
|
| 61 | 61 | $this->consumer = $consumer; |
| 62 | 62 | $this->httpClient = $httpClient; |
| 63 | 63 | $this->config = $config; |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | Configuration $config, |
| 73 | 73 | SessionStorage $session, |
| 74 | 74 | Nette\Http\IRequest $httpRequest |
| 75 | - ){ |
|
| 75 | + ) { |
|
| 76 | 76 | parent::__construct($consumer, $httpClient, $config); |
| 77 | 77 | |
| 78 | 78 | $this->session = $session; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function limitResults($maxResults) |
| 106 | 106 | { |
| 107 | - $this->maxResults = (int)$maxResults; |
|
| 107 | + $this->maxResults = (int) $maxResults; |
|
| 108 | 108 | |
| 109 | 109 | return $this; |
| 110 | 110 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | public function valid() |
| 119 | 119 | { |
| 120 | 120 | return isset($this->resources[$this->pageCursor][$this->itemCursor]) |
| 121 | - && ! $this->loadedMaxResults(); |
|
| 121 | + && !$this->loadedMaxResults(); |
|
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | /** |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | // Get all request parameters |
| 169 | 169 | $params = $this->responses[$this->pageCursor]->request->getParameters(); |
| 170 | 170 | // Get last record |
| 171 | - $current = Nette\Utils\ArrayHash::from($this->resources[$this->pageCursor][$this->itemCursor-1]); |
|
| 171 | + $current = Nette\Utils\ArrayHash::from($this->resources[$this->pageCursor][$this->itemCursor - 1]); |
|
| 172 | 172 | // And set maximum ID |
| 173 | 173 | $params['max_id'] = $current->id; |
| 174 | 174 | // Get requested path |
@@ -151,7 +151,8 @@ |
||
| 151 | 151 | return; |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - if (isset($this->resources[$this->pageCursor + 1])) { // already loaded |
|
| 154 | + if (isset($this->resources[$this->pageCursor + 1])) { |
|
| 155 | +// already loaded |
|
| 155 | 156 | $this->itemCursor = 0; |
| 156 | 157 | $this->pageCursor++; |
| 157 | 158 | |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Twitter\Exceptions; |
| 16 | 16 | |
| 17 | -class InvalidArgumentException extends \Exception implements IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +class InvalidArgumentException extends \Exception implements IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Twitter\Exceptions; |
| 16 | 16 | |
| 17 | -interface IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +interface IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Twitter\Exceptions; |
| 16 | 16 | |
| 17 | -class InvalidStateException extends \Exception implements IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +class InvalidStateException extends \Exception implements IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Twitter\Exceptions; |
| 16 | 16 | |
| 17 | -class FileNotFoundException extends IOException implements IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +class FileNotFoundException extends IOException implements IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -14,4 +14,6 @@ |
||
| 14 | 14 | |
| 15 | 15 | namespace IPub\Twitter\Exceptions; |
| 16 | 16 | |
| 17 | -class IOException extends \RuntimeException implements IException {} |
|
| 18 | 17 | \ No newline at end of file |
| 18 | +class IOException extends \RuntimeException implements IException |
|
| 19 | +{ |
|
| 20 | +} |
|
| 19 | 21 | \ No newline at end of file |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | */ |
| 75 | 75 | public static function register(Nette\Configurator $config, $extensionName = 'twitter') |
| 76 | 76 | { |
| 77 | - $config->onCompile[] = function (Nette\Configurator $config, Nette\DI\Compiler $compiler) use ($extensionName) { |
|
| 77 | + $config->onCompile[] = function(Nette\Configurator $config, Nette\DI\Compiler $compiler) use ($extensionName) { |
|
| 78 | 78 | $compiler->addExtension($extensionName, new TwitterExtension()); |
| 79 | 79 | }; |
| 80 | 80 | } |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | Configuration $config, |
| 73 | 73 | SessionStorage $session, |
| 74 | 74 | Nette\Http\IRequest $httpRequest |
| 75 | - ){ |
|
| 75 | + ) { |
|
| 76 | 76 | parent::__construct($consumer, $httpClient, $config); |
| 77 | 77 | |
| 78 | 78 | $this->session = $session; |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | |
| 269 | 269 | // Complete request params |
| 270 | 270 | $params = [ |
| 271 | - 'oauth_callback' => $callback ?:$this->consumer->getCallbackUrl(), |
|
| 271 | + 'oauth_callback' => $callback ?: $this->consumer->getCallbackUrl(), |
|
| 272 | 272 | ]; |
| 273 | 273 | |
| 274 | 274 | $response = $this->httpClient->makeRequest( |
@@ -72,7 +72,7 @@ |
||
| 72 | 72 | Configuration $config, |
| 73 | 73 | SessionStorage $session, |
| 74 | 74 | Nette\Http\IRequest $httpRequest |
| 75 | - ){ |
|
| 75 | + ) { |
|
| 76 | 76 | parent::__construct($consumer, $httpClient, $config); |
| 77 | 77 | |
| 78 | 78 | $this->session = $session; |