findPatternMatchesInPhpFiles('core', '/\bopenssl_encrypt\s*\(/'), $this->findPatternMatchesInPhpFiles('pages', '/\bopenssl_encrypt\s*\(/') ); $violations = array_values(array_filter( $violations, static fn (string $path): bool => $path !== self::CRYPTO_FILE )); $this->assertSame( [], $violations, "Raw openssl_encrypt() found outside Crypto.php (GR-SEC-005):\n" . implode("\n", $violations) ); } public function testNoRawOpensslDecryptOutsideCrypto(): void { $violations = array_merge( $this->findPatternMatchesInPhpFiles('core', '/\bopenssl_decrypt\s*\(/'), $this->findPatternMatchesInPhpFiles('pages', '/\bopenssl_decrypt\s*\(/') ); $violations = array_values(array_filter( $violations, static fn (string $path): bool => $path !== self::CRYPTO_FILE )); $this->assertSame( [], $violations, "Raw openssl_decrypt() found outside Crypto.php (GR-SEC-005):\n" . implode("\n", $violations) ); } }