Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion application/forms/Jobs/JobConfigForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class JobConfigForm extends CompatForm
/** @var ?X509Job */
protected $job;

public function __construct(X509Job $job = null)
public function __construct(?X509Job $job = null)
{
$this->job = $job;

Expand Down
2 changes: 1 addition & 1 deletion application/forms/Jobs/ScheduleForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ScheduleForm extends CompatForm
/** @var ScheduleElement */
protected $scheduleElement;

public function __construct(X509Schedule $schedule = null)
public function __construct(?X509Schedule $schedule = null)
{
$this->schedule = $schedule;

Expand Down
10 changes: 9 additions & 1 deletion library/X509/Common/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,15 @@ private static function getDb(): Sql\Connection

$options = [PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ];
if ($config->db === 'mysql') {
$options[PDO::MYSQL_ATTR_INIT_COMMAND] = "SET SESSION SQL_MODE='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE"
// In PHP 8.5+, driver-specific constants of the PDO class are deprecated,
// but the replacements are only available since php 8.4
if (version_compare(PHP_VERSION, '8.4.0', '<')) {
$mysqlAttrInitCommand = PDO::MYSQL_ATTR_INIT_COMMAND;
} else {
$mysqlAttrInitCommand = Pdo\Mysql::ATTR_INIT_COMMAND;
}

$options[$mysqlAttrInitCommand] = "SET SESSION SQL_MODE='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE"
. ",NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'";
}

Expand Down
4 changes: 2 additions & 2 deletions library/X509/Hook/SniHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ public static function getAll()
/**
* Aggregate pairs of ip => hostname
*
* @param Filter $filter
* @param ?Filter $filter
*
* @return \Generator
*/
abstract public function getHosts(Filter $filter = null);
abstract public function getHosts(?Filter $filter = null);
}
2 changes: 1 addition & 1 deletion library/X509/Job.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Job implements Task
* @param array<string, array<string>> $snimap The configured SNI maps to be used by this job
* @param ?Schedule $schedule
*/
public function __construct(string $name, array $cidrs, array $ports, array $snimap, Schedule $schedule = null)
public function __construct(string $name, array $cidrs, array $ports, array $snimap, ?Schedule $schedule = null)
{
$this->name = $name;
$this->db = Database::get();
Expand Down
59 changes: 36 additions & 23 deletions phpstan-baseline-8x.neon
Original file line number Diff line number Diff line change
@@ -1,96 +1,109 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$certificate of function openssl_x509_read expects OpenSSLCertificate\\|string, mixed given\\.$#"
message: '#^Parameter \#1 \$certificate of function openssl_x509_read expects OpenSSLCertificate\|string, mixed given\.$#'
identifier: argument.type
count: 1
path: application/clicommands/ImportCommand.php

-
message: "#^Parameter \\#1 \\$certificate of function openssl_x509_parse expects OpenSSLCertificate\\|string, mixed given\\.$#"
message: '#^Parameter \#1 \$certificate of function openssl_x509_parse expects OpenSSLCertificate\|string, mixed given\.$#'
identifier: argument.type
count: 1
path: library/X509/CertificateDetails.php

-
message: "#^Parameter \\#1 \\$string of function bin2hex expects string, mixed given\\.$#"
message: '#^Parameter \#1 \$string of function bin2hex expects string, mixed given\.$#'
identifier: argument.type
count: 2
path: library/X509/CertificateDetails.php

-
message: "#^Parameter \\#2 \\$array of function implode expects array\\|null, array\\<int, string\\>\\|false given\\.$#"
count: 1
path: library/X509/CertificateDetails.php

-
message: "#^Parameter \\#1 \\$certificate of function openssl_x509_export expects OpenSSLCertificate\\|string, mixed given\\.$#"
message: '#^Parameter \#1 \$certificate of function openssl_x509_export expects OpenSSLCertificate\|string, mixed given\.$#'
identifier: argument.type
count: 1
path: library/X509/CertificateUtils.php

-
message: "#^Parameter \\#1 \\$certificate of function openssl_x509_fingerprint expects OpenSSLCertificate\\|string, mixed given\\.$#"
message: '#^Parameter \#1 \$certificate of function openssl_x509_fingerprint expects OpenSSLCertificate\|string, mixed given\.$#'
identifier: argument.type
count: 1
path: library/X509/CertificateUtils.php

-
message: "#^Parameter \\#1 \\$certificate of function openssl_x509_parse expects OpenSSLCertificate\\|string, mixed given\\.$#"
message: '#^Parameter \#1 \$certificate of function openssl_x509_parse expects OpenSSLCertificate\|string, mixed given\.$#'
identifier: argument.type
count: 1
path: library/X509/CertificateUtils.php

-
message: "#^Parameter \\#1 \\$key of function openssl_pkey_get_details expects OpenSSLAsymmetricKey, OpenSSLAsymmetricKey\\|false given\\.$#"
message: '#^Parameter \#1 \$key of function openssl_pkey_get_details expects OpenSSLAsymmetricKey, OpenSSLAsymmetricKey\|false given\.$#'
identifier: argument.type
count: 1
path: library/X509/CertificateUtils.php

-
message: "#^Parameter \\#1 \\$public_key of function openssl_pkey_get_public expects array\\|OpenSSLAsymmetricKey\\|OpenSSLCertificate\\|string, mixed given\\.$#"
message: '#^Parameter \#1 \$public_key of function openssl_pkey_get_public expects array\|OpenSSLAsymmetricKey\|OpenSSLCertificate\|string, mixed given\.$#'
identifier: argument.type
count: 1
path: library/X509/CertificateUtils.php

-
message: "#^Parameter \\#2 \\$string of function explode expects string, string\\|false given\\.$#"
message: '#^Parameter \#2 \$string of function explode expects string, string\|false given\.$#'
identifier: argument.type
count: 1
path: library/X509/CertificateUtils.php

-
message: "#^Parameter \\#1 \\$num1 of function gmp_add expects GMP\\|int\\|string, GMP\\|null given\\.$#"
message: '#^Parameter \#1 \$num1 of function gmp_add expects GMP\|int\|string, GMP\|null given\.$#'
identifier: argument.type
count: 1
path: library/X509/Job.php

-
message: "#^Parameter \\#1 \\$num1 of function gmp_and expects GMP\\|int\\|string, GMP\\|null given\\.$#"
message: '#^Parameter \#1 \$num1 of function gmp_and expects GMP\|int\|string, GMP\|null given\.$#'
identifier: argument.type
count: 1
path: library/X509/Job.php

-
message: "#^Parameter \\#1 \\$string of function str_pad expects string, string\\|false given\\.$#"
message: '#^Parameter \#1 \$string of function str_pad expects string, string\|false given\.$#'
identifier: argument.type
count: 1
path: library/X509/Job.php

-
message: "#^Parameter \\#1 \\$string of function base64_encode expects string, mixed given\\.$#"
message: '#^Parameter \#1 \$string of function base64_encode expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: library/X509/Model/Behavior/DERBase64.php

-
message: "#^Parameter \\#2 \\$string of function explode expects string, mixed given\\.$#"
message: '#^Parameter \#2 \$string of function explode expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: library/X509/Model/Behavior/DERBase64.php

-
message: "#^Parameter \\#1 \\$ip of function inet_ntop expects string, mixed given\\.$#"
message: '#^Parameter \#1 \$ip of function inet_ntop expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: library/X509/Model/Behavior/Ip.php

-
message: "#^Parameter \\#1 \\$ip of function inet_pton expects string, mixed given\\.$#"
message: '#^Parameter \#1 \$ip of function inet_pton expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: library/X509/Model/Behavior/Ip.php

-
message: "#^Parameter \\#1 \\$string of function ltrim expects string, mixed given\\.$#"
message: '#^Parameter \#1 \$string of function ltrim expects string, mixed given\.$#'
identifier: argument.type
count: 1
path: library/X509/Model/Behavior/Ip.php

-
message: "#^Parameter \\#1 \\$string of function str_pad expects string, string\\|false given\\.$#"
message: '#^Parameter \#1 \$string of function str_pad expects string, string\|false given\.$#'
identifier: argument.type
count: 1
path: library/X509/Model/Behavior/Ip.php
Loading