Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Autowiring Filesystems #276

Open
mvhirsch opened this issue Nov 18, 2022 · 0 comments
Open

Support Autowiring Filesystems #276

mvhirsch opened this issue Nov 18, 2022 · 0 comments
Assignees

Comments

@mvhirsch
Copy link
Contributor

I'm trying to use Symfony's autowiring like this:

# knp_gaufrette.yaml
knp_gaufrette:
    filesystems:
        import: { adapter: import }
<?php

namespace App\Command;

use Gaufrette\FilesystemInterface;

final class MyCommand
{
    public function __construct(FilesytemInterface $importFilesystem) 
    {

    }
}

But it results in an error:

Cannot autowire service "App\Command\MyCommand": argument "$importFilesystem" of method "__construct()" references interface "Gaufrette\FilesystemInterface" but no such service exists. You should maybe alias this interface to one of these existing services: "sonata.media.filesystem.s3", "gaufrette.import_filesytem", ...

Seems like there is no support for this like MonologBundle does?

Would it be possible to add aliases so this will be possible? I'm using 0.7.1 (as I cannot upgrade to PHP 8 by now). Could this change be backported to 0.7.x, too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants