| @@ 16-25 (lines=10) @@ | ||
| 13 | self::unregister_from_cs(); |
|
| 14 | } |
|
| 15 | ||
| 16 | static function register_in_cs() { |
|
| 17 | $installed_paths = self::get_installed_path(); |
|
| 18 | if (in_array(__DIR__, $installed_paths)) { |
|
| 19 | echo "Our path is already registered in PHP CodeSniffer\n"; |
|
| 20 | } else { |
|
| 21 | array_push($installed_paths, __DIR__); |
|
| 22 | self::set_installed_path($installed_paths); |
|
| 23 | echo "Registered our path in PHP CodeSniffer\n"; |
|
| 24 | } |
|
| 25 | } |
|
| 26 | ||
| 27 | static function unregister_from_cs() { |
|
| 28 | $installed_paths = self::get_installed_path(); |
|
| @@ 27-38 (lines=12) @@ | ||
| 24 | } |
|
| 25 | } |
|
| 26 | ||
| 27 | static function unregister_from_cs() { |
|
| 28 | $installed_paths = self::get_installed_path(); |
|
| 29 | if (! in_array(__DIR__, $installed_paths)) { |
|
| 30 | echo "Our path is not registered in PHP CodeSniffer\n"; |
|
| 31 | } else { |
|
| 32 | $installed_paths = array_filter($installed_paths, function ($v) { |
|
| 33 | return $v != __DIR__; |
|
| 34 | }); |
|
| 35 | self::set_installed_path($installed_paths); |
|
| 36 | echo "Unregistered our path in PHP CodeSniffer\n"; |
|
| 37 | } |
|
| 38 | } |
|
| 39 | ||
| 40 | static function make_copy() { |
|
| 41 | $srcDir = __DIR__; |
|