Skip to content

Commit

Permalink
Add #[\SensitiveParameter] attribute to CreditCard
Browse files Browse the repository at this point in the history
Credit Card numbers are generally considered to be sensitive.

Signed-off-by: Tim Düsterhus <[email protected]>
  • Loading branch information
TimWolla committed Dec 13, 2022
1 parent 69e22f6 commit 506e992
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/CreditCard.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Exception;
use Laminas\Stdlib\ArrayUtils;
use Laminas\Validator\Exception\InvalidArgumentException;
use SensitiveParameter;
use Traversable;

use function array_key_exists;
Expand Down Expand Up @@ -361,8 +362,10 @@ public function setService($service)
* @param string $value
* @return bool
*/
public function isValid($value)
{
public function isValid(
#[SensitiveParameter]
$value
) {
$this->setValue($value);

if (! is_string($value)) {
Expand Down

0 comments on commit 506e992

Please sign in to comment.