You are here

public function HhvmExceptionPatch::supports in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/HhvmExceptionPatch.php \Prophecy\Doubler\ClassPatch\HhvmExceptionPatch::supports()

Supports exceptions on HHVM.

Parameters

ClassNode $node:

Return value

bool

Overrides ClassPatchInterface::supports

File

vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/HhvmExceptionPatch.php, line 30

Class

HhvmExceptionPatch
Exception patch for HHVM to remove the stubs from special methods

Namespace

Prophecy\Doubler\ClassPatch

Code

public function supports(ClassNode $node) {
  if (!defined('HHVM_VERSION')) {
    return false;
  }
  return 'Exception' === $node
    ->getParentClass() || is_subclass_of($node
    ->getParentClass(), 'Exception');
}