You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rector rules to upgrade a phpseclib v2.0 install to phpseclib v3.0
4
+
5
+
## Overview
6
+
7
+
You can use [phpseclib2_compat](https://github.com/phpseclib/phpseclib2_compat) to make all your phpseclib v2.0 calls use phpseclib v3.0, internally, under the hood, or you can use this [Rector](https://getrector.com/) rule to upgrade your phpseclib v2.0 calls to phpseclib v3.0 calls.
8
+
9
+
## Installation
10
+
11
+
With [Composer](https://getcomposer.org/):
12
+
13
+
```
14
+
composer require phpseclib/phpseclib2_rector:~1.0
15
+
```
16
+
## Usage
17
+
18
+
Create a rector.php file with the following contents:
19
+
20
+
```php
21
+
<?php
22
+
use Rector\Config\RectorConfig;
23
+
use phpseclib\phpseclib3Rector\Set;
24
+
25
+
return RectorConfig::configure()
26
+
->withSets([Set::PATH]);
27
+
```
28
+
In the same directory where you created that file you can then run Rector by doing either of these commands:
29
+
30
+
```
31
+
vendor/bin/rector process src --dry-run
32
+
vendor/bin/rector process src
33
+
```
34
+
The files in the `src/` directory will either be full on modified or (in the case of `--dry-run`) the changes that would be made will be previewed.
0 commit comments