Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

jsarnowski / jsarnowski/brizy-pro   php

Repository URL to install this package:

Version: 2.3.7 

/ bagrinsergiu / content-placeholder / lib / Registry.php

<?php

namespace BrizyPlaceholders;

/**
 * Class Registry
 * @package BrizyPlaceholders
 */
class Registry implements RegistryInterface
{

    /**
     * @var PlaceholderInterface[]
     */
    public $placeholders = [];

    /**
     * @param PlaceholderInterface $instance
     * @param string $label
     * @param string $placeholderName
     * @param string $groupName
     *
     * @return mixed|void
     */
    public function registerPlaceholder(PlaceholderInterface $instance)
    {
        $this->placeholders[] = $instance;
    }

    /**
     * @inheritDoc
     */
    public function getPlaceholders()
    {
        return $this->placeholders;
    }

    /**
     * @inheritDoc
     */
    public function getPlaceholderSupportingName($name)
    {
        foreach ($this->placeholders as $aplaceholder) {
            if ($aplaceholder->support($name)) {
                return $aplaceholder;
            }
        }
    }
}