Skip to content

Commit

Permalink
Merge branch '7.0' into 7.1
Browse files Browse the repository at this point in the history
* 7.0:
  fix password parameter name
  clean up PHP 8.0 version checks
  • Loading branch information
xabbuh committed Apr 13, 2024
2 parents 1550845 + 5fd79f6 commit e462dc8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ public function testCloneVarExistingFilePath()
$this->assertSame($filePath, $c->getData()[0]);
}

/**
* @requires PHP 8
*/
public function testClassPublicObjectProperty()
{
$parent = new WithPublicObjectProperty();
Expand All @@ -54,9 +51,6 @@ public function testClassPublicObjectProperty()
$this->assertNotNull($c->getData()->parent);
}

/**
* @requires PHP 8
*/
public function testClassPublicObjectPropertyAsReference()
{
$parent = new WithPublicObjectProperty();
Expand All @@ -70,9 +64,6 @@ public function testClassPublicObjectPropertyAsReference()
$this->assertNotNull($c->getData()->parent);
}

/**
* @requires PHP 8
*/
public function testClassUsePropertyInDestruct()
{
$parent = new UsePropertyInDestruct();
Expand All @@ -86,9 +77,6 @@ public function testClassUsePropertyInDestruct()
$this->assertNotNull($c->getData()->parent);
}

/**
* @requires PHP 8
*/
public function testClassUsePropertyAsReferenceInDestruct()
{
$parent = new UsePropertyInDestruct();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public function __toString()
*/
public function testHandleNonStringCsrfTokenWithArray($postOnly)
{
$request = Request::create('/login_check', 'POST', ['_username' => 'foo', 'password' => 'bar', '_csrf_token' => []]);
$request = Request::create('/login_check', 'POST', ['_username' => 'foo', '_password' => 'bar', '_csrf_token' => []]);
$request->setSession($this->createSession());

$this->setUpAuthenticator(['post_only' => $postOnly]);
Expand All @@ -214,7 +214,7 @@ public function testHandleNonStringCsrfTokenWithArray($postOnly)
*/
public function testHandleNonStringCsrfTokenWithInt($postOnly)
{
$request = Request::create('/login_check', 'POST', ['_username' => 'foo', 'password' => 'bar', '_csrf_token' => 42]);
$request = Request::create('/login_check', 'POST', ['_username' => 'foo', '_password' => 'bar', '_csrf_token' => 42]);
$request->setSession($this->createSession());

$this->setUpAuthenticator(['post_only' => $postOnly]);
Expand All @@ -230,7 +230,7 @@ public function testHandleNonStringCsrfTokenWithInt($postOnly)
*/
public function testHandleNonStringCsrfTokenWithObject($postOnly)
{
$request = Request::create('/login_check', 'POST', ['_username' => 'foo', 'password' => 'bar', '_csrf_token' => new \stdClass()]);
$request = Request::create('/login_check', 'POST', ['_username' => 'foo', '_password' => 'bar', '_csrf_token' => new \stdClass()]);
$request->setSession($this->createSession());

$this->setUpAuthenticator(['post_only' => $postOnly]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ private function isGetMethod(\ReflectionMethod $method): bool
private function isSetMethod(\ReflectionMethod $method): bool
{
return !$method->isStatic()
&& (\PHP_VERSION_ID < 80000 || !$method->getAttributes(Ignore::class))
&& !$method->getAttributes(Ignore::class)
&& 1 === $method->getNumberOfRequiredParameters()
&& str_starts_with($method->name, 'set');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ private function hasAttributeAccessorMethod(string $class, string $attribute): b
$method = $reflection->getMethod($attribute);

return !$method->isStatic()
&& (\PHP_VERSION_ID < 80000 || !$method->getAttributes(Ignore::class))
&& !$method->getAttributes(Ignore::class)
&& !$method->getNumberOfRequiredParameters();
}
}

0 comments on commit e462dc8

Please sign in to comment.