src/ContainerFactory.php
protected static function createEntries(Container $container, array $entries)
    {
        $defaultShared = $container->isSharedByDefault();

        foreach ($entries as $entry) {
            foreach (self::$requiredEntryKeys as $key) {
                if (!isset($entry[$key])) {
                    $message = sprintf('Missing required entry key "%s" in "%s".', $key, __METHOD__);
                    throw new Exception\InvalidArgumentException($message);
                }
            }

            if (!in_array($entry[ContainerInterface::CONFIG_ENTRY_TYPE], self::$entryTypes)) {
                throw new Exception\InvalidArgumentException(sprintf(
                    'Value "%s" for "%s" is not valid; it must be one of "%s" in "%s".',
                    $entry[ContainerInterface::CONFIG_ENTRY_TYPE],
                    $key,
                    implode(', ', self::$types),
                    __METHOD__
                ));
            }

            $shared = isset($entry[ContainerInterface::CONFIG_ENTRY_SHARED]) ? (bool) $entry[ContainerInterface::CONFIG_ENTRY_SHARED] : $defaultShared;

            $container->add($entry[ContainerInterface::CONFIG_ENTRY_NAME], $entry[ContainerInterface::CONFIG_ENTRY_VALUE], $entry[ContainerInterface::CONFIG_ENTRY_TYPE], $shared);
        }
    }
protected static function createEntries(Container $container, array $entries)
    {
        $defaultShared = $container->isSharedByDefault();

        foreach ($entries as $entry) {
            foreach (self::$requiredEntryKeys as $key) {
                if (!isset($entry[$key])) {
                    $message = sprintf('Missing required entry key "%s" in "%s".', $key, __METHOD__);
                    throw new Exception\InvalidArgumentException($message);
                }
            }

            if (!in_array($entry[ContainerInterface::CONFIG_ENTRY_TYPE], self::$entryTypes)) {
                throw new Exception\InvalidArgumentException(sprintf(
                    'Value "%s" for "%s" is not valid; it must be one of "%s" in "%s".',
                    $entry[ContainerInterface::CONFIG_ENTRY_TYPE],
                    $key,
                    implode(', ', self::$types),
                    __METHOD__
                ));
            }

            $shared = isset($entry[ContainerInterface::CONFIG_ENTRY_SHARED]) ? (bool) $entry[ContainerInterface::CONFIG_ENTRY_SHARED] : $defaultShared;

            $container->add($entry[ContainerInterface::CONFIG_ENTRY_NAME], $entry[ContainerInterface::CONFIG_ENTRY_VALUE], $entry[ContainerInterface::CONFIG_ENTRY_TYPE], $shared);
        }
    }
protected static function createEntries ( Container $ container , array $ entries ) { $ defaultShared = $ container -> isSharedByDefault ( ) ; foreach ( $ entries as $ entry ) { foreach ( self :: $ requiredEntryKeys as $ key ) { if ( ! isset ( $ entry [ $ key ] ) ) { $ message = sprintf ( 'Missing required entry key "%s" in "%s".' , $ key , __METHOD__ ) ; throw new Exception \ InvalidArgumentException ( $ message ) ; } } if ( ! in_array ( $ entry [ ContainerInterface :: CONFIG_ENTRY_TYPE ] , self :: $ entryTypes ) ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'Value "%s" for "%s" is not valid; it must be one of "%s" in "%s".' , $ entry [ ContainerInterface :: CONFIG_ENTRY_TYPE ] , $ key , implode ( ', ' , self :: $ types ) , __METHOD__ ) ) ; } $ shared = isset ( $ entry [ ContainerInterface :: CONFIG_ENTRY_SHARED ] ) ? ( bool ) $ entry [ ContainerInterface :: CONFIG_ENTRY_SHARED ] : $ defaultShared ; $ container -> add ( $ entry [ ContainerInterface :: CONFIG_ENTRY_NAME ] , $ entry [ ContainerInterface :: CONFIG_ENTRY_VALUE ] , $ entry [ ContainerInterface :: CONFIG_ENTRY_TYPE ] , $ shared ) ; } }
Create entries.

@param \Phower\Container\Container $container
@param array $entries
@throws Exception\InvalidArgumentException
Create entries .