src/Bootstrap/Elements/FormGroup.php
public function label($text, $screenReaderOnly = false, $extraClasses = [])
    {
        if ($text === null)
        {
            return $this;
        }

        $element = clone $this;
        $element->label = Label::create()
                               ->text($text)
                               ->addClassIf($screenReaderOnly, 'sr-only')
                               ->addClass('col-form-label')
                               ->addClass($extraClasses);

        return $element;
    }
public function label($text, $screenReaderOnly = false, $extraClasses = [])
    {
        if ($text === null)
        {
            return $this;
        }

        $element = clone $this;
        $element->label = Label::create()
                               ->text($text)
                               ->addClassIf($screenReaderOnly, 'sr-only')
                               ->addClass('col-form-label')
                               ->addClass($extraClasses);

        return $element;
    }
@param string $text
@param bool   $screenReaderOnly
@param array  $extraClasses

@return static