Tebru\Retrofit\Retrofit::createCache PHP Method

createCache() public method

Creates cache files based on registered services
public createCache ( ) : integer
return integer Number of services cached
    public function createCache()
    {
        foreach ($this->services as $service) {
            $this->generator->createAndWrite($service);
        }
        return count($this->services);
    }

Usage Example

Example #1
0
 public function testCreateCache()
 {
     $retrofit = new Retrofit(self::$cacheDir);
     $retrofit->registerServices([MockService::class, MockSimpleService::class]);
     $numberCached = $retrofit->createCache();
     $this->assertEquals(2, $numberCached);
 }
All Usage Examples Of Tebru\Retrofit\Retrofit::createCache