mirror of
https://github.com/pestphp/pest.git
synced 2026-03-07 00:07:22 +01:00
feature(presets): Add security preset
Looks for functions often seen as insecure
This commit is contained in:
29
src/ArchPresets/Security.php
Normal file
29
src/ArchPresets/Security.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Pest\ArchPresets;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
final class Security extends AbstractPreset
|
||||
{
|
||||
/**
|
||||
* Executes the arch preset.
|
||||
*/
|
||||
public function execute(): void
|
||||
{
|
||||
$this->expectations[] = expect([
|
||||
'md5',
|
||||
'sha1',
|
||||
'uniqid',
|
||||
'rand',
|
||||
'mt_rand',
|
||||
'tempnam',
|
||||
'str_shuffle',
|
||||
'shuffle',
|
||||
'array_rand'
|
||||
])->not->toBeUsed();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user