| @@ 62-77 (lines=16) @@ | ||
| 59 | return $errors; |
|
| 60 | } |
|
| 61 | ||
| 62 | public static function file($parameters) |
|
| 63 | { |
|
| 64 | $yaml = array_replace_recursive( |
|
| 65 | Yaml::parse(file_get_contents(__DIR__ . '/../.eslint.yml.dist')), $parameters['eslint_rules'] |
|
| 66 | ); |
|
| 67 | $location = self::location($parameters) . '/.eslint.yml'; |
|
| 68 | $fileSystem = new Filesystem(); |
|
| 69 | ||
| 70 | try { |
|
| 71 | $fileSystem->remove($location); |
|
| 72 | $fileSystem->touch($location); |
|
| 73 | file_put_contents($location, Yaml::dump($yaml)); |
|
| 74 | } catch (\Exception $exception) { |
|
| 75 | echo sprintf("Something wrong happens during the creating process: \n%s\n", $exception->getMessage()); |
|
| 76 | } |
|
| 77 | } |
|
| 78 | ||
| 79 | private static function location($parameters) |
|
| 80 | { |
|
| @@ 59-74 (lines=16) @@ | ||
| 56 | return $errors; |
|
| 57 | } |
|
| 58 | ||
| 59 | public static function file($parameters) |
|
| 60 | { |
|
| 61 | $yaml = array_replace_recursive( |
|
| 62 | Yaml::parse(file_get_contents(__DIR__ . '/../.scss_lint.yml.dist')), $parameters['scsslint_rules'] |
|
| 63 | ); |
|
| 64 | $location = self::location($parameters) . '/.scss_lint.yml'; |
|
| 65 | $fileSystem = new Filesystem(); |
|
| 66 | ||
| 67 | try { |
|
| 68 | $fileSystem->remove($location); |
|
| 69 | $fileSystem->touch($location); |
|
| 70 | file_put_contents($location, Yaml::dump($yaml)); |
|
| 71 | } catch (\Exception $exception) { |
|
| 72 | echo sprintf("Something wrong happens during the creating process: \n%s\n", $exception->getMessage()); |
|
| 73 | } |
|
| 74 | } |
|
| 75 | ||
| 76 | private static function location($parameters) |
|
| 77 | { |
|