Answer the question
In order to leave comments, you need to log in
How to highlight magic classes in Phpstrom?
In one CMS, classes are connected by magic:
// Свойства - Классы API
private $classes = array(
'config' => 'Config',
'request' => 'Request',
'db' => 'Database',
'blog' => 'Blog',
...
);
/**
* Магический метод, создает нужный объект API
*/
public function __get($name)
{
// Если такой объект уже существует, возвращаем его
if(isset(self::$objects[$name]))
{
return(self::$objects[$name]);
}
}
// Выбираем пост из базы
$post = $this->blog->get_post($url);
Answer the question
In order to leave comments, you need to log in
It is possible if hands describe each method.
/**
* Class A
*
* @method get_post (string $url)
*/
class A
{
}
@method static get_post (string $url)
1. Look for a plugin for your CMS.
2. Use PhpDoc.
3. Don't use magic.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question