Skip to content

Commit 884e715

Browse files
committed
Migrating to Rector 0.4
Rector 0.4 is the latest Rector version. This PR migrates the generated Rector file to be compatible with Rector 0.4. It introduces a breaking change since the file is no longer compatible with Rector 0.3. I am willing to introduce this breaking change because Rector 0.3 is currently broken. Any install of Rector 0.3 triggers an error right now (and nobody complained about it in Rector issues). I'm therefore assuming that nobody is using Rector 0.3 anymore and migrating to Rector 0.4 without further notice.
1 parent 04568db commit 884e715

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

generated/ldap.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ function ldap_add($link_identifier, string $dn, array $entry, array $serverctrls
6161
* @param resource $link_identifier
6262
* @param string $bind_rdn
6363
* @param string $bind_password
64+
* @param array $serverctrls
6465
* @return resource Returns an LDAP result identifier.
6566
* @throws LdapException
6667
*
6768
*/
68-
function ldap_bind_ext($link_identifier, ?string $bind_rdn = null, ?string $bind_password = null)
69+
function ldap_bind_ext($link_identifier, ?string $bind_rdn = null, ?string $bind_password = null, array $serverctrls = null)
6970
{
7071
error_clear_last();
71-
$result = \ldap_bind_ext($link_identifier, $bind_rdn, $bind_password);
72+
$result = \ldap_bind_ext($link_identifier, $bind_rdn, $bind_password, $serverctrls);
7273
if ($result === false) {
7374
throw LdapException::createFromPhpError();
7475
}
@@ -82,13 +83,14 @@ function ldap_bind_ext($link_identifier, ?string $bind_rdn = null, ?string $bind
8283
* @param resource $link_identifier An LDAP link identifier, returned by ldap_connect.
8384
* @param string $bind_rdn
8485
* @param string $bind_password
86+
* @param array $serverctrls Array of LDAP Controls to send with the request.
8587
* @throws LdapException
8688
*
8789
*/
88-
function ldap_bind($link_identifier, ?string $bind_rdn = null, ?string $bind_password = null): void
90+
function ldap_bind($link_identifier, ?string $bind_rdn = null, ?string $bind_password = null, array $serverctrls = null): void
8991
{
9092
error_clear_last();
91-
$result = \ldap_bind($link_identifier, $bind_rdn, $bind_password);
93+
$result = \ldap_bind($link_identifier, $bind_rdn, $bind_password, $serverctrls);
9294
if ($result === false) {
9395
throw LdapException::createFromPhpError();
9496
}

generator/src/FileCreator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ public function generateRectorFile(array $functions, string $path): void
125125
if ($stream === false) {
126126
throw new \RuntimeException('Unable to write to '.$path);
127127
}
128-
fwrite($stream, "# This rector file is replacing all core PHP functions with the equivalent \"safe\" functions
128+
fwrite($stream, "# This rector file is replacing all core PHP functions with the equivalent \"safe\" functions
129+
# It is targetting Rector 0.4.x versions.
130+
# If you are using Rector 0.3, please upgrade your Rector version
129131
services:
130132
Rector\Rector\Function_\RenameFunctionRector:
131133
\$oldFunctionToNewFunction:

rector-migrate.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# This rector file is replacing all core PHP functions with the equivalent "safe" functions
1+
# This rector file is replacing all core PHP functions with the equivalent "safe" functions
2+
# It is targetting Rector 0.4.x versions.
3+
# If you are using Rector 0.3, please upgrade your Rector version
24
services:
35
Rector\Rector\Function_\RenameFunctionRector:
46
$oldFunctionToNewFunction:

0 commit comments

Comments
 (0)