diff --git a/config/phpstan/phpstan.neon b/config/phpstan/phpstan.neon index 35b1d6b8..2c10994b 100644 --- a/config/phpstan/phpstan.neon +++ b/config/phpstan/phpstan.neon @@ -5,6 +5,9 @@ includes: parameters: level: 9 + checkFunctionNameCase: true + checkInternalClassCaseSensitivity: true + checkTooWideReturnTypesInProtectedAndPublicMethods: true ignoreErrors: # Ignore errors caused by `Template` static class reflection. diff --git a/lib/AtomFeed.php b/lib/AtomFeed.php index e7dc212b..69318480 100644 --- a/lib/AtomFeed.php +++ b/lib/AtomFeed.php @@ -53,7 +53,7 @@ class AtomFeed extends Feed{ $currentEntries = []; foreach($this->Entries as $entry){ - $obj = new StdClass(); + $obj = new stdClass(); if($entry instanceof Ebook){ if($entry->EbookUpdated !== null){ $obj->Updated = $entry->EbookUpdated->format(Enums\DateTimeFormat::Iso->value); @@ -75,7 +75,7 @@ class AtomFeed extends Feed{ $xml = new SimpleXMLElement(str_replace('xmlns=', 'ns=', file_get_contents($path))); foreach($xml->xpath('/feed/entry') ?: [] as $entry){ - $obj = new StdClass(); + $obj = new stdClass(); $obj->Updated = $entry->updated; $obj->Id = $entry->id; $oldEntries[] = $obj; diff --git a/lib/Db.php b/lib/Db.php index 7859e6d8..b6b5d3cf 100644 --- a/lib/Db.php +++ b/lib/Db.php @@ -315,7 +315,7 @@ class Db{ * @param string $sql The SQL query to execute. * @param array $params An array of parameters to bind to the SQL statement. * - * @return \PdoStatement The `\PDOStatement` to be used to execute the query. + * @return \PDOStatement The `\PDOStatement` to be used to execute the query. * * @throws Exceptions\DatabaseQueryException When an error occurs during execution of the query. */ @@ -360,7 +360,7 @@ class Db{ * * @template T * - * @param \PdoStatement $handle The PDO handle to execute. + * @param \PDOStatement $handle The PDO handle to execute. * @param class-string $class The type of object to return in the return array. * * @return array An array of objects of type `$class`, or `stdClass` if `$class` is `null`. @@ -440,7 +440,7 @@ class Db{ * * @template T * - * @param \PdoStatement $handle The PDO handle to execute. + * @param \PDOStatement $handle The PDO handle to execute. * @param class-string $class The class to instantiate for each row, or `stdClass` to return an array of rows. * * @return array|array> An array of `$class` if `$class` is not `stdClass`, otherwise an array of rows of the form `["LeftTableName" => $stdClass, "RightTableName" => $stdClass]`. diff --git a/lib/Email.php b/lib/Email.php index b8829431..24080972 100644 --- a/lib/Email.php +++ b/lib/Email.php @@ -40,25 +40,25 @@ class Email{ $phpMailer = new PHPMailer(true); try{ - $phpMailer->SetFrom($this->From, $this->FromName); - $phpMailer->AddReplyTo($this->ReplyTo); - $phpMailer->AddAddress($this->To, $this->ToName); + $phpMailer->setFrom($this->From, $this->FromName); + $phpMailer->addReplyTo($this->ReplyTo); + $phpMailer->addAddress($this->To, $this->ToName); $phpMailer->Subject = $this->Subject; $phpMailer->CharSet = 'UTF-8'; if($this->TextBody != ''){ - $phpMailer->IsHTML(true); + $phpMailer->isHTML(true); $phpMailer->Body = $this->Body; $phpMailer->AltBody = $this->TextBody; } else{ - $phpMailer->MsgHTML($this->Body); + $phpMailer->msgHTML($this->Body); } foreach($this->Attachments as $attachment){ $phpMailer->addStringAttachment($attachment['contents'], $attachment['filename']); } - $phpMailer->IsSMTP(); + $phpMailer->isSMTP(); $phpMailer->SMTPAuth = true; $phpMailer->SMTPSecure = 'tls'; $phpMailer->Port = 587; @@ -78,7 +78,7 @@ class Email{ $log->Write($this->TextBody); } else{ - $phpMailer->Send(); + $phpMailer->send(); } } catch(Exception $ex){ diff --git a/lib/RssFeed.php b/lib/RssFeed.php index fd4607a4..e4420487 100644 --- a/lib/RssFeed.php +++ b/lib/RssFeed.php @@ -45,7 +45,7 @@ class RssFeed extends Feed{ $currentEntries = []; foreach($this->Entries as $entry){ /** @var Ebook $entry */ - $obj = new StdClass(); + $obj = new stdClass(); $obj->Size = (string)filesize(WEB_ROOT . $entry->EpubUrl); $obj->Id = preg_replace('/^url:/ius', '', $entry->Identifier); $currentEntries[] = $obj; @@ -56,7 +56,7 @@ class RssFeed extends Feed{ $xml = new SimpleXMLElement(str_replace('xmlns=', 'ns=', file_get_contents($path))); $xml->registerXPathNamespace('atom', 'http://www.w3.org/2005/Atom'); foreach($xml->xpath('/rss/channel/item') ?: [] as $entry){ - $obj = new StdClass(); + $obj = new stdClass(); foreach($entry->xpath('enclosure') ?: [] as $enclosure){ $obj->Size = (string)$enclosure['length']; } diff --git a/scripts/ingest-fa-payments b/scripts/ingest-fa-payments index 882841fa..49f900a8 100755 --- a/scripts/ingest-fa-payments +++ b/scripts/ingest-fa-payments @@ -116,7 +116,7 @@ try{ // Check if we need to log in to FA. // Wait until the element is visible, then check the current URL. $driver->wait(20, 250)->until(WebDriverExpectedCondition::visibilityOfElementLocated(WebDriverBy::xpath('/html/body'))); - if(stripos($driver->getCurrentUrl(), 'auth0.com')){ + if(stripos($driver->getCurrentURL(), 'auth0.com')){ $log->Write('Logging in to Fractured Atlas ...'); // We were redirected to the login page, so try to log in. diff --git a/scripts/process-pending-payments b/scripts/process-pending-payments index c596cb77..039f7dd4 100755 --- a/scripts/process-pending-payments +++ b/scripts/process-pending-payments @@ -91,7 +91,7 @@ try{ // Check if we need to log in to FA. // Wait until the element is visible, then check the current URL. $driver->wait(20, 250)->until(WebDriverExpectedCondition::visibilityOfElementLocated(WebDriverBy::xpath('/html/body'))); - if(stripos($driver->getCurrentUrl(), 'auth0.com')){ + if(stripos($driver->getCurrentURL(), 'auth0.com')){ $log->Write('Logging in to Fractured Atlas ...'); // We were redirected to the login page, so try to log in. diff --git a/www/users/get.php b/www/users/get.php index c2e04306..0f2640bb 100644 --- a/www/users/get.php +++ b/www/users/get.php @@ -76,7 +76,7 @@ catch(Exceptions\InvalidPermissionsException){ Created: - Created->Format(Enums\DateTimeFormat::FullDateTime->value) ?> + Created->format(Enums\DateTimeFormat::FullDateTime->value) ?> @@ -219,7 +219,7 @@ catch(Exceptions\InvalidPermissionsException){ Payments as $payment){ ?> - + IsRecurring){ ?>