| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 2 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 23 | public function createSchema($schemaFile) |
||
| 24 | 2 | { |
|
| 25 | $cacheKey = hash('sha1', $schemaFile); |
||
| 26 | 2 | $item = $this->cache->getItem($cacheKey); |
|
| 27 | 2 | if ($item->isHit()) { |
|
| 28 | 2 | $schema = $item->get(); |
|
| 29 | 1 | } else { |
|
| 30 | $schema = $this->schemaFactory->createSchema($schemaFile); |
||
| 31 | 1 | $this->cache->save($item->set($schema)); |
|
| 32 | 1 | } |
|
| 33 | |||
| 34 | return $schema; |
||
| 35 | 2 | } |
|
| 37 |