autowp/autowp

View on GitHub
module/Votings/src/VotingsFactory.php

Summary

Maintainability
A
40 mins
Test Coverage
A
100%
<?php

declare(strict_types=1);

namespace Autowp\Votings;

use interop\container\containerinterface;
use Laminas\ServiceManager\Factory\FactoryInterface;

class VotingsFactory implements FactoryInterface
{
    /**
     * @SuppressWarnings(PHPMD.UnusedFormalParameter)
     * @param string                $requestedName
     * @param null|array $options
     */
    public function __invoke(containerinterface $container, $requestedName, ?array $options = null): Votings
    {
        $tables = $container->get('TableManager');
        return new Votings(
            $tables->get('voting'),
            $tables->get('voting_variant'),
            $tables->get('voting_variant_vote')
        );
    }
}