D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
tattooscyy
/
test
/
vendor
/
mockery
/
mockery
/
library
/
Mockery
/
Generator
/
Filename :
CachingGenerator.php
back
Copy
<?php namespace Mockery\Generator; class CachingGenerator implements Generator { protected $generator; protected $cache = array(); public function __construct(Generator $generator) { $this->generator = $generator; } public function generate(MockConfiguration $config) { $hash = $config->getHash(); if (isset($this->cache[$hash])) { return $this->cache[$hash]; } $definition = $this->generator->generate($config); $this->cache[$hash] = $definition; return $definition; } }