PHP code example of lvmorales1 / privacy-scanner
1. Go to this page and download the library: Download lvmorales1/privacy-scanner library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lvmorales1 / privacy-scanner example snippets
final class MyTokenRule extends AbstractRule
{
public function getName(): string { return 'My Token'; }
public function getCategory(): string { return 'my_token'; }
public function getRiskScore(): int { return 8; }
protected function getType(): FindingType { return FindingType::Secret; }
protected function getPattern(): string { return '/mytoken_[A-Za-z0-9]{32}/'; }
}
bash
php bin/privacy-scan .
php bin/privacy-scan config/services.php
php bin/privacy-scan . --format=json