protected function compileMethods($stub, array $methods)
    {
        foreach ($methods as $method) {
            $stub = str_replace(['{{' . $method . '}}', '{{/' . $method . '}}'], '', $stub);
        }

        foreach ($this->methods as $method) {
            $stub = preg_replace('/{{' . $method . '}}(.*){{\/' . $method . '}}(\r\n)?/s', '', $stub);
        }

        return $stub;
    }
protected function compileMethods($stub, array $methods)
    {
        foreach ($methods as $method) {
            $stub = str_replace(['{{' . $method . '}}', '{{/' . $method . '}}'], '', $stub);
        }

        foreach ($this->methods as $method) {
            $stub = preg_replace('/{{' . $method . '}}(.*){{\/' . $method . '}}(\r\n)?/s', '', $stub);
        }

        return $stub;
    }
protected function compileMethods ( $ stub , array $ methods ) { foreach ( $ methods as $ method ) { $ stub = str_replace ( [ '{{' . $ method . '}}' , '{{/' . $ method . '}}' ] , '' , $ stub ) ; } foreach ( $ this -> methods as $ method ) { $ stub = preg_replace ( '/{{' . $ method . '}}(.*){{\/' . $ method . '}}(\r\n)?/s' , '' , $ stub ) ; } return $ stub ; }
Compile the stub with the given methods to keep.

@param  string $stub
@param  array $methods
@return string
Compile the stub with the given methods to keep .