Skip to content
Open
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
8 changes: 4 additions & 4 deletions system/Database/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function load(array $params = [], string $alias = '')
throw new InvalidArgumentException('You have not selected a database type to connect to.');
}

assert($this->checkDbExtension($params['DBDriver']));
$this->checkDbExtension($params['DBDriver']);

$this->connections[$alias] = $this->initDriver($params['DBDriver'], 'Connection', $params);

Expand Down Expand Up @@ -158,11 +158,11 @@ protected function initDriver(string $driver, string $class, $argument): object
*
* @param string $driver DB driver or FQCN for custom driver
*/
private function checkDbExtension(string $driver): bool
private function checkDbExtension(string $driver): void
{
if (str_contains($driver, '\\')) {
// Cannot check a fully qualified classname for a custom driver.
return true;
return;
}

$extensionMap = [
Expand All @@ -183,7 +183,7 @@ private function checkDbExtension(string $driver): bool
}

if (extension_loaded($extension)) {
return true;
return;
}

$message = 'The required PHP extension "' . $extension . '" is not loaded.'
Expand Down
2 changes: 1 addition & 1 deletion system/HTTP/Files/FileCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ protected function createFileObject(array $array)

return new UploadedFile(
$array['tmp_name'] ?? null,
$array['name'] ?? null,
$array['name'],
$array['type'] ?? null,
($array['size'] ?? null) === null ? null : (int) $array['size'],
$array['error'] ?? null,
Expand Down
2 changes: 1 addition & 1 deletion system/HTTP/SiteURIFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private function createURIFromRoutePath(string $routePath): SiteURI
*/
private function getHost(): ?string
{
$httpHostPort = $this->superglobals->server('HTTP_HOST') ?? null;
$httpHostPort = $this->superglobals->server('HTTP_HOST');

if ($httpHostPort !== null) {
[$httpHost] = explode(':', $httpHostPort, 2);
Expand Down
2 changes: 1 addition & 1 deletion system/Helpers/Array/ArrayHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public static function recursiveCount(array $array, int $counter = 0): int
* @param list<int|list<int|string>|string> $array
* @param int|string|null $sortByIndex
*/
public static function sortValuesByNatural(array &$array, $sortByIndex = null): bool
public static function sortValuesByNatural(array &$array, $sortByIndex = null): true
{
return usort($array, static function ($currentValue, $nextValue) use ($sortByIndex): int {
if ($sortByIndex !== null) {
Expand Down
2 changes: 1 addition & 1 deletion system/Router/RouteCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1520,7 +1520,7 @@ private function checkSubdomains($subdomains): bool

// Routes can be limited to any sub-domain. In that case, though,
// it does require a sub-domain to be present.
if (! in_array($this->currentSubdomain, [null, ''], true) && in_array('*', $subdomains, true)) {
if ($this->currentSubdomain !== '' && in_array('*', $subdomains, true)) {
return true;
}

Expand Down
Loading