本文整理汇总了PHP中Symfony\Component\DependencyInjection\Container::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Container::__construct方法的具体用法?PHP Container::__construct怎么用?PHP Container::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\DependencyInjection\Container
的用法示例。
在下文中一共展示了Container::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct(new ParameterBag($this->getDefaultParameters()));
$this->methodMap = array('bar' => 'getBarService', 'baz' => 'getBazService', 'configurator_service' => 'getConfiguratorServiceService', 'configurator_service_simple' => 'getConfiguratorServiceSimpleService', 'configured_service' => 'getConfiguredServiceService', 'configured_service_simple' => 'getConfiguredServiceSimpleService', 'decorated' => 'getDecoratedService', 'decorator_service' => 'getDecoratorServiceService', 'decorator_service_with_name' => 'getDecoratorServiceWithNameService', 'deprecated_service' => 'getDeprecatedServiceService', 'factory_service' => 'getFactoryServiceService', 'factory_service_simple' => 'getFactoryServiceSimpleService', 'factory_simple' => 'getFactorySimpleService', 'foo' => 'getFooService', 'foo.baz' => 'getFoo_BazService', 'foo_bar' => 'getFooBarService', 'foo_with_inline' => 'getFooWithInlineService', 'inlined' => 'getInlinedService', 'method_call1' => 'getMethodCall1Service', 'new_factory' => 'getNewFactoryService', 'new_factory_service' => 'getNewFactoryServiceService', 'request' => 'getRequestService', 'service_from_static_method' => 'getServiceFromStaticMethodService');
$this->privates = array('configurator_service' => true, 'configurator_service_simple' => true, 'factory_simple' => true, 'inlined' => true, 'new_factory' => true);
$this->aliases = array('alias_for_alias' => 'foo', 'alias_for_foo' => 'foo');
}
示例2: __construct
/**
* Constructor.
*/
public function __construct()
{
$this->parameters = array('baz_class' => 'BazClass', 'foo_class' => 'Bar\\FooClass', 'foo' => 'bar');
parent::__construct(new ParameterBag($this->parameters));
$this->methodMap = array('bar' => 'getBarService', 'baz' => 'getBazService', 'configurator_service' => 'getConfiguratorServiceService', 'configured_service' => 'getConfiguredServiceService', 'decorated' => 'getDecoratedService', 'decorator_service' => 'getDecoratorServiceService', 'decorator_service_with_name' => 'getDecoratorServiceWithNameService', 'depends_on_request' => 'getDependsOnRequestService', 'factory_service' => 'getFactoryServiceService', 'foo' => 'getFooService', 'foo.baz' => 'getFoo_BazService', 'foo_bar' => 'getFooBarService', 'foo_with_inline' => 'getFooWithInlineService', 'inlined' => 'getInlinedService', 'method_call1' => 'getMethodCall1Service', 'new_factory' => 'getNewFactoryService', 'new_factory_service' => 'getNewFactoryServiceService', 'request' => 'getRequestService', 'service_from_static_method' => 'getServiceFromStaticMethodService');
$this->aliases = array('alias_for_alias' => 'foo', 'alias_for_foo' => 'foo');
}
示例3: __construct
/**
* Constructor
* @param ParameterBagInterface $parameterBag
*/
public function __construct(ParameterBagInterface $parameterBag = null)
{
parent::__construct($parameterBag);
$passes = array();
$passes[] = new MergeExtensionConfigurationPass();
$passes[] = new ResolveInterfaceInjectorsPass();
$this->compilerPasses = $passes;
}
示例4: __construct
/**
* Constructor
* @param ParameterBagInterface $parameterBag
*/
public function __construct(ParameterBagInterface $parameterBag = null)
{
parent::__construct($parameterBag);
$this->compiler = new Compiler();
foreach ($this->compiler->getPassConfig()->getPasses() as $pass) {
$this->addObjectResource($pass);
}
}
示例5: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct(new ParameterBag($this->getDefaultParameters()));
$this->methodMap = array(
'bar' => 'getBarService',
'baz' => 'getBazService',
'depends_on_request' => 'getDependsOnRequestService',
'factory_service' => 'getFactoryServiceService',
'foo' => 'getFooService',
'foo.baz' => 'getFoo_BazService',
'foo_bar' => 'getFooBarService',
'foo_with_inline' => 'getFooWithInlineService',
'inlined' => 'getInlinedService',
'method_call1' => 'getMethodCall1Service',
'request' => 'getRequestService',
);
$this->aliases = array(
'alias_for_alias' => 'foo',
'alias_for_foo' => 'foo',
);
}
示例6: __construct
public function __construct()
{
parent::__construct();
$this->__bar = new \stdClass();
$this->__foo_bar = new \stdClass();
$this->__foo_baz = new \stdClass();
}
示例7: __construct
/**
* Constructor.
*/
public function __construct()
{
$this->parameters = array('foo' => '%baz%', 'baz' => 'bar', 'bar' => 'foo is %%foo bar', 'escape' => '@escapeme', 'values' => array(0 => true, 1 => false, 2 => NULL, 3 => 0, 4 => 1000.3, 5 => 'true', 6 => 'false', 7 => 'null'));
parent::__construct(new ParameterBag($this->parameters));
}
示例8: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct();
}
示例9: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct();
$this->methodMap = array('service_from_anonymous_factory' => 'getServiceFromAnonymousFactoryService', 'service_with_method_call_and_factory' => 'getServiceWithMethodCallAndFactoryService');
}
示例10: __construct
/**
* Constructor.
*/
public function __construct()
{
parent::__construct();
$this->methodMap = array('foo' => 'getFooService');
}
示例11: __construct
public function __construct()
{
parent::__construct();
$this->__bar = new \stdClass();
$this->__foo_bar = new \stdClass();
$this->__foo_baz = new \stdClass();
$this->__internal = new \stdClass();
$this->privates = array('internal' => true);
$this->aliases = array('alias' => 'bar');
}
示例12: __construct
/**
* @inheritdoc
*/
public function __construct(ParameterBagInterface $parameterBag = null)
{
// This is not elegant, but it works.
parent::__construct(new DrupalFrozenParameterBag($parameterBag->all()));
$this->services['service_container'] = $this;
}
示例13: __construct
/**
* Construct object.
*
* @param array $options The default options
*/
public function __construct($options = array())
{
parent::__construct(new ParameterBag($options));
}
示例14: __construct
/**
* Constructor
* @param ParameterBagInterface $parameterBag
*/
public function __construct(ParameterBagInterface $parameterBag = null)
{
parent::__construct($parameterBag);
}
示例15: __construct
/**
* Constructor
* @param ParameterBagInterface $parameterBag
*/
public function __construct(ParameterBagInterface $parameterBag = null)
{
parent::__construct($parameterBag);
$this->compilerPassConfig = new PassConfig();
}