-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClassBinding.php
More file actions
60 lines (53 loc) · 1.52 KB
/
ClassBinding.php
File metadata and controls
60 lines (53 loc) · 1.52 KB
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
<?php
/*
* Opulence
*
* @link https://www.opulencephp.com
* @copyright Copyright (C) 2021 David Young
* @license https://github.com/opulencephp/Opulence/blob/1.2/LICENSE.md
*/
namespace Opulence\Ioc;
/**
* Defines a class binding
*/
class ClassBinding implements IBinding
{
/** @var string The name of the concrete class */
private $concreteClass = '';
/** @var array The list of constructor primitives */
private $constructorPrimitives = [];
/** @var bool Whether or not the class should be resolved as a singleton */
private $resolveAsSingleton = false;
/**
* @param string $concreteClass The name of the concrete class
* @param array $constructorPrimitives The list of constructor primitives
* @param bool $resolveAsSingleton Whether or not to resolve as a singleton
*/
public function __construct(string $concreteClass, array $constructorPrimitives, bool $resolveAsSingleton)
{
$this->concreteClass = $concreteClass;
$this->constructorPrimitives = $constructorPrimitives;
$this->resolveAsSingleton = $resolveAsSingleton;
}
/**
* @return string
*/
public function getConcreteClass() : string
{
return $this->concreteClass;
}
/**
* @return array
*/
public function getConstructorPrimitives() : array
{
return $this->constructorPrimitives;
}
/**
* @return bool
*/
public function resolveAsSingleton() : bool
{
return $this->resolveAsSingleton;
}
}