class HhvmExceptionPatch in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/HhvmExceptionPatch.php \Prophecy\Doubler\ClassPatch\HhvmExceptionPatch
 
Exception patch for HHVM to remove the stubs from special methods
@author Christophe Coevoet <stof@notk.org>
Hierarchy
- class \Prophecy\Doubler\ClassPatch\HhvmExceptionPatch implements ClassPatchInterface
 
Expanded class hierarchy of HhvmExceptionPatch
File
- vendor/
phpspec/ prophecy/ src/ Prophecy/ Doubler/ ClassPatch/ HhvmExceptionPatch.php, line 21  
Namespace
Prophecy\Doubler\ClassPatchView source
class HhvmExceptionPatch implements ClassPatchInterface {
  /**
   * Supports exceptions on HHVM.
   *
   * @param ClassNode $node
   *
   * @return bool
   */
  public function supports(ClassNode $node) {
    if (!defined('HHVM_VERSION')) {
      return false;
    }
    return 'Exception' === $node
      ->getParentClass() || is_subclass_of($node
      ->getParentClass(), 'Exception');
  }
  /**
   * Removes special exception static methods from the doubled methods.
   *
   * @param ClassNode $node
   *
   * @return void
   */
  public function apply(ClassNode $node) {
    if ($node
      ->hasMethod('setTraceOptions')) {
      $node
        ->getMethod('setTraceOptions')
        ->useParentCode();
    }
    if ($node
      ->hasMethod('getTraceOptions')) {
      $node
        ->getMethod('getTraceOptions')
        ->useParentCode();
    }
  }
  /**
   * {@inheritdoc}
   */
  public function getPriority() {
    return -50;
  }
}Members
| 
            Name | 
                  Modifiers | Type | Description | Overrides | 
|---|---|---|---|---|
| 
            HhvmExceptionPatch:: | 
                  public | function | 
            Removes special exception static methods from the doubled methods. Overrides ClassPatchInterface:: | 
                  |
| 
            HhvmExceptionPatch:: | 
                  public | function | 
            Returns patch priority, which determines when patch will be applied. Overrides ClassPatchInterface:: | 
                  |
| 
            HhvmExceptionPatch:: | 
                  public | function | 
            Supports exceptions on HHVM. Overrides ClassPatchInterface:: |