@@ -6,9 +6,9 @@ |
||
6 | 6 | |
7 | 7 | use Marek\OpenWeatherMap\Core\WeatherServices; |
8 | 8 | |
9 | -describe(WeatherServices::class, static function () { |
|
10 | - describe('->getWeatherService', static function () { |
|
11 | - it('it is ok', static function () { |
|
9 | +describe(WeatherServices::class, static function() { |
|
10 | + describe('->getWeatherService', static function() { |
|
11 | + it('it is ok', static function() { |
|
12 | 12 | expect(1)->toBe(1); |
13 | 13 | }); |
14 | 14 | }); |
@@ -6,39 +6,39 @@ |
||
6 | 6 | |
7 | 7 | use Marek\OpenWeatherMap\Http\Client\SymfonyHttpClient; |
8 | 8 | |
9 | -describe(SymfonyHttpClient::class, function () { |
|
10 | - beforeEach(function () { |
|
9 | +describe(SymfonyHttpClient::class, function() { |
|
10 | + beforeEach(function() { |
|
11 | 11 | $this->data = '{"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":300,"main":"Drizzle","description":"light intensity drizzle","icon":"09d"}],"base":"stations","main":{"temp":280.32,"pressure":1012,"humidity":81,"temp_min":279.15,"temp_max":281.15},"visibility":10000,"wind":{"speed":4.1,"deg":80},"clouds":{"all":90},"dt":1485789600,"sys":{"type":1,"id":5091,"message":0.0103,"country":"GB","sunrise":1485762037,"sunset":1485794875},"id":2643743,"name":"London","cod":200}'; |
12 | 12 | $this->decoded = json_decode($this->data, true, 512, JSON_THROW_ON_ERROR); |
13 | 13 | $this->response = new JsonResponse($this->data, 300); |
14 | 14 | }); |
15 | 15 | |
16 | - describe('->getStatusCode()', function () { |
|
17 | - it('expects that it will return proper http status code', function () { |
|
16 | + describe('->getStatusCode()', function() { |
|
17 | + it('expects that it will return proper http status code', function() { |
|
18 | 18 | expect($this->response->getStatusCode())->toBe(200); |
19 | 19 | }); |
20 | 20 | }); |
21 | 21 | |
22 | - describe('->getData()', function () { |
|
23 | - it('expects that', function () { |
|
22 | + describe('->getData()', function() { |
|
23 | + it('expects that', function() { |
|
24 | 24 | expect($this->response->getData())->toBe($this->decoded); |
25 | 25 | }); |
26 | 26 | }); |
27 | 27 | |
28 | - describe('->isOk()', function () { |
|
29 | - it('expects that', function () { |
|
28 | + describe('->isOk()', function() { |
|
29 | + it('expects that', function() { |
|
30 | 30 | expect($this->response->isOk())->toBe(true); |
31 | 31 | }); |
32 | 32 | }); |
33 | 33 | |
34 | - describe('->isAuthorized()', function () { |
|
35 | - it('expects that', function () { |
|
34 | + describe('->isAuthorized()', function() { |
|
35 | + it('expects that', function() { |
|
36 | 36 | expect($this->response->isAuthorized())->toBe(true); |
37 | 37 | }); |
38 | 38 | }); |
39 | 39 | |
40 | - describe('->getMessage()', function () { |
|
41 | - it('expects that', function () { |
|
40 | + describe('->getMessage()', function() { |
|
41 | + it('expects that', function() { |
|
42 | 42 | expect($this->response->getMessage())->toBe(''); |
43 | 43 | }); |
44 | 44 | }); |
@@ -6,39 +6,39 @@ |
||
6 | 6 | |
7 | 7 | use Marek\OpenWeatherMap\Http\Response\JsonResponse; |
8 | 8 | |
9 | -describe(JsonResponse::class, function () { |
|
10 | - beforeEach(function () { |
|
9 | +describe(JsonResponse::class, function() { |
|
10 | + beforeEach(function() { |
|
11 | 11 | $this->data = '{"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":300,"main":"Drizzle","description":"light intensity drizzle","icon":"09d"}],"base":"stations","main":{"temp":280.32,"pressure":1012,"humidity":81,"temp_min":279.15,"temp_max":281.15},"visibility":10000,"wind":{"speed":4.1,"deg":80},"clouds":{"all":90},"dt":1485789600,"sys":{"type":1,"id":5091,"message":0.0103,"country":"GB","sunrise":1485762037,"sunset":1485794875},"id":2643743,"name":"London","cod":200}'; |
12 | 12 | $this->decoded = json_decode($this->data, true, 512, JSON_THROW_ON_ERROR); |
13 | 13 | $this->response = new JsonResponse($this->data, 300); |
14 | 14 | }); |
15 | 15 | |
16 | - describe('->getStatusCode()', function () { |
|
17 | - it('expects that it will return proper http status code', function () { |
|
16 | + describe('->getStatusCode()', function() { |
|
17 | + it('expects that it will return proper http status code', function() { |
|
18 | 18 | expect($this->response->getStatusCode())->toBe(200); |
19 | 19 | }); |
20 | 20 | }); |
21 | 21 | |
22 | - describe('->getData()', function () { |
|
23 | - it('expects that', function () { |
|
22 | + describe('->getData()', function() { |
|
23 | + it('expects that', function() { |
|
24 | 24 | expect($this->response->getData())->toBe($this->decoded); |
25 | 25 | }); |
26 | 26 | }); |
27 | 27 | |
28 | - describe('->isOk()', function () { |
|
29 | - it('expects that', function () { |
|
28 | + describe('->isOk()', function() { |
|
29 | + it('expects that', function() { |
|
30 | 30 | expect($this->response->isOk())->toBe(true); |
31 | 31 | }); |
32 | 32 | }); |
33 | 33 | |
34 | - describe('->isAuthorized()', function () { |
|
35 | - it('expects that', function () { |
|
34 | + describe('->isAuthorized()', function() { |
|
35 | + it('expects that', function() { |
|
36 | 36 | expect($this->response->isAuthorized())->toBe(true); |
37 | 37 | }); |
38 | 38 | }); |
39 | 39 | |
40 | - describe('->getMessage()', function () { |
|
41 | - it('expects that', function () { |
|
40 | + describe('->getMessage()', function() { |
|
41 | + it('expects that', function() { |
|
42 | 42 | expect($this->response->getMessage())->toBe(''); |
43 | 43 | }); |
44 | 44 | }); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function getGetParameterValue(): string |
43 | 43 | { |
44 | - return (string) $this->longitude; |
|
44 | + return (string)$this->longitude; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | protected function validate(float $longitude): void |
61 | 61 | { |
62 | 62 | if ($longitude < -180 || $longitude > 180) { |
63 | - throw new InvalidArgumentException((string) $longitude, 'longitude', self::class); |
|
63 | + throw new InvalidArgumentException((string)$longitude, 'longitude', self::class); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | } |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function getGetParameterValue(): string |
43 | 43 | { |
44 | - return (string) $this->latitude; |
|
44 | + return (string)$this->latitude; |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | protected function validate(float $latitude): void |
61 | 61 | { |
62 | 62 | if ($latitude < -90 || $latitude > 90) { |
63 | - throw new InvalidArgumentException((string) $latitude, 'latitude', self::class); |
|
63 | + throw new InvalidArgumentException((string)$latitude, 'latitude', self::class); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function getGetParameterValue(): string |
40 | 40 | { |
41 | - return (string) $this->datetime->getTimestamp(); |
|
41 | + return (string)$this->datetime->getTimestamp(); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public function getGetParameterName(): string |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $this->data = $data; |
31 | 31 | |
32 | 32 | if (is_array($data) && array_key_exists('cod', $data)) { |
33 | - $this->httpCode = (int) $data['cod']; |
|
33 | + $this->httpCode = (int)$data['cod']; |
|
34 | 34 | } else { |
35 | 35 | $this->httpCode = $httpCode; |
36 | 36 | } |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | public function getMessage(): string |
97 | 97 | { |
98 | 98 | if (is_array($this->data) && array_key_exists('message', $this->data)) { |
99 | - return (string) $this->data['message']; |
|
99 | + return (string)$this->data['message']; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | return ''; |