@@ -18,27 +18,27 @@ |
||
| 18 | 18 | class ScriptHandler |
| 19 | 19 | { |
| 20 | 20 | |
| 21 | - protected static $destination = '/src/Bridge/Symfony/Bundle/Resources/public/swagger-ui/dist'; |
|
| 22 | - protected static $source = '/vendor/swagger-api/swagger-ui/dist'; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * Copy swagger ui to the correct directory |
|
| 26 | - * |
|
| 27 | - * @parm Event $event |
|
| 28 | - */ |
|
| 29 | - public static function installSwaggerUi(Event $event) { |
|
| 21 | + protected static $destination = '/src/Bridge/Symfony/Bundle/Resources/public/swagger-ui/dist'; |
|
| 22 | + protected static $source = '/vendor/swagger-api/swagger-ui/dist'; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * Copy swagger ui to the correct directory |
|
| 26 | + * |
|
| 27 | + * @parm Event $event |
|
| 28 | + */ |
|
| 29 | + public static function installSwaggerUi(Event $event) { |
|
| 30 | 30 | $fs = new Filesystem(); |
| 31 | 31 | $finder = new Finder(); |
| 32 | 32 | $cwd = getcwd(); |
| 33 | 33 | |
| 34 | 34 | foreach($finder->in($cwd.self::$source) as $file) { |
| 35 | - $destination = $cwd.self::$destination.'/'.$file->getRelativePathname(); |
|
| 36 | - if ($file->isDir()) { |
|
| 35 | + $destination = $cwd.self::$destination.'/'.$file->getRelativePathname(); |
|
| 36 | + if ($file->isDir()) { |
|
| 37 | 37 | $fs->mkdir($destination); |
| 38 | 38 | continue; |
| 39 | - } |
|
| 39 | + } |
|
| 40 | 40 | |
| 41 | - $fs->copy($file->getRealPath(), $destination, true); |
|
| 41 | + $fs->copy($file->getRealPath(), $destination, true); |
|
| 42 | + } |
|
| 42 | 43 | } |
| 43 | - } |
|
| 44 | 44 | } |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | $finder = new Finder(); |
| 32 | 32 | $cwd = getcwd(); |
| 33 | 33 | |
| 34 | - foreach($finder->in($cwd.self::$source) as $file) { |
|
| 34 | + foreach ($finder->in($cwd.self::$source) as $file) { |
|
| 35 | 35 | $destination = $cwd.self::$destination.'/'.$file->getRelativePathname(); |
| 36 | 36 | if ($file->isDir()) { |
| 37 | 37 | $fs->mkdir($destination); |