Skip to content

Bug: incorrect type - system/Database/MYSQLi/Connection.php #2996

Description

@John-Betong

Build: ace3f2c - Thursday May 14th, 2020

Over 420 files have the following declaration added:

<?php DECLARE(STRICT_TYPES=1); ?>

There is only a single file remaining which prevents STRICT_TYPES validation.

file: ./system/Database/MYSQLi/Connection.php
`
public function connect(bool $persistent = false)
{
// Do we have a socket path?
if ($this->hostname[0] === '/')
{
$hostname = null;
$port = null;
$socket = $this->hostname;
}
else
{
$hostname = ($persistent === true) ? 'p:' . $this->hostname : $this->hostname;
$port = empty($this->port) ? null : $this->port;
// OLD
$socket = null;
// NEW
$socket = (string) null; // JOHN ADDED (string)
}

`

Online demo: https://ci4-strict.tk

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementPRs that improve existing functionalities

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions