@@ -258,11 +258,11 @@ protected function componentString(string $component, array $attributes)
258
258
$ parameters = $ data ->all ();
259
259
}
260
260
261
- return "##BEGIN-COMPONENT-CLASS##@component(' {$ class }', ' {$ component }', \$ componentData = [ " .$ this ->attributesToString ($ parameters , $ escapeBound = false ).'])
261
+ return "##BEGIN-COMPONENT-CLASS##@component(' {$ class }', ' {$ component }', [ " .$ this ->attributesToString ($ parameters , $ escapeBound = false ).'])
262
262
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass( ' .$ class .'::class))->getConstructor()): ?>
263
263
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
264
264
<?php endif; ?>
265
- <?php $component->withAttributes([ ' .$ this ->attributesToStringWithExistingComponentData ($ attributes ->all (), $ escapeAttributes = $ class !== DynamicComponent::class && ! is_subclass_of ( $ class , DynamicComponent::class) ).']); ?> ' ;
265
+ <?php $component->withAttributes([ ' .$ this ->attributesToString ($ attributes ->all (), $ escapeAttributes = $ class !== DynamicComponent::class).']); ?> ' ;
266
266
}
267
267
268
268
/**
@@ -783,35 +783,6 @@ protected function attributesToString(array $attributes, $escapeBound = true)
783
783
->implode (', ' );
784
784
}
785
785
786
- /**
787
- * Convert an array of attributes to a string using existing component data that has already been evaluated.
788
- *
789
- * @param array $attributes
790
- * @param bool $escapeBound
791
- * @return string
792
- */
793
- protected function attributesToStringWithExistingComponentData (array $ attributes , $ escapeBound = true )
794
- {
795
- $ results = [];
796
-
797
- foreach ($ attributes as $ attribute => $ value ) {
798
- if (! $ escapeBound ||
799
- ! isset ($ this ->boundAttributes [$ attribute ]) ||
800
- $ value === 'true ' ||
801
- is_numeric ($ value )) {
802
- $ results [] = "' {$ attribute }' => {$ value }" ;
803
-
804
- continue ;
805
- }
806
-
807
- $ results [] = "' {$ attribute }' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute( " .(
808
- ($ attribute === 'attributes ' ) ? $ value : ('$componentData[ \'data \'][ \'' .Str::camel ($ attribute ).'\'] ?? null ' )
809
- ).') ' ;
810
- }
811
-
812
- return implode (', ' , $ results );
813
- }
814
-
815
786
/**
816
787
* Strip any quotes from the given string.
817
788
*
0 commit comments