| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.3755 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types = 1); |
||
| 17 | 1 | public function create( |
|
| 18 | UrlGenerator $urlGenerator, |
||
| 19 | bool $enableCache, |
||
| 20 | \SplFileInfo $cacheDir, |
||
| 21 | bool $debugMode |
||
| 22 | ): Hateoas { |
||
| 23 | |||
| 24 | 1 | if ($enableCache) { |
|
| 25 | return HateoasBuilder::create() |
||
| 26 | ->setUrlGenerator(null, new SymfonyUrlGenerator($urlGenerator)) |
||
| 27 | ->setCacheDir($cacheDir->getPathname() . self::SERIALIZER_CACHE_DIR) |
||
| 28 | ->setDebug($debugMode) |
||
| 29 | ->build(); |
||
| 30 | } |
||
| 31 | |||
| 32 | 1 | return HateoasBuilder::create() |
|
| 33 | 1 | ->setUrlGenerator(null, new SymfonyUrlGenerator($urlGenerator)) |
|
| 34 | 1 | ->setDebug($debugMode) |
|
| 35 | 1 | ->build(); |
|
| 36 | } |
||
| 38 |