Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InterceptableValidator.php
Go to the documentation of this file.
1 <?php
7 
9 {
14  public function validate($className)
15  {
16  return !$this->isInterceptor($className) && $this->isInterceptable($className);
17  }
18 
26  private function isInterceptor($instanceName)
27  {
28  return $this->endsWith($instanceName, '\Interceptor');
29  }
30 
38  private function isInterceptable($instanceName)
39  {
40  return !is_subclass_of(
41  $instanceName,
42  '\\' . \Magento\Framework\ObjectManager\Code\Generator\Proxy::NON_INTERCEPTABLE_INTERFACE
43  );
44  }
45 
53  private function endsWith($haystack, $needle)
54  {
55  // Search forward starting from end minus needle length characters
56  $temp = strlen($haystack) - strlen($needle);
57  return $needle === '' || ($temp >= 0 && strpos($haystack, $needle, $temp) !== false);
58  }
59 }
is_subclass_of($obj, $className)
if($currentSelectedMethod==$_code) $className
Definition: form.phtml:31