/** * Set instance. * @return Exception|ImageText * @throws Exception */ private static function _instance() { try { $file = DOCROOT . self::DEFAULT_PATH . self::DEFAULT_FONT; if (!file_exists($file)) { throw new Exception("Error: has not font file " . __METHOD__ . " => {$file}"); } self::$_instance = new self(); } catch (Exception $e) { throw $e; } return self::$_instance; }