secit-pl / imap-bundle

Simple php-imap integration for Symfony
MIT License
71 stars 20 forks source link

Improve configuration definition #27

Closed bobvandevijver closed 1 year ago

bobvandevijver commented 2 years ago

This allows you to use the new php based configuration without hassle:

return static function(ImapConfig $imap): void
{
    $imap->connection('some_connection')
         ->mailbox('a_mailbox');
    $imap->connection('second_connection')
         ->mailbox('another_mailbox');
};
ThomasLandauer commented 1 year ago

@secit-pl This works for me (Symfony 6.2.1), could you please merge it?

secit-pl commented 1 year ago

@bobvandevijver I understand the pull request changes but I do not understand your example. What is ImapConfig? It looks like it's not a part of this bundle.

bobvandevijver commented 1 year ago

@secit-pl ImapConfig is being generated automatically by Symfony based on the bundle configuration, which has been introduced with Symfony 5.3. See this blogpost for some more information: https://symfony.com/blog/new-in-symfony-5-3-config-builder-classes.

secit-pl commented 1 year ago

Thanks, had to miss this blog post. Merged.