classes) ) { return $this->call($parameters, $method); } return $this->call($parameters)->$method(); // @codeCoverageIgnore } /** * Annotation * * @param string $class * @param string $function = NULL * * @return object */ public function annotation(string $class, ?string $function = NULL) : stdClass { if( strstr($class, '::') ) { $method = explode('::', $class); $class = $method[0]; $function = $method[1]; } if( $function[0] === '$' ) { $class = $this->property($class, ltrim($function, '$')); } else { if( $function === NULL ) { $class = $this->class($class); } else { $class = $this->method($class, $function); } } preg_match_all('/@(\w+.*?)\s+(.*?)\s+\*/s', $class->getDocComment() ?? '', $match); $keys = $match[1] ?? []; $values = $match[2] ?? []; $values = array_map(function($data) { if( Json::check($data) ) { return Json::decodeObject($data); } elseif( $data[0] === ':' ) { return eval('?>