Skip to content

Commit fd917eb

Browse files
Merge pull request #122 from eliashaeussler/task/phpstan-config
[!!!][TASK] Use `eliashaeussler/phpstan-config` and require `spomky-labs/otphp` >= 11.1
2 parents aa3dba3 + 803fa4e commit fd917eb

File tree

6 files changed

+152
-11
lines changed

6 files changed

+152
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ composer require eliashaeussler/cpanel-requests
3131

3232
:warning: If you want to use two-factor authentication together with
3333
the HTTP session [authorization](#authorization) method, you must
34-
**manually require the `spomky-labs/otphp` package**.
34+
**manually require the `spomky-labs/otphp` package (>= 11.1)**.
3535

3636
## :zap:Usage
3737

composer.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,17 @@
2828
"armin/editorconfig-cli": "^1.5",
2929
"donatj/mock-webserver": "^2.4",
3030
"eliashaeussler/php-cs-fixer-config": "^1.1",
31+
"eliashaeussler/phpstan-config": "^1.0",
3132
"eliashaeussler/rector-config": "^1.0",
3233
"ergebnis/composer-normalize": "^2.28",
33-
"phpstan/phpstan": "^1.8",
34+
"phpstan/extension-installer": "^1.2",
3435
"phpstan/phpstan-phpunit": "^1.1",
35-
"phpstan/phpstan-strict-rules": "^1.2",
3636
"phpunit/phpunit": "^10.0",
37-
"spomky-labs/otphp": "^11.0",
37+
"spomky-labs/otphp": "^11.1",
3838
"thecodingmachine/safe": "^2.0"
3939
},
4040
"suggest": {
41-
"spomky-labs/otphp": "Used for authentication via HTTP session (^11.0)"
41+
"spomky-labs/otphp": "Used for authentication via HTTP session (^11.1)"
4242
},
4343
"autoload": {
4444
"psr-4": {
@@ -53,7 +53,8 @@
5353
"bin": "bin/cpanel-requests",
5454
"config": {
5555
"allow-plugins": {
56-
"ergebnis/composer-normalize": true
56+
"ergebnis/composer-normalize": true,
57+
"phpstan/extension-installer": true
5758
},
5859
"sort-packages": true
5960
},

composer.lock

Lines changed: 143 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
includes:
22
- vendor/phpstan/phpstan/conf/bleedingEdge.neon
3-
- vendor/phpstan/phpstan-phpunit/extension.neon
4-
- vendor/phpstan/phpstan-strict-rules/rules.neon
53
parameters:
64
level: max
75
paths:

src/Application/Authorization/HttpAuthorization.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ private function getOTP(): ?string
121121
return null;
122122
}
123123

124-
return TOTP::create(trim($this->otpSecret))->now();
124+
return TOTP::createFromSecret(trim($this->otpSecret))->now();
125125
}
126126

127127
private function createUriBuilder(): Http\UriBuilder\UriBuilderInterface

tests/Application/Authorization/HttpAuthorizationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function sendAuthorizedRequestProvidesOTPTokenIfOTPSecretIsGiven(): void
9191

9292
self::assertNotEmpty($otpSecret);
9393

94-
$otp = TOTP::create($otpSecret)->now();
94+
$otp = TOTP::createFromSecret($otpSecret)->now();
9595
$subject = new Application\Authorization\HttpAuthorization('foo', 'bar', $otpSecret);
9696
$request = new Http\Request\ApiRequest(self::getMockServerBaseUri(), 'foo');
9797

0 commit comments

Comments
 (0)