/** * Default constructor * * @throws ErrorNotFoundException * @return \Codersquad\Pennephp\Exception\Exception */ public function __construct() { if (!Collection::existsKey(self::$errorCodes, $this->errorCode)) { throw new ErrorNotFoundException(); } $errorMessage = []; $errorMessage[] = 'Error ' . $this->errorCode . ' occured: ' . self::$errorCodes[$this->errorCode]; $this->message = Collection::implode($errorMessage, '<br />'); }
/** * */ public function testExistKeyWithWrongDatatype() { $this->assertFalse(Collection::existsKey('abc', 'a')); }
/** * @param $className */ private static function createInstance($className) { if (!Collection::existsKey(self::$instances, $className)) { self::$instances[$className] = new $className(); } }