Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
ClassesForConstructorIntegrity.php
Go to the documentation of this file.
1 <?php
12 class ClassA
13 {
14 }
15 class ClassB
16 {
17 }
18 class ClassC
19 {
20 }
21 interface FirstInterface
22 {
23 }
25 {
26 }
27 interface SecondInterface
28 {
29 }
31 {
32 }
34 {
38  protected $_exA;
39 
43  protected $_exB;
44 
48  protected $_exC;
49 
53  protected $_interfaceA;
54 
58  protected $_implOfBInterface;
59 
68  public function __construct(
69  \ClassA $exA,
70  \ClassB $exB,
71  \ClassC $exC,
72  \FirstInterface $interfaceA,
73  \ImplementationOfSecondInterface $implOfBInterface
74  ) {
75  $this->_exA = $exA;
76  $this->_exB = $exB;
77  $this->_exC = $exC;
78  $this->_interfaceA = $interfaceA;
79  $this->_implOfBInterface = $implOfBInterface;
80  }
81 }
83 {
87  protected $_context;
88 
92  protected $_exA;
93 
98  public function __construct(\Context $context, \ClassA $exA)
99  {
100  $this->_context = $context;
101  $this->_exA = $exA;
102  }
103 }
105 {
109  protected $_context;
110 
114  protected $_exA;
115 
119  protected $_exB;
120 
126  public function __construct(\Context $context, \ClassA $exA, \ClassB $exB)
127  {
128  parent::__construct($exA, $context);
129  $this->_context = $context;
130  $this->_exA = $exA;
131  $this->_exB = $exB;
132  }
133 }
135 {
139  protected $_context;
140 
144  protected $_data;
145 
150  public function __construct(\Context $context, array $data = [])
151  {
152  $this->_context = $context;
153  $this->_data = $data;
154  }
155 }
157 {
161  protected $_context;
162 
166  protected $_exB;
167 
171  protected $_exC;
172 
176  protected $_data;
177 
184  public function __construct(\Context $context, \ClassB $exB, \ClassC $exC, array $data = [])
185  {
186  parent::__construct($context, $exB);
187  $this->_context = $context;
188  $this->_exB = $exB;
189  $this->_exC = $exC;
190  $this->_data = $data;
191  }
192 }
__construct(\Context $context, \ClassA $exA, \ClassB $exB)
__construct(\Context $context, \ClassB $exB, \ClassC $exC, array $data=[])
__construct(\ClassA $exA, \ClassB $exB, \ClassC $exC, \FirstInterface $interfaceA, \ImplementationOfSecondInterface $implOfBInterface)
__construct(\Context $context, array $data=[])