Skip to content

Commit 8137935

Browse files
committed
Merge branch 'main' of github.com:karam-mustafa/laravel-relational-metrics-1 into main
2 parents 12c0b05 + d38a8dc commit 8137935

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

.php-cs-fixer.cache

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"php":"8.1.3","version":"3.7.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"inline_constructor_arguments":false,"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\/Abstracts\/RelationalRelationAbstract.php":1033756924,"src\/Classes\/RelationalMetrics.php":3843364039,"src\/Interfaces\/RelationalInterface.php":1128215520,"tests\/Unit\/ExampleTest.php":3900274864,"tests\/BaseTest.php":3538535820,"tests\/Feature\/ExampleTest.php":3639981892}}
1+
{"php":"8.1.3","version":"3.7.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"inline_constructor_arguments":false,"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\/Abstracts\/RelationalRelationAbstract.php":3299928560,"src\/Classes\/RelationalMetrics.php":842680276,"src\/Interfaces\/RelationalInterface.php":1128215520,"tests\/Unit\/ExampleTest.php":3900274864,"tests\/BaseTest.php":3538535820,"tests\/Feature\/ExampleTest.php":3639981892}}

src/Abstracts/RelationalRelationAbstract.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ abstract class RelationalRelationAbstract
3737
*/
3838
public function getCount()
3939
{
40-
if (is_null($this->count)){
40+
if (is_null($this->count)) {
4141
$this->getCountDirectly();
4242
}
43+
4344
return $this->count;
4445
}
4546

@@ -62,7 +63,7 @@ public function setCount($count)
6263
*/
6364
public function getName()
6465
{
65-
if (is_null($this->name)){
66+
if (is_null($this->name)) {
6667
$this->name = $this->getResponseName();
6768
}
6869

src/Classes/RelationalMetrics.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
*/
1515
class RelationalMetrics extends RelationalRelationAbstract implements RelationalInterface
1616
{
17-
1817
/**
1918
* class constructor
2019
*
@@ -57,7 +56,6 @@ public function getRelationalMetrics($relation, $column, $value)
5756
return $this->returnFinalResponse(
5857
$this->returnRelationalCount($relation, $column, $value)
5958
);
60-
6159
}
6260

6361
/**
@@ -90,12 +88,10 @@ private function validateClass(string $class)
9088
? $class
9189
: "\\App\\Models\\$class";
9290

93-
if (!class_exists($fixedClassName) && $fixedClassName instanceof Model) {
91+
if (! class_exists($fixedClassName) && $fixedClassName instanceof Model) {
9492
throw new \Exception("model $class not found !!");
9593
}
9694

9795
return $fixedClassName;
9896
}
99-
100-
10197
}

0 commit comments

Comments
 (0)