@@ -59,7 +59,7 @@ |
||
59 | 59 | mid: $obj->getMid(), |
60 | 60 | languageCode: $obj->getLanguageCode(), |
61 | 61 | score: $obj->getScore(), |
62 | - normalizedVertices: array_map(function (NormalizedVertex $item) { |
|
62 | + normalizedVertices: array_map(function(NormalizedVertex $item) { |
|
63 | 63 | return [ |
64 | 64 | 'x' => $item->getX(), |
65 | 65 | 'y' => $item->getY(), |
@@ -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 |
@@ -30,7 +30,7 @@ |
||
30 | 30 | { |
31 | 31 | $response = $this->getOriginalResponse(); |
32 | 32 | |
33 | - if (! $response) { |
|
33 | + if (!$response) { |
|
34 | 34 | return null; |
35 | 35 | } |
36 | 36 |
@@ -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 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | $draw = new DrawBoxAroundObjects($this->objectLocalizer, $this->image); |
29 | 29 | $draw->setBoxColor($this->boxColor); |
30 | 30 | |
31 | - $draw->setCallback(function (Image $image, LocalizedObjectData $obj) { |
|
31 | + $draw->setCallback(function(Image $image, LocalizedObjectData $obj) { |
|
32 | 32 | $width = $image->getWidth(); |
33 | 33 | $height = $image->getHeight(); |
34 | 34 |
@@ -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 |