<commit_before><?php

/**
 * A class that proxies another, allowing various functionality to be
 * injected
 * 
 * @author <EMAIL>
 * @license http://silverstripe.org/bsd-license/
 */
class AopProxyService {
	public $beforeCall = array();

	public $afterCall = array();

	public $proxied;

	public function __call($method, $args) {
		if (method_exists($this->proxied, $method)) {
			if (isset($this->beforeCall[$method])) {
				$this->beforeCall[$method]->preCall($this->proxied, $method, $args);
			}

            $result = call_user_func_array(array($this->proxied, $method), $args);
			
			if (isset($this->afterCall[$method])) {
				$this->afterCall[$method]->postCall($this->proxied, $method, $args, $result);
			}

			return $result;
        }
	}
}<commit_msg>Proxied methods only get called if the 'beforeCall' doesn't return false<commit_after><?php

/**
 * A class that proxies another, allowing various functionality to be
 * injected
 * 
 * @author <EMAIL>
 * @license http://silverstripe.org/bsd-license/
 */
class AopProxyService {
	public $beforeCall = array();

	public $afterCall = array();

	public $proxied;

	public function __call($method, $args) {
		if (method_exists($this->proxied, $method)) {
			$continue = true;
			if (isset($this->beforeCall[$method])) {
				$result = $this->beforeCall[$method]->preCall($this->proxied, $method, $args);
				if ($result === false) {
					$continue = false;
				}
			}

			if ($continue) {
				$result = call_user_func_array(array($this->proxied, $method), $args);
			
				if (isset($this->afterCall[$method])) {
					$this->afterCall[$method]->postCall($this->proxied, $method, $args, $result);
				}

				return $result;
			}
        }
	}
}
{'fraction_non_alphanumeric': 0.17508813160987075, 'fraction_numerical': 0.0, 'mean_word_length': 3.797183098591549, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5910660', 'n_tokens_mistral': 640, 'n_tokens_neox': 558, 'n_words': 120}