Skip to content
This repository was archived by the owner on Feb 20, 2023. It is now read-only.

Commit c5e6274

Browse files
Make cache static for sebastianbergmann/phpunit#1187
1 parent 5888b25 commit c5e6274

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/Framework/MockObject/Generator.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class PHPUnit_Framework_MockObject_Generator
6565
/**
6666
* @var array
6767
*/
68-
protected $cache = array();
68+
private static $cache = array();
6969

7070
/**
7171
* @var array
@@ -505,8 +505,8 @@ public function generate($type, array $methods = NULL, $mockClassName = '', $cal
505505
serialize($callOriginalMethods)
506506
);
507507

508-
if (isset($this->cache[$key])) {
509-
return $this->cache[$key];
508+
if (isset(self::$cache[$key])) {
509+
return self::$cache[$key];
510510
}
511511
}
512512

@@ -521,7 +521,7 @@ public function generate($type, array $methods = NULL, $mockClassName = '', $cal
521521
);
522522

523523
if (isset($key)) {
524-
$this->cache[$key] = $mock;
524+
self::$cache[$key] = $mock;
525525
}
526526

527527
return $mock;

0 commit comments

Comments
 (0)