@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | * @param SplFileInfo $file |
| 53 | 53 | * @return bool |
| 54 | 54 | */ |
| 55 | - $filter = function (SplFileInfo $file) { |
|
| 56 | - if (!in_array($file->getExtension(), ['yml','json']) || $file->isDir()) { |
|
| 55 | + $filter = function(SplFileInfo $file) { |
|
| 56 | + if (!in_array($file->getExtension(), ['yml', 'json']) || $file->isDir()) { |
|
| 57 | 57 | return false; |
| 58 | 58 | } |
| 59 | 59 | return true; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | try { |
| 65 | 65 | $this->doImport($finder, $input, $output); |
| 66 | 66 | } catch (MissingTargetException $e) { |
| 67 | - $output->writeln('<error>' . $e->getMessage() . '</error>'); |
|
| 67 | + $output->writeln('<error>'.$e->getMessage().'</error>'); |
|
| 68 | 68 | } |
| 69 | 69 | } |
| 70 | 70 | |
@@ -51,13 +51,13 @@ discard block |
||
| 51 | 51 | $responseMock |
| 52 | 52 | ->method('getHeader') |
| 53 | 53 | ->with('Link') |
| 54 | - ->willReturn(['<' . $host . $path . '>; rel="self"']); |
|
| 54 | + ->willReturn(['<'.$host.$path.'>; rel="self"']); |
|
| 55 | 55 | |
| 56 | 56 | $promiseMock |
| 57 | 57 | ->method('then') |
| 58 | 58 | ->will( |
| 59 | 59 | $this->returnCallback( |
| 60 | - function ($ok) use ($responseMock) { |
|
| 60 | + function($ok) use ($responseMock) { |
|
| 61 | 61 | $ok($responseMock); |
| 62 | 62 | } |
| 63 | 63 | ) |
@@ -74,8 +74,8 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | $cmdTester = $this->getTester($sut, $file); |
| 76 | 76 | |
| 77 | - $this->assertContains('Loading data from ' . $file, $cmdTester->getDisplay()); |
|
| 78 | - $this->assertContains('Wrote <' . $host . $path . '>; rel="self"', $cmdTester->getDisplay()); |
|
| 77 | + $this->assertContains('Loading data from '.$file, $cmdTester->getDisplay()); |
|
| 78 | + $this->assertContains('Wrote <'.$host.$path.'>; rel="self"', $cmdTester->getDisplay()); |
|
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /** |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | return [ |
| 87 | 87 | 'basic valid file' => [ |
| 88 | 88 | 'http://localhost', |
| 89 | - __DIR__ . '/fixtures/set-01/test-2.json', |
|
| 89 | + __DIR__.'/fixtures/set-01/test-2.json', |
|
| 90 | 90 | '/core/app/test', |
| 91 | 91 | ], |
| 92 | 92 | ]; |
@@ -100,7 +100,7 @@ discard block |
||
| 100 | 100 | return [ |
| 101 | 101 | 'basic valid image file' => [ |
| 102 | 102 | 'http://localhost', |
| 103 | - __DIR__ . '/fixtures/file', |
|
| 103 | + __DIR__.'/fixtures/file', |
|
| 104 | 104 | '/core/app/test', |
| 105 | 105 | ], |
| 106 | 106 | ]; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | $requestMock = $this->getMock('Psr\Http\Message\RequestInterface'); |
| 135 | 135 | $requestMock |
| 136 | 136 | ->method('getUri') |
| 137 | - ->willReturn($host . '/core/app/test'); |
|
| 137 | + ->willReturn($host.'/core/app/test'); |
|
| 138 | 138 | |
| 139 | 139 | $exceptionMock = $this->getMockBuilder('GuzzleHttp\Exception\RequestException') |
| 140 | 140 | ->setConstructorArgs(['Client error: 400', $requestMock, $responseMock]) |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | ->method('then') |
| 153 | 153 | ->will( |
| 154 | 154 | $this->returnCallback( |
| 155 | - function ($ok, $nok) use ($exceptionMock) { |
|
| 155 | + function($ok, $nok) use ($exceptionMock) { |
|
| 156 | 156 | return $nok($exceptionMock); |
| 157 | 157 | } |
| 158 | 158 | ) |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | $cmdTester = $this->getTester($sut, $file); |
| 171 | 171 | |
| 172 | - $this->assertContains('Loading data from ' . $file, $cmdTester->getDisplay()); |
|
| 172 | + $this->assertContains('Loading data from '.$file, $cmdTester->getDisplay()); |
|
| 173 | 173 | foreach ($errors as $error) { |
| 174 | 174 | $this->assertContains( |
| 175 | 175 | $error, |
@@ -186,18 +186,18 @@ discard block |
||
| 186 | 186 | return [ |
| 187 | 187 | 'invalid file (server side)' => [ |
| 188 | 188 | 'http://localhost', |
| 189 | - __DIR__ . '/fixtures/set-01/test.json', |
|
| 189 | + __DIR__.'/fixtures/set-01/test.json', |
|
| 190 | 190 | [ |
| 191 | - 'Failed to write <http://localhost/core/app/test> from \'' . |
|
| 192 | - __DIR__ . '/fixtures/set-01/test.json\' with message \'Client error: 400\'', |
|
| 191 | + 'Failed to write <http://localhost/core/app/test> from \''. |
|
| 192 | + __DIR__.'/fixtures/set-01/test.json\' with message \'Client error: 400\'', |
|
| 193 | 193 | '"message": "invalid"', |
| 194 | 194 | ], |
| 195 | 195 | ], |
| 196 | 196 | 'missing target in file (user error)' => [ |
| 197 | 197 | 'http://localhost', |
| 198 | - __DIR__ . '/fixtures/set-01/test-3.json', |
|
| 198 | + __DIR__.'/fixtures/set-01/test-3.json', |
|
| 199 | 199 | [ |
| 200 | - 'Missing target in \'' . __DIR__ . '/fixtures/set-01/test-3.json\'', |
|
| 200 | + 'Missing target in \''.__DIR__.'/fixtures/set-01/test-3.json\'', |
|
| 201 | 201 | ], |
| 202 | 202 | ] |
| 203 | 203 | ]; |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | ->method('then') |
| 235 | 235 | ->will( |
| 236 | 236 | $this->returnCallback( |
| 237 | - function ($ok) use ($responseMock) { |
|
| 237 | + function($ok) use ($responseMock) { |
|
| 238 | 238 | $ok($responseMock); |
| 239 | 239 | } |
| 240 | 240 | ) |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | |
| 252 | 252 | $cmdTester = $this->getTester( |
| 253 | 253 | $sut, |
| 254 | - __DIR__ . '/fixtures/set-01/test-4.json', |
|
| 254 | + __DIR__.'/fixtures/set-01/test-4.json', |
|
| 255 | 255 | [ |
| 256 | 256 | 'host' => 'http://example.com', |
| 257 | 257 | '--rewrite-host' => 'http://localhost' |
@@ -211,7 +211,7 @@ discard block |
||
| 211 | 211 | * @param string $rewriteTo string to replace value from $rewriteHost with during loading |
| 212 | 212 | * @param boolean $sync send requests syncronously |
| 213 | 213 | * |
| 214 | - * @return Promise\Promise|null |
|
| 214 | + * @return Promise\PromiseInterface |
|
| 215 | 215 | */ |
| 216 | 216 | protected function importResource( |
| 217 | 217 | $targetUrl, |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | * |
| 331 | 331 | * @param Document $doc Data source for import data |
| 332 | 332 | * @param string $originFile Original full filename used toimport |
| 333 | - * @return bool|mixed |
|
| 333 | + * @return false|string |
|
| 334 | 334 | */ |
| 335 | 335 | private function validateUploadFile(Document $doc, $originFile) |
| 336 | 336 | { |