protected function replaceNamespace(array $segments, $stub)
	{
		if (count($segments) > 1)
		{
			$namespace = implode('\\', array_slice($segments, 0, -1));

			return str_replace('{{namespace}}', ' namespace '.$namespace.';', $stub);
		}
		else
		{
			return str_replace('{{namespace}}', '', $stub);
		}
	}
protected function replaceNamespace(array $segments, $stub)
	{
		if (count($segments) > 1)
		{
			$namespace = implode('\\', array_slice($segments, 0, -1));

			return str_replace('{{namespace}}', ' namespace '.$namespace.';', $stub);
		}
		else
		{
			return str_replace('{{namespace}}', '', $stub);
		}
	}
protected function replaceNamespace ( array $ segments , $ stub ) { if ( count ( $ segments ) > 1 ) { $ namespace = implode ( '\\' , array_slice ( $ segments , 0 , - 1 ) ) ; return str_replace ( '{{namespace}}' , ' namespace ' . $ namespace . ';' , $ stub ) ; } else { return str_replace ( '{{namespace}}' , '' , $ stub ) ; } }
Replace the namespace on the controller.

@param  array   $segments
@param  string  $stub
@return string
Replace the namespace on the controller .