-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from brianvarskonst/feature/upgrade-to-php-81
Feature/Upgrade: Codebase to PHP 8.1
- Loading branch information
Showing
19 changed files
with
152 additions
and
117 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
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
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
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,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; | ||
use Rector\Config\RectorConfig; | ||
use Rector\Set\ValueObject\LevelSetList; | ||
use Rector\Set\ValueObject\SetList; | ||
|
||
return static function (RectorConfig $rectorConfig): void { | ||
$rectorConfig->paths( | ||
[ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
] | ||
); | ||
|
||
// define sets of rules | ||
$rectorConfig->sets( | ||
[ | ||
LevelSetList::UP_TO_PHP_81, | ||
SetList::DEAD_CODE, | ||
SetList::CODE_QUALITY, | ||
SetList::TYPE_DECLARATION, | ||
SetList::CODING_STYLE, | ||
SetList::EARLY_RETURN, | ||
SetList::PRIVATIZATION, | ||
SetList::NAMING | ||
] | ||
); | ||
}; |
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
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,34 @@ | ||
<?php | ||
|
||
// phpcs:ignoreFile | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Bvsk\WordPress\NonceManager\Nonces\Config; | ||
|
||
use ValueError; | ||
|
||
enum DefaultWordPressNonceConfig: string | ||
{ | ||
case ACTION = 'action'; | ||
case REQUEST_NAME = 'requestName'; | ||
|
||
case LIFETIME = 'lifetime'; | ||
|
||
case URL = 'url'; | ||
|
||
case REFERER = 'referer'; | ||
|
||
/** | ||
* @throws ValueError | ||
*/ | ||
public function getDefault(): string|int | ||
{ | ||
return match ($this) { | ||
self::ACTION => '-1', | ||
self::REQUEST_NAME => '_wpnonce', | ||
self::LIFETIME => DAY_IN_SECONDS, | ||
self::URL, self::REFERER => throw new ValueError('No default value are existing.'), | ||
}; | ||
} | ||
} |
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 was deleted.
Oops, something went wrong.
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
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.