| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 41 | 2 | public function export() |
|
| 42 | { |
||
| 43 | 2 | $datetime = DateTime::createFromFormat('U.u', microtime(true)); |
|
| 44 | 2 | $fileName = sprintf('%s/%s_routes_%s.csv', $this->outputDir, Package::NAME, $datetime->format('Ymd-His.u')); |
|
| 45 | |||
| 46 | 2 | $fp = fopen($fileName, 'w'); |
|
| 47 | 2 | fputcsv($fp, ['Route name', 'URL', 'Controller', 'Action']); |
|
| 48 | 2 | foreach ($this->routeCollection->getRoutes() as $route) { |
|
| 49 | /* @var Route $route */ |
||
| 50 | 2 | fputcsv($fp, [$route->getName(), $route->getUrl(), $route->getController(), $route->getAction()]); |
|
| 51 | } |
||
| 52 | 2 | fclose($fp); |
|
| 53 | |||
| 54 | 2 | return $fileName; |
|
| 55 | } |
||
| 56 | } |
||
| 57 |