1up-lab / OneupFlysystemBundle

A Flysystem integration for your Symfony projects.
MIT License
630 stars 118 forks source link

Argument 2 passed to LocalFilesystemAdapter::__construct() is a string, not an object #243

Closed ksaveras closed 2 years ago

ksaveras commented 3 years ago

Bug Report

Q A
BC Break yes
Version 4.0.7

Summary

Argument 2 passed to League\Flysystem\Local\LocalFilesystemAdapter::__construct() must implement interface League\Flysystem\UnixVisibility\VisibilityConverter or be null, string given.

How to reproduce

Use the following configuration

# Read the documentation: https://github.com/1up-lab/OneupFlysystemBundle
oneup_flysystem:
    adapters:
        cdn_images:
            local:
                location: '%kernel.project_dir%/public/media'
                visibilityConverter: '@filesystem.local.visibility_converter'

    filesystems:
        images:
            adapter: cdn_images
            visibility: public

services:
    filesystem.local.visibility_converter:
        class: League\Flysystem\UnixVisibility\PortableVisibilityConverter
        arguments:
            - 0644
            - 0644
            - 0755
            - 0755
            - 'visible'

It does not check if visibilityConverter is a service. It always passes a string value to the constructor. Useless option. Same if service is provided with @ or without @.

bytehead commented 2 years ago

Can you check 4.1.1 if it fixes your problem? I've also updated the doc: https://github.com/1up-lab/OneupFlysystemBundle/blob/4.1.1/doc/adapter_local.md