You are here

public function Doubler::registerClassPatch in Zircon Profile 8

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

Registers new class patch.

Parameters

ClassPatchInterface $patch:

1 call to Doubler::registerClassPatch()
CachedDoubler::registerClassPatch in vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php
Registers new class patch.
1 method overrides Doubler::registerClassPatch()
CachedDoubler::registerClassPatch in vendor/phpspec/prophecy/src/Prophecy/Doubler/CachedDoubler.php
Registers new class patch.

File

vendor/phpspec/prophecy/src/Prophecy/Doubler/Doubler.php, line 73

Class

Doubler
Cached class doubler. Prevents mirroring/creation of the same structure twice.

Namespace

Prophecy\Doubler

Code

public function registerClassPatch(ClassPatchInterface $patch) {
  $this->patches[] = $patch;
  @usort($this->patches, function (ClassPatchInterface $patch1, ClassPatchInterface $patch2) {
    return $patch2
      ->getPriority() - $patch1
      ->getPriority();
  });
}