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);
		}
	}