You are here

public function SplFileInfoPatch::supports in Zircon Profile 8

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

Supports everything that extends SplFileInfo.

Parameters

ClassNode $node:

Return value

bool

Overrides ClassPatchInterface::supports

File

vendor/phpspec/prophecy/src/Prophecy/Doubler/ClassPatch/SplFileInfoPatch.php, line 32

Class

SplFileInfoPatch
SplFileInfo patch. Makes SplFileInfo and derivative classes usable with Prophecy.

Namespace

Prophecy\Doubler\ClassPatch

Code

public function supports(ClassNode $node) {
  if (null === $node
    ->getParentClass()) {
    return false;
  }
  return 'SplFileInfo' === $node
    ->getParentClass() || is_subclass_of($node
    ->getParentClass(), 'SplFileInfo');
}