src/services/WordsmithService.php
public function parseUrl($s) : array
	{

		$parts = parse_url($s);

		return [
			'scheme' => $parts['scheme'] ?? null,
			'host' => $parts['host'] ?? null,
			'port' => $parts['port'] ?? null,
			'user' => $parts['user'] ?? null,
			'pass' => $parts['pass'] ?? null,
			'path' => $parts['path'] ?? null,
			'query' => $parts['query'] ?? null,
			'fragment' => $parts['fragment'] ?? null,
		];

	}
public function parseUrl($s) : array
	{

		$parts = parse_url($s);

		return [
			'scheme' => $parts['scheme'] ?? null,
			'host' => $parts['host'] ?? null,
			'port' => $parts['port'] ?? null,
			'user' => $parts['user'] ?? null,
			'pass' => $parts['pass'] ?? null,
			'path' => $parts['path'] ?? null,
			'query' => $parts['query'] ?? null,
			'fragment' => $parts['fragment'] ?? null,
		];

	}
Attempts to parse a string as a URL and returns its component parts (i.e. scheme, host, path, etc.)

@param $s
@return array