Completed
Push — master ( 96c1a6...600eed )
by Anatoliy
13s queued 11s
created
src/entity/Geo.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,13 +26,13 @@
 block discarded – undo
26 26
     public function __construct(Address $address, AddressDetails $address_details, Point $point,
27 27
         $name, $description, $kind, $text)
28 28
     {
29
-        $this->address=$address;
30
-        $this->address_details=$address_details;
31
-        $this->point=$point;
32
-        $this->name=$name;
33
-        $this->description=$description;
34
-        $this->kind=$kind;
35
-        $this->text=$text;
29
+        $this->address = $address;
30
+        $this->address_details = $address_details;
31
+        $this->point = $point;
32
+        $this->name = $name;
33
+        $this->description = $description;
34
+        $this->kind = $kind;
35
+        $this->text = $text;
36 36
     }
37 37
 
38 38
     /**
Please login to merge, or discard this patch.
src/entity/AddressDetails.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -57,19 +57,19 @@
 block discarded – undo
57 57
      */
58 58
     public static function fromState(array $state): self
59 59
     {
60
-        $addressLine=ArrayHelper::getValue($state,'Country.AddressLine');
61
-        $countryNameCode=ArrayHelper::getValue($state,'Country.CountryNameCode');
62
-        $countryName=ArrayHelper::getValue($state,'Country.CountryName');
63
-        $administrativeAreaName=ArrayHelper::getValue($state,'Country.AdministrativeArea.AdministrativeAreaName');
64
-        $subAdministrariveAreaName=ArrayHelper::getValue($state,'Country.AdministrativeArea.SubAdministrativeArea.SubAdministrativeAreaName');
65
-        $subAdm=ArrayHelper::getValue($state,'Country.AdministrativeArea.SubAdministrativeArea');
66
-        $locality=ArrayHelper::getValue($subAdm,'Locality.LocalityName');
67
-        $throughfareName=ArrayHelper::getValue($subAdm,'Locality.Thoroughfare.ThoroughfareName');
68
-        $premiseNumber=ArrayHelper::getValue($subAdm,'Locality.Thoroughfare.Premise.PremiseNumber');
69
-        $postalCodeNumber=ArrayHelper::getValue($subAdm,'Locality.Thoroughfare.Premise.PostalCode.PostalCodeNumber');
70
-
71
-        return new self($addressLine,$countryNameCode,$countryName,$administrativeAreaName,
72
-            $subAdministrariveAreaName,$locality,$throughfareName,$premiseNumber,$postalCodeNumber);
60
+        $addressLine = ArrayHelper::getValue($state, 'Country.AddressLine');
61
+        $countryNameCode = ArrayHelper::getValue($state, 'Country.CountryNameCode');
62
+        $countryName = ArrayHelper::getValue($state, 'Country.CountryName');
63
+        $administrativeAreaName = ArrayHelper::getValue($state, 'Country.AdministrativeArea.AdministrativeAreaName');
64
+        $subAdministrariveAreaName = ArrayHelper::getValue($state, 'Country.AdministrativeArea.SubAdministrativeArea.SubAdministrativeAreaName');
65
+        $subAdm = ArrayHelper::getValue($state, 'Country.AdministrativeArea.SubAdministrativeArea');
66
+        $locality = ArrayHelper::getValue($subAdm, 'Locality.LocalityName');
67
+        $throughfareName = ArrayHelper::getValue($subAdm, 'Locality.Thoroughfare.ThoroughfareName');
68
+        $premiseNumber = ArrayHelper::getValue($subAdm, 'Locality.Thoroughfare.Premise.PremiseNumber');
69
+        $postalCodeNumber = ArrayHelper::getValue($subAdm, 'Locality.Thoroughfare.Premise.PostalCode.PostalCodeNumber');
70
+
71
+        return new self($addressLine, $countryNameCode, $countryName, $administrativeAreaName,
72
+            $subAdministrariveAreaName, $locality, $throughfareName, $premiseNumber, $postalCodeNumber);
73 73
     }
74 74
 
75 75
     /**
Please login to merge, or discard this patch.
src/exeptions/FormatResponseException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,7 @@
 block discarded – undo
6 6
 
7 7
 class FormatResponseException extends \Exception
8 8
 {
9
-    public function getName(){
9
+    public function getName() {
10 10
         return 'Error Format Response';
11 11
     }
12 12
 
Please login to merge, or discard this patch.
src/exeptions/ProxyConfException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 class ProxyConfException extends \Exception
8 8
 {
9 9
 
10
-    public function getName(){
10
+    public function getName() {
11 11
         return 'Proxy Config Exception';
12 12
     }
13 13
 
Please login to merge, or discard this patch.
src/contracts/Geocode.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -6,6 +6,6 @@
 block discarded – undo
6 6
 
7 7
 interface Geocode
8 8
 {
9
-    public function get($query,$params=[]);
9
+    public function get($query, $params = []);
10 10
 
11 11
 }
12 12
\ No newline at end of file
Please login to merge, or discard this patch.
src/GeocodeCollectionComponent.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -29,17 +29,17 @@
 block discarded – undo
29 29
     {
30 30
         parent::init();
31 31
 
32
-        if(\Yii::$container->has(\talismanfr\geocode\contracts\Geocode::class)){
33
-            $this->geocode=\Yii::$container->get(\talismanfr\geocode\contracts\Geocode::class);
34
-        }else{
35
-            $geocode=new Geocode();
36
-            $geocode->apikey=$this->apikey;
37
-            $geocode->useProxy=$this->useProxy;
38
-            $geocode->proxyConf=$this->proxyConf;
39
-            $this->geocode=$geocode;
32
+        if (\Yii::$container->has(\talismanfr\geocode\contracts\Geocode::class)) {
33
+            $this->geocode = \Yii::$container->get(\talismanfr\geocode\contracts\Geocode::class);
34
+        }else {
35
+            $geocode = new Geocode();
36
+            $geocode->apikey = $this->apikey;
37
+            $geocode->useProxy = $this->useProxy;
38
+            $geocode->proxyConf = $this->proxyConf;
39
+            $this->geocode = $geocode;
40 40
         }
41 41
 
42
-        $this->collection=new GeocodeCollection($this->geocode);
42
+        $this->collection = new GeocodeCollection($this->geocode);
43 43
     }
44 44
 
45 45
     public function get($query): array
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@
 block discarded – undo
31 31
 
32 32
         if(\Yii::$container->has(\talismanfr\geocode\contracts\Geocode::class)){
33 33
             $this->geocode=\Yii::$container->get(\talismanfr\geocode\contracts\Geocode::class);
34
-        }else{
34
+        } else{
35 35
             $geocode=new Geocode();
36 36
             $geocode->apikey=$this->apikey;
37 37
             $geocode->useProxy=$this->useProxy;
Please login to merge, or discard this patch.
src/GeocodeCollection.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -40,12 +40,12 @@  discard block
 block discarded – undo
40 40
      * @return Geo
41 41
      * @throws FormatResponseException
42 42
      */
43
-    public function one($query,$params=[])
43
+    public function one($query, $params = [])
44 44
     {
45
-        $params['results']=1;
46
-        $geos=$this->find($query,$params);
45
+        $params['results'] = 1;
46
+        $geos = $this->find($query, $params);
47 47
 
48
-        if(count($geos)>0){
48
+        if (count($geos)>0) {
49 49
             return array_shift($geos);
50 50
         }
51 51
 
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
         $data = ArrayHelper::getValue($geo_result, 'response.GeoObjectCollection.featureMember');
72 72
 
73 73
         if (!$data) {
74
-            $meta=ArrayHelper::getValue($geo_result,'response.GeoObjectCollection.metaDataProperty.GeocoderResponseMetaData');
74
+            $meta = ArrayHelper::getValue($geo_result, 'response.GeoObjectCollection.metaDataProperty.GeocoderResponseMetaData');
75 75
 
76
-            if(!$meta) {
76
+            if (!$meta) {
77 77
                 throw new FormatResponseException('Error format response from query ' . $query);
78 78
             }
79 79
 
Please login to merge, or discard this patch.
src/decorators/GeocodeCache.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -15,20 +15,20 @@
 block discarded – undo
15 15
     /** @var \yii\caching\CacheInterface */
16 16
     private $cache;
17 17
 
18
-    public $duration=null;
18
+    public $duration = null;
19 19
 
20
-    public $dependency=null;
20
+    public $dependency = null;
21 21
 
22
-    public function __construct(Geocode $geocode,CacheInterface $cache)
22
+    public function __construct(Geocode $geocode, CacheInterface $cache)
23 23
     {
24
-        $this->geocode=$geocode;
25
-        $this->cache=$cache;
24
+        $this->geocode = $geocode;
25
+        $this->cache = $cache;
26 26
     }
27 27
 
28 28
     public function get($query, $params = [])
29 29
     {
30
-        return $this->cache->getOrSet($query,function ()use($query){
30
+        return $this->cache->getOrSet($query, function()use($query){
31 31
             return $this->geocode->get($query);
32
-        },$this->duration,$this->dependency);
32
+        },$this->duration, $this->dependency);
33 33
     }
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
src/entity/Address.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -30,22 +30,22 @@  discard block
 block discarded – undo
30 30
         $this->components = $components;
31 31
     }
32 32
 
33
-    public static function fromState(array $state){
34
-        $components=[];
33
+    public static function fromState(array $state) {
34
+        $components = [];
35 35
 
36
-        foreach (ArrayHelper::getValue($state,'Components') as $componentState){
37
-            $kind=ArrayHelper::getValue($componentState,'kind');
38
-            $name=ArrayHelper::getValue($componentState,'name');
36
+        foreach (ArrayHelper::getValue($state, 'Components') as $componentState) {
37
+            $kind = ArrayHelper::getValue($componentState, 'kind');
38
+            $name = ArrayHelper::getValue($componentState, 'name');
39 39
 
40
-            $component=new AddressComponent($kind,$name);
40
+            $component = new AddressComponent($kind, $name);
41 41
 
42
-            $components[$kind][]=$component;
42
+            $components[$kind][] = $component;
43 43
         }
44 44
 
45
-        $country_code=ArrayHelper::getValue($state,'country_code','');
46
-        $formatted=ArrayHelper::getValue($state,'formatted','');
45
+        $country_code = ArrayHelper::getValue($state, 'country_code', '');
46
+        $formatted = ArrayHelper::getValue($state, 'formatted', '');
47 47
 
48
-        return new self($country_code,$formatted,$components);
48
+        return new self($country_code, $formatted, $components);
49 49
     }
50 50
 
51 51
     /**
@@ -72,9 +72,9 @@  discard block
 block discarded – undo
72 72
         return $this->components;
73 73
     }
74 74
 
75
-    public function getKindName($kind){
76
-        if(isset($this->components[$kind])){
77
-            $component=$this->components[$kind][count($this->components[$kind])-1];
75
+    public function getKindName($kind) {
76
+        if (isset($this->components[$kind])) {
77
+            $component = $this->components[$kind][count($this->components[$kind]) - 1];
78 78
             return $component->getName();
79 79
         }
80 80
 
Please login to merge, or discard this patch.