mirror of
https://github.com/standardebooks/web.git
synced 2025-07-22 15:24:46 -04:00
Add type checks
This commit is contained in:
parent
84bce1c17a
commit
ad89a4af45
6 changed files with 52 additions and 16 deletions
|
@ -18,6 +18,7 @@ use Facebook\WebDriver\Firefox\FirefoxOptions;
|
|||
|
||||
use Safe\DateTimeImmutable;
|
||||
use function Safe\file_get_contents;
|
||||
use function Safe\file_put_contents;
|
||||
use function Safe\preg_replace;
|
||||
use function Safe\putenv;
|
||||
use function Safe\set_time_limit;
|
||||
|
@ -51,7 +52,7 @@ $faItemsPerPage = 20; // How many items are on a full page of FA results?
|
|||
// General plan: Read /tmp/last-fa-donation to see what the last transaction ID was that we processed.
|
||||
// If /tmp/last-fa-donation doesn't exist, get all transactions from today and create the file.
|
||||
|
||||
function InsertTransaction($transactionId){
|
||||
function InsertTransaction(string $transactionId): bool{
|
||||
$exists = Db::QueryInt('SELECT exists(
|
||||
select *
|
||||
from
|
||||
|
@ -151,7 +152,7 @@ try{
|
|||
|
||||
$transactionId = trim($td->getDomProperty('textContent'));
|
||||
|
||||
if($transactionId === null){
|
||||
if($transactionId === ''){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -173,7 +174,7 @@ try{
|
|||
|
||||
$transactionId = trim($td->getDomProperty('textContent'));
|
||||
|
||||
if($transactionId === null){
|
||||
if($transactionId === ''){
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -215,6 +216,6 @@ catch(Exception $ex){
|
|||
throw $ex;
|
||||
}
|
||||
finally{
|
||||
$driver->quit();
|
||||
$driver?->quit();
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue