@@ -27,15 +27,15 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $uploadedFile = $this->getMockFileUpload(); |
| 29 | 29 | $uploadedFile->expects($this->once()) |
| 30 | - ->method('getClientOriginalExtension') |
|
| 31 | - ->will( |
|
| 32 | - $this->returnValue('jpg') |
|
| 33 | - ); |
|
| 30 | + ->method('getClientOriginalExtension') |
|
| 31 | + ->will( |
|
| 32 | + $this->returnValue('jpg') |
|
| 33 | + ); |
|
| 34 | 34 | $uploadedFile->expects($this->once()) |
| 35 | - ->method('guessExtension') |
|
| 36 | - ->will( |
|
| 37 | - $this->returnValue('jpg') |
|
| 38 | - ); |
|
| 35 | + ->method('guessExtension') |
|
| 36 | + ->will( |
|
| 37 | + $this->returnValue('jpg') |
|
| 38 | + ); |
|
| 39 | 39 | |
| 40 | 40 | // Test the validator. |
| 41 | 41 | $validator = new FileValidator(); |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | { |
| 50 | 50 | $uploadedFile = $this->getMockFileUpload(); |
| 51 | 51 | $uploadedFile->expects($this->once()) |
| 52 | - ->method('getClientOriginalExtension') |
|
| 53 | - ->will( |
|
| 54 | - $this->returnValue('doc') |
|
| 55 | - ); |
|
| 52 | + ->method('getClientOriginalExtension') |
|
| 53 | + ->will( |
|
| 54 | + $this->returnValue('doc') |
|
| 55 | + ); |
|
| 56 | 56 | $uploadedFile->expects($this->once()) |
| 57 | - ->method('guessExtension') |
|
| 58 | - ->will( |
|
| 59 | - $this->returnValue('doc') |
|
| 60 | - ); |
|
| 57 | + ->method('guessExtension') |
|
| 58 | + ->will( |
|
| 59 | + $this->returnValue('doc') |
|
| 60 | + ); |
|
| 61 | 61 | |
| 62 | 62 | // Test the validator. |
| 63 | 63 | $validator = new FileValidator(); |
@@ -71,15 +71,15 @@ discard block |
||
| 71 | 71 | { |
| 72 | 72 | $uploadedFile = $this->getMockFileUpload(); |
| 73 | 73 | $uploadedFile->expects($this->once()) |
| 74 | - ->method('getClientOriginalExtension') |
|
| 75 | - ->will( |
|
| 76 | - $this->returnValue('jpg') |
|
| 77 | - ); |
|
| 74 | + ->method('getClientOriginalExtension') |
|
| 75 | + ->will( |
|
| 76 | + $this->returnValue('jpg') |
|
| 77 | + ); |
|
| 78 | 78 | $uploadedFile->expects($this->once()) |
| 79 | - ->method('guessExtension') |
|
| 80 | - ->will( |
|
| 81 | - $this->returnValue('png') |
|
| 82 | - ); |
|
| 79 | + ->method('guessExtension') |
|
| 80 | + ->will( |
|
| 81 | + $this->returnValue('png') |
|
| 82 | + ); |
|
| 83 | 83 | |
| 84 | 84 | // Test the validator. |
| 85 | 85 | $validator = new FileValidator(); |
@@ -53,8 +53,8 @@ |
||
| 53 | 53 | |
| 54 | 54 | if (!$valid) { |
| 55 | 55 | $this->context->buildViolation($constraint->message) |
| 56 | - ->setParameter('{{ string }}', $value) |
|
| 57 | - ->addViolation() |
|
| 56 | + ->setParameter('{{ string }}', $value) |
|
| 57 | + ->addViolation() |
|
| 58 | 58 | ; |
| 59 | 59 | } |
| 60 | 60 | } |
@@ -36,8 +36,7 @@ |
||
| 36 | 36 | $testValue = str_replace(' ', '', $value); |
| 37 | 37 | if (!preg_match('/^(\d+),(\d+),(\d+),(\d+):(\d+),(\d+),(\d+),(\d+)$/', $testValue, $matches)) { |
| 38 | 38 | $valid = false; |
| 39 | - } |
|
| 40 | - else { |
|
| 39 | + } else { |
|
| 41 | 40 | // Check the focus rectangle is inside the crop rectangle. |
| 42 | 41 | $cropFocusCoordinates = explode(':', $testValue); |
| 43 | 42 | $crop = explode(',', $cropFocusCoordinates[0]); |
@@ -114,8 +114,7 @@ |
||
| 114 | 114 | if (!empty($uploaderEvent)) { |
| 115 | 115 | $this->eventDispatcher->dispatch(UploaderEvents::UPLOADER_UPLOADED, $uploaderEvent); |
| 116 | 116 | } |
| 117 | - } |
|
| 118 | - else { |
|
| 117 | + } else { |
|
| 119 | 118 | $error = empty($this->error) ? $this->file->getErrorMessage() : $this->error; |
| 120 | 119 | throw new FileException( |
| 121 | 120 | $error |