| Total Complexity | 9 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | trait ResetsApplication |
||
| 11 | { |
||
| 12 | protected function resetApplication(): void |
||
| 13 | { |
||
| 14 | $this->resetPages(); |
||
| 15 | $this->resetPosts(); |
||
| 16 | $this->resetDocs(); |
||
| 17 | $this->resetSite(); |
||
| 18 | } |
||
| 19 | |||
| 20 | protected function resetPages(): void |
||
| 21 | { |
||
| 22 | array_map('\Hyde\Testing\TestCase::unlinkUnlessDefault', glob(Hyde::path('_pages/*.md'))); |
||
| 23 | array_map('\Hyde\Testing\TestCase::unlinkUnlessDefault', glob(Hyde::path('_pages/*.blade.php'))); |
||
| 24 | } |
||
| 25 | |||
| 26 | protected function resetPosts(): void |
||
| 29 | } |
||
| 30 | |||
| 31 | protected function resetDocs(): void |
||
| 32 | { |
||
| 33 | array_map('\Hyde\Testing\TestCase::unlinkUnlessDefault', glob(Hyde::path('_docs/*.md'))); |
||
| 34 | } |
||
| 35 | |||
| 36 | protected function resetSite(): void |
||
| 37 | { |
||
| 38 | Filesystem::cleanDirectory('_site'); |
||
| 39 | } |
||
| 40 | |||
| 41 | protected function withoutDefaultPages(): void |
||
| 42 | { |
||
| 43 | Hyde::unlink('_pages/404.blade.php'); |
||
| 44 | Hyde::unlink('_pages/index.blade.php'); |
||
| 45 | } |
||
| 46 | |||
| 47 | protected function restoreDefaultPages(): void |
||
| 51 | } |
||
| 52 | |||
| 53 | protected static function unlinkUnlessDefault(string $filepath): void |
||
| 64 | } |
||
| 65 | } |
||
| 66 | } |
||
| 67 |