Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
7 / 7
CRAP
100.00% covered (success)
100.00%
12 / 12
MetaBoxStack
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
7 / 7
8
100.00% covered (success)
100.00%
12 / 12
 getMetaBoxes
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 setMetaBoxes
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 addMetaBox
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 initialize
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 register
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
3 / 3
 setContainer
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
2 / 2
 get
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
<?php
declare(strict_types=1);
namespace Korobochkin\WPKit\MetaBoxes;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
 * Class MetaBoxStack
 */
class MetaBoxStack implements MetaBoxStackInterface
{
    /**
     * @var MetaBoxInterface[]
     */
    protected $metaBoxes = array();
    /**
     * @var ContainerInterface DI Container.
     */
    protected $container;
    /**
     * @inheritdoc
     */
    public function getMetaBoxes()
    {
        return $this->metaBoxes;
    }
    /**
     * @inheritdoc
     */
    public function setMetaBoxes(array $metaBoxes)
    {
        $this->metaBoxes = $metaBoxes;
        return $this;
    }
    /**
     * @inheritdoc
     */
    public function addMetaBox(MetaBoxInterface $metaBox)
    {
        $this->metaBoxes[] = $metaBox;
        return $this;
    }
    /**
     * @inheritdoc
     */
    public function initialize()
    {
        return $this;
    }
    /**
     * @inheritdoc
     */
    public function register()
    {
        foreach ($this->metaBoxes as $metaBox) {
            $metaBox->register();
        }
        return $this;
    }
    /**
     * @inheritdoc
     *
     * @return $this For chain calls.
     */
    public function setContainer(ContainerInterface $container = null)
    {
        $this->container = $container;
        return $this;
    }
    /**
     * @inheritdoc
     */
    public function get($id)
    {
        return $this->container->get($id);
    }
}