public function addPlugin(PluginInterface
$p): bool
{ if (!
$types =
$p->
getTypes()) { return false;
} if (!
$triggers =
$p->
getTriggers()) { return false;
} $p->
setParser($this);
foreach ($types as $type) { if (!
isset($this->plugins
[$type])) { $this->plugins
[$type] =
[ self::TRIGGER_BEGIN =>
[],
self::TRIGGER_SUCCESS =>
[],
self::TRIGGER_RECURSION =>
[],
self::TRIGGER_DEPTH_LIMIT =>
[],
];
}