From: Umherirrender Date: Tue, 27 Jun 2017 19:44:12 +0000 (+0200) Subject: clone keyword must not be used as a function X-Git-Tag: 1.31.0-rc.0~2845^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22calendrier%22%2C%22type=semaine%22%29%20.%20%22?a=commitdiff_plain;h=9cd5a3fccff3e8c6e307694faa9fd88235446e06;p=lhc%2Fweb%2Fwiklou.git clone keyword must not be used as a function Also changed a require_once Change-Id: Ib8030ea5320a62ee4f114d8d506382c5665e3e02 --- diff --git a/includes/Message.php b/includes/Message.php index fd67613e28..be6b0aff0f 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -419,7 +419,7 @@ class Message implements MessageSpecifier, Serializable { } if ( $value instanceof Message ) { // Message, RawMessage, ApiMessage, etc - $message = clone( $value ); + $message = clone $value; } elseif ( $value instanceof MessageSpecifier ) { $message = new Message( $value ); } elseif ( is_string( $value ) ) { diff --git a/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php b/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php index fd36887c06..7f93c12d4c 100644 --- a/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php +++ b/includes/auth/LocalPasswordPrimaryAuthenticationProvider.php @@ -297,7 +297,7 @@ class LocalPasswordPrimaryAuthenticationProvider // Nothing we can do besides claim it, because the user isn't in // the DB yet if ( $req->username !== $user->getName() ) { - $req = clone( $req ); + $req = clone $req; $req->username = $user->getName(); } $ret = AuthenticationResponse::newPass( $req->username ); diff --git a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php index 44c28241e2..4a2d0094eb 100644 --- a/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php +++ b/includes/auth/TemporaryPasswordPrimaryAuthenticationProvider.php @@ -360,7 +360,7 @@ class TemporaryPasswordPrimaryAuthenticationProvider if ( $req->username !== null && $req->password !== null ) { // Nothing we can do yet, because the user isn't in the DB yet if ( $req->username !== $user->getName() ) { - $req = clone( $req ); + $req = clone $req; $req->username = $user->getName(); } diff --git a/maintenance/getSlaveServer.php b/maintenance/getSlaveServer.php index 2160928b5e..2fa2d7f6ea 100644 --- a/maintenance/getSlaveServer.php +++ b/maintenance/getSlaveServer.php @@ -1,3 +1,3 @@ - diff --git a/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php index 4d603422f2..e0ddb0af37 100644 --- a/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/LocalPasswordPrimaryAuthenticationProviderTest.php @@ -626,7 +626,7 @@ class LocalPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestCase $req->password = 'bar'; $expect = AuthenticationResponse::newPass( 'Foo' ); - $expect->createRequest = clone( $req ); + $expect->createRequest = clone $req; $expect->createRequest->username = 'Foo'; $this->assertEquals( $expect, $provider->beginPrimaryAccountCreation( $user, $user, $reqs ) ); diff --git a/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php b/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php index 6f45fa49dc..1708f1c063 100644 --- a/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php +++ b/tests/phpunit/includes/auth/TemporaryPasswordPrimaryAuthenticationProviderTest.php @@ -647,7 +647,7 @@ class TemporaryPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestC $req->password = 'bar'; $expect = AuthenticationResponse::newPass( 'Foo' ); - $expect->createRequest = clone( $req ); + $expect->createRequest = clone $req; $expect->createRequest->username = 'Foo'; $this->assertEquals( $expect, $provider->beginPrimaryAccountCreation( $user, $user, $reqs ) ); $this->assertNull( $this->manager->getAuthenticationSessionData( 'no-email' ) ); @@ -703,7 +703,7 @@ class TemporaryPasswordPrimaryAuthenticationProviderTest extends \MediaWikiTestC } ); $expect = AuthenticationResponse::newPass( $user->getName() ); - $expect->createRequest = clone( $req ); + $expect->createRequest = clone $req; $expect->createRequest->username = $user->getName(); $res = $provider->beginPrimaryAccountCreation( $user, $creator, [ $req ] ); $this->assertEquals( $expect, $res );