original_string: public function getControlURL($description_url, $service = 'AVTransport')
  	{
  		$description = $this->getDescription($description_url);
  
  		switch($service)
  		{
  			case 'AVTransport':
  				$serviceType = 'urn:schemas-upnp-org:service:AVTransport:1';
  				break;
  			default:
  				$serviceType = 'urn:schemas-upnp-org:service:AVTransport:1';
  				break;
  		}
  
  		foreach($description['device']['serviceList']['service'] as $service)
  		{
  			if($service['serviceType'] == $serviceType)
  			{
  				$url = parse_url($description_url);
  				return $url['scheme'].'://'.$url['host'].':'.$url['port'].$service['controlURL'];
  			}
  		}
  	}
code: public function getControlURL($description_url, $service = 'AVTransport')
  	{
  		$description = $this->getDescription($description_url);
  
  		switch($service)
  		{
  			case 'AVTransport':
  				$serviceType = 'urn:schemas-upnp-org:service:AVTransport:1';
  				break;
  			default:
  				$serviceType = 'urn:schemas-upnp-org:service:AVTransport:1';
  				break;
  		}
  
  		foreach($description['device']['serviceList']['service'] as $service)
  		{
  			if($service['serviceType'] == $serviceType)
  			{
  				$url = parse_url($description_url);
  				return $url['scheme'].'://'.$url['host'].':'.$url['port'].$service['controlURL'];
  			}
  		}
  	}
code_tokens: public function getControlURL ( $ description_url , $ service = 'AVTransport' ) { $ description = $ this -> getDescription ( $ description_url ) ; switch ( $ service ) { case 'AVTransport' : $ serviceType = 'urn:schemas-upnp-org:service:AVTransport:1' ; break ; default : $ serviceType = 'urn:schemas-upnp-org:service:AVTransport:1' ; break ; } foreach ( $ description [ 'device' ] [ 'serviceList' ] [ 'service' ] as $ service ) { if ( $ service [ 'serviceType' ] == $ serviceType ) { $ url = parse_url ( $ description_url ) ; return $ url [ 'scheme' ] . '://' . $ url [ 'host' ] . ':' . $ url [ 'port' ] . $ service [ 'controlURL' ] ; } } }
docstring: this should be moved to the upnp and renderer model
docstring_tokens: this should be moved to the upnp and renderer model