/** * @param string $encodedAccountRegistrationReference * @return AccountRegistrationReference|null */ public static function rebuild($encodedAccountRegistrationReference) { if (empty($encodedAccountRegistrationReference)) { return null; } $instance = new static(); $instance->import($encodedAccountRegistrationReference); return $instance->isLoaded() ? $instance : null; }
/** * Scan function entry * * @param mixed $name The name of the function to reflect or a closure. * * @return self * @throws CallableNotFoundException */ public static function scan($name) { try { $fe = new \ReflectionFunction($name); } catch (\Exception $e) { throw Error::functionNotFound($name); } $info = new static(); $info->import($fe); return $info; }
/** * Scan method * * @param mixed $class class name or object * @param string $method * * @return MethodInfo * @throws CallableNotFoundException */ public static function scan($class, $method) { try { $me = new \ReflectionMethod($class, $method); } catch (\Exception $e) { throw Error::methodNotFound($class . "::" . $method); } $info = new static(); $info->import($me); return $info; }
public static function __callStatic($name, $args) { $instance = static::$instance; if (!$instance) { // import base js and css to first ckeditor static::$import = true; $instance = static::$instance = new static(); } else { // not import more base js and css if there are multiple ckeditor on one page static::$import = false; } switch (count($args)) { case 0: return $instance->make($name); case 1: return $instance->make($name, $args[0]); case 2: return $instance->make($name, $args[0], $args[1]); } }
public function getClone() { $new = new static(); $new->import($this->export()); return $new; }