<?php

/*
 * This file is part of PHP-SwfTools.
 *
 * (c) Alchemy <info@alchemy.fr>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace SwfTools\Binary;

use Pimple\Container;
use Psr\Log\LoggerInterface;

class DriverContainer extends Container
{
    public static function create($configuration = array(), LoggerInterface $logger = null)
    {
        $container = new static();

        $container['configuration'] = $configuration;
        $container['logger'] = $logger;

        $container['pdf2swf'] = function ($c) {
            return Pdf2swf::create($c['configuration'], $c['logger']);
        };

        $container['swfrender'] = function ($c) {
            return Swfrender::create($c['configuration'], $c['logger']);
        };

        $container['swfextract'] = function ($c) {
            return Swfextract::create($c['configuration'], $c['logger']);
        };

        return $container;
    }
}
