public static function checkIsRequired($doc)
    {
        $required = false;
        if (false !== preg_match('/@required/', $doc, $matches)) {
            $required = (bool)count($matches);
        }
        return $required;
    }
public static function checkIsRequired($doc)
    {
        $required = false;
        if (false !== preg_match('/@required/', $doc, $matches)) {
            $required = (bool)count($matches);
        }
        return $required;
    }
public static function checkIsRequired ( $ doc ) { $ required = false ; if ( false !== preg_match ( '/@required/' , $ doc , $ matches ) ) { $ required = ( bool ) count ( $ matches ) ; } return $ required ; }
Method extract if a variable is required
@param $doc
@return null|string
Method extract if a variable is required