@@ -39,7 +39,7 @@ |
||
| 39 | 39 | { |
| 40 | 40 | /** @var \Google\Cloud\Vision\V1\CropHint $item */ |
| 41 | 41 | foreach ($this->getOriginalResponse()->getCropHints() as $item) { |
| 42 | - $bounds = array_map(function (Vertex $vertex) { |
|
| 42 | + $bounds = array_map(function(Vertex $vertex) { |
|
| 43 | 43 | return new VertexData($vertex->getX(), $vertex->getY()); |
| 44 | 44 | }, iterator_to_array($item->getBoundingPoly()->getVertices())); |
| 45 | 45 | |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | foreach ($response as $entity) { |
| 43 | 43 | yield new LandmarkData( |
| 44 | 44 | name: $entity->getDescription(), |
| 45 | - locations: array_map(function (LocationInfo $location) { |
|
| 45 | + locations: array_map(function(LocationInfo $location) { |
|
| 46 | 46 | $info = $location->getLatLng(); |
| 47 | 47 | |
| 48 | 48 | if (is_null($info)) { |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | $annotations = $detection->getTextAnnotations(); |
| 29 | 29 | |
| 30 | - if (! $annotations->count()) { |
|
| 30 | + if (!$annotations->count()) { |
|
| 31 | 31 | return null; |
| 32 | 32 | } |
| 33 | 33 | |
@@ -60,6 +60,6 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | public function __toString(): string |
| 62 | 62 | { |
| 63 | - return $this->plain()?->text ?? ''; |
|
| 63 | + return $this->plain() ? ->text ?? ''; |
|
| 64 | 64 | } |
| 65 | 65 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | { |
| 24 | 24 | $response = $this->getOriginalResponse(); |
| 25 | 25 | |
| 26 | - if (! $response) { |
|
| 26 | + if (!$response) { |
|
| 27 | 27 | return null; |
| 28 | 28 | } |
| 29 | 29 | |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | { |
| 30 | 30 | $response = $this->getOriginalResponse(); |
| 31 | 31 | |
| 32 | - if (! $response) { |
|
| 32 | + if (!$response) { |
|
| 33 | 33 | return null; |
| 34 | 34 | } |
| 35 | 35 | |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | */ |
| 50 | 50 | protected function getBestGuessLabels(WebDetection $response): array |
| 51 | 51 | { |
| 52 | - return array_map(function (WebLabel $label) { |
|
| 52 | + return array_map(function(WebLabel $label) { |
|
| 53 | 53 | return $label->getLabel(); |
| 54 | 54 | }, iterator_to_array($response->getBestGuessLabels())); |
| 55 | 55 | } |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | */ |
| 61 | 61 | protected function getPagesWithMatchingImages(WebDetection $response): array |
| 62 | 62 | { |
| 63 | - return array_map(function (WebPage $item) { |
|
| 63 | + return array_map(function(WebPage $item) { |
|
| 64 | 64 | return new WebPageData($item->getUrl(), $item->getPageTitle(), $item->getScore()); |
| 65 | 65 | }, iterator_to_array($response->getPagesWithMatchingImages())); |
| 66 | 66 | } |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | */ |
| 72 | 72 | protected function getFullMatchingImages(WebDetection $response): array |
| 73 | 73 | { |
| 74 | - return array_map(function (WebImage $item) { |
|
| 74 | + return array_map(function(WebImage $item) { |
|
| 75 | 75 | return new WebImageData($item->getUrl(), $item->getScore()); |
| 76 | 76 | }, iterator_to_array($response->getFullMatchingImages())); |
| 77 | 77 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | */ |
| 83 | 83 | protected function getPartialMatchingImages(WebDetection $response): array |
| 84 | 84 | { |
| 85 | - return array_map(function (WebImage $item) { |
|
| 85 | + return array_map(function(WebImage $item) { |
|
| 86 | 86 | return new WebImageData($item->getUrl(), $item->getScore()); |
| 87 | 87 | }, iterator_to_array($response->getPartialMatchingImages())); |
| 88 | 88 | } |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | */ |
| 94 | 94 | protected function getVisuallySimilarImages(WebDetection $response): array |
| 95 | 95 | { |
| 96 | - return array_map(function (WebImage $item) { |
|
| 96 | + return array_map(function(WebImage $item) { |
|
| 97 | 97 | return new WebImageData($item->getUrl(), $item->getScore()); |
| 98 | 98 | }, iterator_to_array($response->getVisuallySimilarImages())); |
| 99 | 99 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | protected function getWebEntries(WebDetection $response): array |
| 106 | 106 | { |
| 107 | - return array_map(function (WebEntity $item) { |
|
| 107 | + return array_map(function(WebEntity $item) { |
|
| 108 | 108 | return new WebEntityData($item->getEntityId(), $item->getScore(), $item->getDescription()); |
| 109 | 109 | }, iterator_to_array($response->getWebEntities())); |
| 110 | 110 | } |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | foreach ($faces as $face) { |
| 55 | 55 | $vertices = $face->getBoundingPoly()->getVertices(); |
| 56 | 56 | |
| 57 | - $bounds = array_map(function (Vertex $vertex) { |
|
| 57 | + $bounds = array_map(function(Vertex $vertex) { |
|
| 58 | 58 | return new VertexData($vertex->getX(), $vertex->getY()); |
| 59 | 59 | }, iterator_to_array($vertices)); |
| 60 | 60 | |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | |
| 119 | 119 | protected function getFile(): File |
| 120 | 120 | { |
| 121 | - if (! $this->inputFile) { |
|
| 121 | + if (!$this->inputFile) { |
|
| 122 | 122 | throw new FileException('Please specify the file!'); |
| 123 | 123 | } |
| 124 | 124 | |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | { |
| 15 | 15 | $contents = $file->getContents(); |
| 16 | 16 | |
| 17 | - if (! $contents) { |
|
| 17 | + if (!$contents) { |
|
| 18 | 18 | throw new FileException('Invalid file!'); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -95,6 +95,6 @@ discard block |
||
| 95 | 95 | |
| 96 | 96 | private function getFontPath(string $font): string |
| 97 | 97 | { |
| 98 | - return dirname(__DIR__, 2) . '/fonts/' . $font; |
|
| 98 | + return dirname(__DIR__, 2).'/fonts/'.$font; |
|
| 99 | 99 | } |
| 100 | 100 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | { |
| 24 | 24 | $response = $this->getOriginalResponse(); |
| 25 | 25 | |
| 26 | - if (! $response) { |
|
| 26 | + if (!$response) { |
|
| 27 | 27 | return null; |
| 28 | 28 | } |
| 29 | 29 | |