protected function dumpMethod(Method $method)
    {
        $builder = new MethodBuilder();

        $documentation = $method->getDescription()."\n\n";
        $signature = array();

        foreach ($method->getParameters() as $parameter) {
            $builder->addParameter($parameter->getName());
            $documentation .= "@param string $".$parameter->getName()." ".$parameter->getDescription()."\n\n";
            $signature[] = '$'.$parameter->getName();
        }

        $signature = implode(', ', $signature);

        if ($method->isAction()) {
            $documentation .= '@return \Selenium\Browser Fluid interface';

            $body  = '$this->driver->action("'.$method->getName().'"'. ($signature ? ', '.$signature : '') . ');'."\n";
            $body .= "\n";
            $body .= "return \$this;";

        } else {
            $returnType = $method->getReturnType();

            if ($returnType === 'boolean') {
                $getMethod = 'getBoolean';
            } elseif ($returnType === 'string') {
                $getMethod = 'getString';
            } elseif ($returnType === 'string[]') {
                $getMethod = 'getStringArray';
            } elseif ($returnType === 'number') {
                $getMethod = 'getNumber';
                $returnType = 'integer';

                if (0 === strpos($method->getReturnDescription(), 'of ')) {
                    $returnType .= ' number';
                }
            }

            $documentation .= '@return '.$returnType.' '.$method->getReturnDescription();

            $body = 'return $this->driver->'.$getMethod.'("'.$method->getName().'"'.($signature ? ', '.$signature : '').');';
        }

        $builder->setName($method->getName());
        $builder->setBody($body);
        $builder->setDocumentation($documentation);

        return $builder->buildCode();
    }