src/Plugin/AbstractPlugin.php
final private function route($event_name, ProxyEvent $event){
		$url = $event['request']->getUri();
		
		// url filter provided and current request url does not match it
		if($this->url_pattern){
			if(starts_with($this->url_pattern, '/') && preg_match($this->url_pattern, $url) !== 1){
				return;
			} else if(stripos($url, $this->url_pattern) === false){
				return;
			}
		}
		
		switch($event_name){
			
			case 'request.before_send':
				$this->onBeforeRequest($event);
			break;
			
			case 'request.sent': 
				$this->onHeadersReceived($event);
			break;
			
			case 'curl.callback.write':
				$this->onCurlWrite($event);
			break;
			
			case 'request.complete':
				$this->onCompleted($event);
			break;
		}
	}
final private function route($event_name, ProxyEvent $event){
		$url = $event['request']->getUri();
		
		// url filter provided and current request url does not match it
		if($this->url_pattern){
			if(starts_with($this->url_pattern, '/') && preg_match($this->url_pattern, $url) !== 1){
				return;
			} else if(stripos($url, $this->url_pattern) === false){
				return;
			}
		}
		
		switch($event_name){
			
			case 'request.before_send':
				$this->onBeforeRequest($event);
			break;
			
			case 'request.sent': 
				$this->onHeadersReceived($event);
			break;
			
			case 'curl.callback.write':
				$this->onCurlWrite($event);
			break;
			
			case 'request.complete':
				$this->onCompleted($event);
			break;
		}
	}
final private function route ( $ event_name , ProxyEvent $ event ) { $ url = $ event [ 'request' ] -> getUri ( ) ; // url filter provided and current request url does not match it
 if ( $ this -> url_pattern ) { if ( starts_with ( $ this -> url_pattern , '/' ) && preg_match ( $ this -> url_pattern , $ url ) !== 1 ) { return ; } else if ( stripos ( $ url , $ this -> url_pattern ) === false ) { return ; } } switch ( $ event_name ) { case 'request.before_send' : $ this -> onBeforeRequest ( $ event ) ; break ; case 'request.sent' : $ this -> onHeadersReceived ( $ event ) ; break ; case 'curl.callback.write' : $ this -> onCurlWrite ( $ event ) ; break ; case 'request.complete' : $ this -> onCompleted ( $ event ) ; break ; } }
dispatch based on filter
dispatch based on filter