1 | <?php |
||
60 | class App |
||
61 | { |
||
62 | /** |
||
63 | * Configuration |
||
64 | * |
||
65 | * @var array |
||
66 | */ |
||
67 | protected static $config; |
||
68 | /** |
||
69 | * Root directory |
||
70 | * |
||
71 | * @var string |
||
72 | */ |
||
73 | protected static $rootDirectory; |
||
74 | /** |
||
75 | * Entity manager |
||
76 | * |
||
77 | * @var EntityManager |
||
78 | */ |
||
79 | protected static $entityManager; |
||
80 | /** |
||
81 | * Developer mode |
||
82 | * |
||
83 | * @var boolean |
||
84 | */ |
||
85 | protected static $devMode; |
||
86 | /** |
||
87 | * Account service |
||
88 | * |
||
89 | * @var AccountService |
||
90 | */ |
||
91 | protected static $accountService = null; |
||
92 | /** |
||
93 | * Virtual host service |
||
94 | * |
||
95 | * @var VirtualHostService |
||
96 | */ |
||
97 | protected static $vhostService = null; |
||
98 | /** |
||
99 | * Domain service |
||
100 | * |
||
101 | * @var DomainService |
||
102 | */ |
||
103 | protected static $domainService = null; |
||
104 | /** |
||
105 | * Active Storage adapter |
||
106 | * |
||
107 | * @var StorageAdapterStrategyInterface |
||
108 | */ |
||
109 | protected static $storageAdapter; |
||
110 | /** |
||
111 | * Persistence adapter factory |
||
112 | * |
||
113 | * @var PersistenceAdapterFactoryInterface |
||
114 | */ |
||
115 | protected static $persistenceAdapterFactory; |
||
116 | /** |
||
117 | * Persistence service |
||
118 | * |
||
119 | * @var PersistenceServiceInterface |
||
120 | */ |
||
121 | protected static $persistenceService; |
||
122 | /** |
||
123 | * App domain |
||
124 | * |
||
125 | * @var string |
||
126 | */ |
||
127 | const DOMAIN = 'admin'; |
||
128 | |||
129 | /** |
||
130 | * Bootstrap |
||
131 | * |
||
132 | * @see https://github.com/toggl/toggl_api_docs/blob/master/reports.md |
||
133 | * @see http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/configuration.html |
||
134 | * |
||
135 | * @param bool $devMode Developer mode |
||
136 | */ |
||
137 | public static function bootstrap($devMode = false) |
||
154 | |||
155 | /** |
||
156 | * Initialize Doctrine |
||
157 | */ |
||
158 | protected static function initializeDoctrine() |
||
192 | |||
193 | /** |
||
194 | * Return the entity manager |
||
195 | * |
||
196 | * @return EntityManager |
||
197 | */ |
||
198 | public static function getEntityManager() |
||
202 | |||
203 | /** |
||
204 | * Get a configuration value |
||
205 | * |
||
206 | * @param null $key Optional: config value key |
||
207 | * @return mixed Configuration value(s) |
||
208 | */ |
||
209 | 3 | public static function getConfig($key = null) |
|
224 | |||
225 | /** |
||
226 | * Return the contents of a particular template |
||
227 | * |
||
228 | * @param string $template Template name |
||
229 | * @return string template contents |
||
230 | */ |
||
231 | public static function getTemplate($template) |
||
240 | |||
241 | /** |
||
242 | * Return the account service |
||
243 | * |
||
244 | * @return AccountService Account service |
||
245 | */ |
||
246 | public static function getAccountService() |
||
254 | |||
255 | /** |
||
256 | * Return the virtual host service |
||
257 | * |
||
258 | * @return VirtualHostService Virtual host service |
||
259 | */ |
||
260 | public static function getVirtualHostService() |
||
268 | |||
269 | /** |
||
270 | * Return the domain service |
||
271 | * |
||
272 | * @return DomainService Domain service |
||
273 | */ |
||
274 | public static function getDomainService() |
||
282 | } |
||
283 |
Our type inference engine has found a suspicous assignment of a value to a property. This check raises an issue when a value that can be of a mixed type is assigned to a property that is type hinted more strictly.
For example, imagine you have a variable
$accountId
that can either hold an Id object or false (if there is no account id yet). Your code now assigns that value to theid
property of an instance of theAccount
class. This class holds a proper account, so the id value must no longer be false.Either this assignment is in error or a type check should be added for that assignment.