Golonka\BBCode\BBCodeParser::only PHP Méthode

only() public méthode

Limits the parsers to only those you specify
public only ( mixed $only = null ) : object
$only mixed parsers
Résultat object BBCodeParser object
    public function only($only = null)
    {
        $only = is_array($only) ? $only : func_get_args();
        $this->enabledParsers = $this->arrayOnly($this->parsers, $only);
        return $this;
    }

Usage Example

 public function testOnlyFunctionality()
 {
     $b = new BBCodeParser();
     $onlyParsers = array_values($b->only('image', 'link')->getParsers());
     $this->assertEquals($onlyParsers, array('image', 'link'));
 }