public function create(PickerConfig $config): ?Picker
    {
        $providers = $this->providers;

        if (\is_array($allowed = $config->getExtra('providers'))) {
            $providers = array_intersect_key($providers, array_flip($allowed));
        }

        $providers = array_filter(
            $providers,
            static function (PickerProviderInterface $provider) use ($config): bool {
                return $provider->supportsContext($config->getContext());
            }
        );

        if (empty($providers)) {
            return null;
        }

        return new Picker($this->menuFactory, $providers, $config);
    }
public function create(PickerConfig $config): ?Picker
    {
        $providers = $this->providers;

        if (\is_array($allowed = $config->getExtra('providers'))) {
            $providers = array_intersect_key($providers, array_flip($allowed));
        }

        $providers = array_filter(
            $providers,
            static function (PickerProviderInterface $provider) use ($config): bool {
                return $provider->supportsContext($config->getContext());
            }
        );

        if (empty($providers)) {
            return null;
        }

        return new Picker($this->menuFactory, $providers, $config);
    }
public function create ( PickerConfig $ config ) : ? Picker { $ providers = $ this -> providers ; if ( \ is_array ( $ allowed = $ config -> getExtra ( 'providers' ) ) ) { $ providers = array_intersect_key ( $ providers , array_flip ( $ allowed ) ) ; } $ providers = array_filter ( $ providers , static function ( PickerProviderInterface $ provider ) use ( $ config ) : bool { return $ provider -> supportsContext ( $ config -> getContext ( ) ) ; } ) ; if ( empty ( $ providers ) ) { return null ; } return new Picker ( $ this -> menuFactory , $ providers , $ config ) ; }
{@inheritdoc}
{