Skip to content

Commit

Permalink
Ignoring specific CUSIPs now.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldrennen committed Apr 11, 2024
1 parent b993cb3 commit 3ec9828
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/CUSIP.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ class CUSIP {

const SEDOL_WEIGHT = [ 1, 3, 1, 7, 3, 9, 1 ];

/**
* @var array|string[] These are technically valid CUSIPs, but not assigned and are causing issues in parsers that rely on this library.
*/
public static array $cusipsToIgnore = [
'240000000',
];

/**
* @param $string
*
Expand Down Expand Up @@ -97,6 +104,10 @@ public static function isCUSIP( $cusip = NULL ) {
return FALSE;
}

if ( in_array( $cusip, self::$cusipsToIgnore ) ) {
return FALSE;
}

$checksumDigit = CUSIP::getChecksumDigit( $cusip );
// If the last character of the cusip is equal to the checksum digit, then it validates.
if ( substr( $cusip,
Expand Down

0 comments on commit 3ec9828

Please sign in to comment.