/usr/share/php/Nette/DI/ServiceDefinition.php is in php-nette 2.1.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | <?php
/**
* This file is part of the Nette Framework (http://nette.org)
* Copyright (c) 2004 David Grudl (http://davidgrudl.com)
*/
namespace Nette\DI;
use Nette;
/**
* Definition used by ContainerBuilder.
*
* @author David Grudl
*/
class ServiceDefinition extends Nette\Object
{
/** @var string class or interface name */
public $class;
/** @var Statement */
public $factory;
/** @var Statement[] */
public $setup = array();
/** @var array */
public $parameters = array();
/** @var array */
public $tags = array();
/** @var mixed */
public $autowired = TRUE;
/** @var bool */
public $shared = TRUE;
/** @var bool */
public $inject = FALSE;
/** @var string interface name */
public $implement;
/** @internal @var string create | get */
public $implementType;
public function setClass($class, array $args = array())
{
$this->class = $class;
if ($args) {
$this->setFactory($class, $args);
}
return $this;
}
public function setFactory($factory, array $args = array())
{
$this->factory = new Statement($factory, $args);
return $this;
}
public function setArguments(array $args = array())
{
if ($this->factory) {
$this->factory->arguments = $args;
} else {
$this->setClass($this->class, $args);
}
return $this;
}
public function addSetup($target, array $args = array())
{
$this->setup[] = new Statement($target, $args);
return $this;
}
public function setParameters(array $params)
{
$this->shared = $this->autowired = FALSE;
$this->parameters = $params;
return $this;
}
public function addTag($tag, $attrs = TRUE)
{
$this->tags[$tag] = $attrs;
return $this;
}
public function setAutowired($on)
{
$this->autowired = $on;
return $this;
}
/** @deprecated */
public function setShared($on)
{
$this->shared = (bool) $on;
$this->autowired = $this->shared ? $this->autowired : FALSE;
return $this;
}
public function setInject($on)
{
$this->inject = (bool) $on;
return $this;
}
public function setImplement($implement)
{
$this->implement = $implement;
$this->shared = TRUE;
return $this;
}
}
|