Webmozart\Console\Api\Formatter\StyleSet::contains PHP Method

contains() public method

Returns whether the style with the given tag exists.
public contains ( string $tag ) : boolean
$tag string The tag of the style.
return boolean Returns `true` if a style with the given tag exists and `false` otherwise.
    public function contains($tag)
    {
        return isset($this->styles[$tag]);
    }

Usage Example

Example #1
0
 public function testContains()
 {
     $styleSet = new StyleSet();
     $this->assertFalse($styleSet->contains('style'));
     $this->assertFalse($styleSet->contains('foobar'));
     $styleSet->add(Style::tag('style'));
     $this->assertTrue($styleSet->contains('style'));
     $this->assertFalse($styleSet->contains('foobar'));
 }