Skip to content

Commit

Permalink
Merge branch 'feature-attribute-builder' of https://github.com/larave…
Browse files Browse the repository at this point in the history
…l-appkit/ui into feature-attribute-builder
  • Loading branch information
darrencoutts118 authored Dec 13, 2023
2 parents 23f6ce8 + 4449b5c commit 1c65db3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"8.3.0","version":"3.41.1","indent":" ","lineEnding":"\n","rules":{"binary_operator_spaces":true,"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_parentheses":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_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":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_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":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_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":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,"trailing_comma_in_multiline":true,"phpdoc_scalar":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\/Ui.php":"ec96cb32a9fcac6082b91081b167a4e2","src\/AttributeBuilder.php":"c58ab67f8e9d6394c20e71c223e42aa3","src\/Components\/BaseComponent.php":"438429a5bb6d0dd223cb2096769a041d","src\/Facades\/Ui.php":"0bb32dde85ecc794eb3f50296cad573f","src\/UiServiceProvider.php":"bf523875e640350bdee1ba48a9a1ef73","tests\/AttributeBagTest.php":"46e507aa1430c6b03070e726e3ed4308","tests\/Pest.php":"1a2dbf23f379555d7797b385d27b4bd7","tests\/TestCase.php":"50f792d241f3c09167cfc633cdb33365"}}
9 changes: 5 additions & 4 deletions src/AttributeBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ class AttributeBuilder
public function __construct(
protected ComponentAttributeBag &$attributeBag,
protected Collection $options
)
{
) {

}

Expand All @@ -28,7 +27,8 @@ public function addClass(...$classes)
return $this;
}

public function addOptionClass($option, $classes) {
public function addOptionClass($option, $classes)
{
$value = $this->options[$option];

$classes = value($classes);
Expand All @@ -54,7 +54,8 @@ public function setData($key, $value = null)
return $this;
}

public function merge($attributes) {
public function merge($attributes)
{
$this->attributeBag = $this->attributeBag->merge($attributes);
}

Expand Down

0 comments on commit 1c65db3

Please sign in to comment.