@@ -258,11 +258,11 @@ protected function componentString(string $component, array $attributes)
258258 $ parameters = $ data ->all ();
259259 }
260260
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 ).'])
262262<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass( ' .$ class .'::class))->getConstructor()): ?>
263263<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
264264<?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).']); ?> ' ;
266266 }
267267
268268 /**
@@ -783,35 +783,6 @@ protected function attributesToString(array $attributes, $escapeBound = true)
783783 ->implode (', ' );
784784 }
785785
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-
815786 /**
816787 * Strip any quotes from the given string.
817788 *
0 commit comments