-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add middleware, method UserResetPassword, UserDelete, LockInitialize;…
… change transport & configuration
- Loading branch information
Showing
23 changed files
with
580 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
src/Contract/Middleware/BeforeResponse/BeforeResponseInterface.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace SunnyPHP\TTLock\Contract\Middleware\BeforeResponse; | ||
|
||
use SunnyPHP\TTLock\Contract\Middleware\MiddlewareInterface; | ||
|
||
interface BeforeResponseInterface extends MiddlewareInterface | ||
{ | ||
public function handle(array $response, ?MiddlewareInterface $next = null): array; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace SunnyPHP\TTLock\Contract\Middleware; | ||
|
||
interface MiddlewareInterface | ||
{ | ||
/** | ||
* @return class-string | ||
*/ | ||
public function getType(): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace SunnyPHP\TTLock\Contract\Request\Lock; | ||
|
||
use DateTimeImmutable; | ||
use SunnyPHP\TTLock\Contract\Request\RequestInterface; | ||
|
||
interface InitializeInterface extends RequestInterface | ||
{ | ||
public function getLockData(): string; | ||
|
||
public function getLockAlias(): ?string; | ||
|
||
public function getGroupId(): ?int; | ||
|
||
public function getNbInitSuccess(): ?bool; | ||
|
||
public function getCurrentTime(): DateTimeImmutable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace SunnyPHP\TTLock\Contract\Request; | ||
|
||
final class RequiredConfiguration | ||
{ | ||
public const CLIENT_ID = 1 << 0; | ||
public const CLIENT_SECRET = 1 << 1; | ||
public const ACCESS_TOKEN = 1 << 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace SunnyPHP\TTLock\Contract\Request\User; | ||
|
||
use DateTimeImmutable; | ||
use SunnyPHP\TTLock\Contract\Request\RequestInterface; | ||
|
||
interface DeleteInterface extends RequestInterface | ||
{ | ||
/** | ||
* Username for delete (only numbers and english letters) | ||
* @return string | ||
*/ | ||
public function getUsername(): string; | ||
|
||
/** | ||
* Current time | ||
* @return DateTimeImmutable | ||
*/ | ||
public function getCurrentTime(): DateTimeImmutable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace SunnyPHP\TTLock\Contract\Request\User; | ||
|
||
use DateTimeImmutable; | ||
use SunnyPHP\TTLock\Contract\Request\RequestInterface; | ||
|
||
interface ResetPasswordInterface extends RequestInterface | ||
{ | ||
/** | ||
* Username (only numbers and english letters) | ||
* @return string | ||
*/ | ||
public function getUsername(): string; | ||
|
||
/** | ||
* New password (32 chars, low case, md5 encrypted) | ||
* @return string | ||
*/ | ||
public function getPassword(): string; | ||
|
||
/** | ||
* Current time | ||
* @return DateTimeImmutable | ||
*/ | ||
public function getCurrentTime(): DateTimeImmutable; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace SunnyPHP\TTLock\Contract\Response\Common; | ||
|
||
use SunnyPHP\TTLock\Contract\Response\ResponseInterface; | ||
|
||
/** | ||
* No data, no error, just success execution | ||
*/ | ||
interface SuccessResponseInterface extends ResponseInterface | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace SunnyPHP\TTLock\Contract\Response\Lock; | ||
|
||
use SunnyPHP\TTLock\Contract\Response\ResponseInterface; | ||
|
||
interface InitializeInterface extends ResponseInterface | ||
{ | ||
public function getLockId(): int; | ||
|
||
public function getKeyId(): int; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.