| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 36 | public static function &getBackend () : Translator_Backend { |
||
| 37 | if (self::$backend == null) { |
||
| 38 | //get translator backend |
||
| 39 | $class_name = Settings::get("translator_class_name", "GetTextBackend"); |
||
| 40 | |||
| 41 | self::$backend = new $class_name(); |
||
| 42 | |||
| 43 | //initialize backend with current language |
||
| 44 | self::$backend->init(Registry::singleton()->getSetting("lang_token")); |
||
| 45 | } |
||
| 46 | |||
| 47 | return self::$backend; |
||
| 48 | } |
||
| 53 |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: