Test Setup Failed
Branch master (b616a6)
by Dennis
04:39
created
src/Packages/RegionModel.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -146,8 +146,9 @@
 block discarded – undo
146 146
      */
147 147
     public function checkNumber(string $number): bool
148 148
     {
149
-        if (strlen($number) < 10)
150
-            return false;
149
+        if (strlen($number) < 10) {
150
+                    return false;
151
+        }
151 152
         $area = substr($number, 0, strlen($this->area));
152 153
         return $this->area == $area;
153 154
     }
Please login to merge, or discard this patch.
src/Packages/FlattenRegion.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
 
20 20
     protected function setFlatten(Collection $regions)
21 21
     {
22
-        $regions->each(function (RegionModel $region) {
22
+        $regions->each(function(RegionModel $region) {
23 23
             $this->regions->add($this->flatten($region));
24 24
         });
25 25
         $this->regions = $this->regions->flatten(5);
Please login to merge, or discard this patch.
src/Casts/LineString.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
         $points = explode(',', $pointString);
47 47
 
48
-        $decoded = array_map(function ($point) {
48
+        $decoded = array_map(function($point) {
49 49
             $_value = array_reverse(explode(' ', trim($point)));
50 50
             return [(float) $_value[0], (float) $_value[1]];
51 51
         }, $points);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     public function set($model, $key, $value, $attributes)
66 66
     {
67 67
         $srid = 4326;
68
-        $array = Arr::map($value, function ($rs) {
68
+        $array = Arr::map($value, function($rs) {
69 69
             return Arr::join(array_reverse($rs), ' ');
70 70
         });
71 71
         return DB::raw("ST_GeomFromText('LINESTRING(" . Arr::join($array, ',') . ")',$srid)");
Please login to merge, or discard this patch.
src/Packages/ChildrenRecursively.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
      */
26 26
     protected function loadRecursively(RegionModel $region, string $code, int $deep = 0):Collection
27 27
     {
28
-        $regions  = new Collection();
28
+        $regions = new Collection();
29 29
         if ($region->code === $code) {
30 30
             $regions = $region->children;
31 31
             if ($deep > 0) {
Please login to merge, or discard this patch.
src/Validation/RegionRule.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -53,8 +53,9 @@
 block discarded – undo
53 53
      */
54 54
     public function passes($value)
55 55
     {
56
-        if (!$this->ruleClass)
57
-            return false;
56
+        if (!$this->ruleClass) {
57
+                    return false;
58
+        }
58 59
         return $this->getRule($value)->isValid();
59 60
     }
60 61
 
Please login to merge, or discard this patch.
src/Packages/RegionStatic.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -78,6 +78,6 @@
 block discarded – undo
78 78
      */
79 79
     public function getAttributes():array
80 80
     {
81
-        return ['name','short','code','area','zip','lng','lat'];
81
+        return ['name', 'short', 'code', 'area', 'zip', 'lng', 'lat'];
82 82
     }
83 83
 }
84 84
\ No newline at end of file
Please login to merge, or discard this patch.
src/RegionServiceProvider.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -56,11 +56,11 @@
 block discarded – undo
56 56
     protected function bindMacroService(): void
57 57
     {
58 58
         if (class_exists(SimpleService::class)) {
59
-            SimpleService::macro('queryDistance', function (SimpleService $service, float $lat, float $lng, float $maxDistance = 50, string $geoColumn) {
59
+            SimpleService::macro('queryDistance', function(SimpleService $service, float $lat, float $lng, float $maxDistance = 50, string $geoColumn) {
60 60
                 $distanceService = new DistanceService;
61 61
                 return $distanceService->queryDistance($service, $lat, $lng, $maxDistance, $geoColumn);
62 62
             });
63
-            SimpleService::macro('selectDistance', function (SimpleService $service, float $lat, float $lng, string $geoColumn, string $alias) {
63
+            SimpleService::macro('selectDistance', function(SimpleService $service, float $lat, float $lng, string $geoColumn, string $alias) {
64 64
                 $distanceService = new DistanceService;
65 65
                 return $distanceService->selectDistance($service, $lat, $lng, $geoColumn, $alias);
66 66
             });
Please login to merge, or discard this patch.
database/migrations/2024_07_26_173507_create_regions_table.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
      */
12 12
     public function up(): void
13 13
     {
14
-        Schema::create('regions', function (Blueprint $table) {
14
+        Schema::create('regions', function(Blueprint $table) {
15 15
             $table->id();
16 16
             $table->string('name')->comment('社区名称');
17 17
             $table->string('city_code')->comment("城市代码");
Please login to merge, or discard this patch.
src/Models/Region.php 1 patch
Indentation   -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,6 @@
 block discarded – undo
8 8
 
9 9
 /**
10 10
  * Region Model
11
- 
12 11
  * @author Dennis Lui <[email protected]>
13 12
  *
14 13
  * @property string $id 主键
Please login to merge, or discard this patch.