Skip to content

Comments

Fix PHPDoc types of TestLiveComponent::call()#3353

Merged
Kocal merged 1 commit intosymfony:2.xfrom
StevenRenaux:Fix/Fix-TestLiveComponent-call-method-param-type
Feb 24, 2026
Merged

Fix PHPDoc types of TestLiveComponent::call()#3353
Kocal merged 1 commit intosymfony:2.xfrom
StevenRenaux:Fix/Fix-TestLiveComponent-call-method-param-type

Conversation

@StevenRenaux
Copy link
Contributor

Q A
Bug fix? no
New feature? no
Deprecations? no
Documentation? yes
License MIT

I followed the instructions to upload a file.
https://symfony.com/bundles/ux-live-component/current/index.html#uploading-files

<div {{ attributes }}>
    <input
        data-action="change->live#action"
        data-live-action-param="files|uploadFiles"
        class="fr-upload"
        aria-describedby="upload-file-messages"
        type="file"
        id="upload-file"
        name="multiple_files[]"
        multiple
    >
</div>
    #[LiveAction]
    public function uploadFiles(
        Request $request,
    ): void {
        /** @var UploadedFile[] $allUploadedFiles */
        $allUploadedFiles = $request->files->all('multiple_files');
        if ($allUploadedFiles === []) {
            return;
        }
        
        // rest of my code
    }

And when I tried to test it, I ended up with a typing error on the files parameter.

        $component = $this->createLiveComponent(FileUpload::class, [], $this->kernelBrowser)
            ->actingAs($user)
            ->call('uploadFiles', [], ['multiple_files' => [
                new UploadedFile(...),
                new UploadedFile(...),
            ]])
            ->component()
        ;

@carsonbot carsonbot added Documentation Improvements or additions to documentation Status: Needs Review Needs to be reviewed labels Feb 23, 2026
@carsonbot carsonbot changed the title Fix PHPDoc @param for TestLiveComponent::call Fix PHPDoc @param for TestLiveComponent::call Feb 23, 2026
@StevenRenaux StevenRenaux force-pushed the Fix/Fix-TestLiveComponent-call-method-param-type branch from 756486b to ef90ebf Compare February 23, 2026 18:09
Copy link
Member

@Kocal Kocal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With a minor comment

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Feb 23, 2026
@Kocal Kocal changed the title Fix PHPDoc @param for TestLiveComponent::call [LiveComponent] Fix PHPDoc types of TestLiveComponent::call() Feb 24, 2026
@Kocal Kocal added the Bug Bug Fix label Feb 24, 2026
@carsonbot carsonbot changed the title [LiveComponent] Fix PHPDoc types of TestLiveComponent::call() Fix PHPDoc types of TestLiveComponent::call() Feb 24, 2026
@Kocal
Copy link
Member

Kocal commented Feb 24, 2026

(Failures not related)

@Kocal Kocal force-pushed the Fix/Fix-TestLiveComponent-call-method-param-type branch from b2578fa to b88591e Compare February 24, 2026 12:09
@Kocal
Copy link
Member

Kocal commented Feb 24, 2026

Thank you @StevenRenaux.

@Kocal Kocal merged commit 5305cf5 into symfony:2.x Feb 24, 2026
14 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug Fix Documentation Improvements or additions to documentation Status: Reviewed Has been reviewed by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants