From a8071c83a752330711bebfc6ef5ad855a1d61d01 Mon Sep 17 00:00:00 2001 From: karam-mustafa Date: Tue, 8 Feb 2022 06:25:04 +0000 Subject: [PATCH] Fix styling --- .php-cs-fixer.cache | 2 +- src/Traits/Areas.php | 8 +++++--- tests/Feature/AreasTest.php | 3 ++- tests/Feature/OrderingTest.php | 5 +++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache index 3a0ef4b..af9ab12 100644 --- a/.php-cs-fixer.cache +++ b/.php-cs-fixer.cache @@ -1 +1 @@ -{"php":"8.1.1","version":"3.5.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Traits\/PointsStorage.php":2515415511,"src\/Traits\/Debugger.php":271558686,"src\/Traits\/Looper.php":1197184409,"src\/Traits\/Ordering.php":2807444233,"src\/Traits\/Distances.php":3419708995,"src\/Traits\/GeoTraitContainer.php":3516007813,"src\/Traits\/Areas.php":4061667213,"src\/Traits\/DataStorage.php":1837095138,"src\/Traits\/Formatter.php":2328685074,"src\/Traits\/AngleStorage.php":1188392081,"src\/Facade\/GeoFacade.php":1812726347,"src\/Providers\/GeoServiceProviders.php":246462924,"src\/Classes\/Geo.php":2196962536,"src\/Abstracts\/AbstractGeo.php":2234915042,"src\/Interfaces\/GeoInterface.php":2568736414,"src\/Commands\/InstallCommand.php":1784357225,"src\/Config\/geographical_calculator.php":3294119027,"tests\/Feature\/OrderingTest.php":2817032850,"tests\/Feature\/AllFeaturesTest.php":3405987633,"tests\/Feature\/AreasTest.php":1178991078,"tests\/Feature\/DistanceTest.php":3142791870,"src\/Traits\/DiametersStorage.php":4041300365}} \ No newline at end of file +{"php":"8.1.1","version":"3.5.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"sort_algorithm":"alpha"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"no_unused_imports":true,"not_operator_with_successor_space":true,"trailing_comma_in_multiline":true,"phpdoc_scalar":true,"unary_operator_spaces":true,"binary_operator_spaces":true,"blank_line_before_statement":{"statements":["break","continue","declare","return","throw","try"]},"phpdoc_single_line_var_spacing":true,"phpdoc_var_without_name":true,"class_attributes_separation":{"elements":{"method":"one"}}},"hashes":{"src\/Traits\/PointsStorage.php":2515415511,"src\/Traits\/Debugger.php":271558686,"src\/Traits\/Looper.php":1197184409,"src\/Traits\/Ordering.php":2807444233,"src\/Traits\/Distances.php":3419708995,"src\/Traits\/GeoTraitContainer.php":3516007813,"src\/Traits\/Areas.php":1963883125,"src\/Traits\/DataStorage.php":1837095138,"src\/Traits\/Formatter.php":2328685074,"src\/Traits\/AngleStorage.php":1188392081,"src\/Facade\/GeoFacade.php":417705943,"src\/Providers\/GeoServiceProviders.php":246462924,"src\/Classes\/Geo.php":2196962536,"src\/Abstracts\/AbstractGeo.php":2234915042,"src\/Interfaces\/GeoInterface.php":2568736414,"src\/Commands\/InstallCommand.php":1784357225,"src\/Config\/geographical_calculator.php":3294119027,"tests\/Feature\/OrderingTest.php":3290812563,"tests\/Feature\/AllFeaturesTest.php":3405987633,"tests\/Feature\/AreasTest.php":3506569351,"tests\/Feature\/DistanceTest.php":3142791870,"src\/Traits\/DiametersStorage.php":2005442298}} \ No newline at end of file diff --git a/src/Traits/Areas.php b/src/Traits/Areas.php index 4a698a6..548f6b5 100644 --- a/src/Traits/Areas.php +++ b/src/Traits/Areas.php @@ -22,7 +22,7 @@ public function getCenter($callback = null) $this->setInStorage('pointsCount', count($this->getPoints())); // check if there are points or not. - if (!$this->getFromStorage('pointsCount')) { + if (! $this->getFromStorage('pointsCount')) { return false; } @@ -96,10 +96,12 @@ public function isInArea() // otherwise mean that the distance between the given point is locate in the circle that calculated // from the main point and the diameter - $this->setInStorage('distanceToCompare', + $this->setInStorage( + 'distanceToCompare', $this->setOptions(['units' => ['km']])->getDistance(function (Collection $item) { return $item->first()['km']; - })); + }) + ); return $this->getFromStorage('distanceToCompare') > $this->getDiameter(); } diff --git a/tests/Feature/AreasTest.php b/tests/Feature/AreasTest.php index 9215811..aa90b15 100644 --- a/tests/Feature/AreasTest.php +++ b/tests/Feature/AreasTest.php @@ -26,7 +26,7 @@ public function test_center() 'long' => 38.424795502212, ], $result); } - + /** * test if the given point is in custom area, depending on main point and diameter * @@ -53,6 +53,7 @@ public function test_if_given_point_is_in_custom_area() $this->assertFalse($result); } + /** * get clean instance of geo class. * diff --git a/tests/Feature/OrderingTest.php b/tests/Feature/OrderingTest.php index de52f43..74f8bb3 100644 --- a/tests/Feature/OrderingTest.php +++ b/tests/Feature/OrderingTest.php @@ -43,6 +43,7 @@ public function test_closest_point_of_set_points() ], ], $result); } + /** * * @return void @@ -57,7 +58,7 @@ public function test_farthest_point_of_set_points() ->setPoint([40.92918, 14.44339]) ->getFarthest(); - $this->assertEquals([ + $this->assertEquals([ // the key is the index of points insertion. 0 => [ 40.92945, @@ -78,7 +79,7 @@ public function test_farthest_point_of_set_points() ], ], $result); } - + /** * * @return void