feature(presets): Add security preset

Looks for functions often seen as insecure
This commit is contained in:
Clara
2024-06-10 11:35:03 +10:00
committed by LaraClara
parent d665b53b22
commit 7b8e4aec08
3 changed files with 40 additions and 0 deletions

View 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();
}
}