Skip to content

Commit

Permalink
style(cs): run php-cs-fixer after coding-standard update
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Citharel <[email protected]>
  • Loading branch information
tcitworld committed Sep 13, 2024
1 parent e976b90 commit 79b99fb
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions lib/BackgroundJob/ExpireRegistrations.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ public function __construct(ITimeFactory $time,
public function run($argument): void {
$expireDays = $this->getDuration();
$expireDate = $this->time->getDateTime();
$interval = new \DateInterval("P" . $expireDays . "D");
$interval = new \DateInterval('P' . $expireDays . 'D');
$expireDate->sub($interval);

$this->registrationMapper->deleteOlderThan($expireDate);
}

private function getDuration(): int {
return max(
(int) $this->config->getAppValue(
(int)$this->config->getAppValue(
Application::APP_ID,
'expire_days',
'30'
Expand Down
2 changes: 1 addition & 1 deletion lib/Service/RegistrationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
namespace OCA\Registration\Service;

class RegistrationException extends \Exception {
public function __construct(string $message, protected string $hint = "", int $code = 400) {
public function __construct(string $message, protected string $hint = '', int $code = 400) {
parent::__construct($message, $code);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/BackgroundJob/ExpireRegistrationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function testRun() {
->with()
->willReturn($expireDate);

$interval = new \DateInterval("P20D");
$interval = new \DateInterval('P20D');
$expireDate->sub($interval);

$this->registrationMapper->expects($this->once())
Expand Down
24 changes: 12 additions & 12 deletions tests/Unit/Service/RegistrationServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ public function testValidatePendingReg() {

public function testCreateAccountWebForm() {
$reg = new Registration();
$reg->setEmail("[email protected]");
$reg->setEmail('[email protected]');
//$reg->setUsername("alice1");
$reg->setDisplayname("Alice");
$reg->setDisplayname('Alice');
//$reg->setPassword("asdf");
$reg->setEmailConfirmed(true);

Expand All @@ -214,9 +214,9 @@ public function testCreateAccountWebForm() {
*/
public function testDuplicateUsernameWebForm() {
$reg = new Registration();
$reg->setEmail("[email protected]");
$reg->setEmail('[email protected]');
//$reg->setUsername("alice1");
$reg->setDisplayname("Alice");
$reg->setDisplayname('Alice');
//$reg->setPassword("asdf");
$reg->setEmailConfirmed(true);

Expand All @@ -238,10 +238,10 @@ public function testDuplicateUsernameWebForm() {
*/
public function testDuplicateUsernameApi() {
$reg = new Registration();
$reg->setEmail("[email protected]");
$reg->setUsername("alice1");
$reg->setDisplayname("Alice");
$reg->setPassword("crypto(asdf)");
$reg->setEmail('[email protected]');
$reg->setUsername('alice1');
$reg->setDisplayname('Alice');
$reg->setPassword('crypto(asdf)');
$reg->setEmailConfirmed(true);

$this->crypto->method('decrypt')
Expand All @@ -264,10 +264,10 @@ public function testUsernameDoesntMatchPattern() {
]);

$reg = new Registration();
$reg->setEmail("[email protected]");
$reg->setUsername("alice23");
$reg->setDisplayname("Alice");
$reg->setPassword("crypto(asdf)");
$reg->setEmail('[email protected]');
$reg->setUsername('alice23');
$reg->setDisplayname('Alice');
$reg->setPassword('crypto(asdf)');
$reg->setEmailConfirmed(true);

$this->crypto->method('decrypt')
Expand Down

0 comments on commit 79b99fb

Please sign in to comment.