public static function getPDO($dsn, $username, $password, $settings = ['attributes' => []])
    {
        // if not set self pdo object property or pdo set as null
        if (!isset(self::$PDO) || (self::$PDO !== null)) {
            self::$PDO = new self($dsn, $username, $password, $settings); // set class pdo property with new connection
        }

        // return class property object
        return self::$PDO;
    }
public static function getPDO($dsn, $username, $password, $settings = ['attributes' => []])
    {
        // if not set self pdo object property or pdo set as null
        if (!isset(self::$PDO) || (self::$PDO !== null)) {
            self::$PDO = new self($dsn, $username, $password, $settings); // set class pdo property with new connection
        }

        // return class property object
        return self::$PDO;
    }
public static function getPDO ( $ dsn , $ username , $ password , $ settings = [ 'attributes' => [ ] ] ) { // if not set self pdo object property or pdo set as null if ( ! isset ( self :: $ PDO ) || ( self :: $ PDO !== null ) ) { self :: $ PDO = new self ( $ dsn , $ username , $ password , $ settings ) ; // set class pdo property with new connection } // return class property object return self :: $ PDO ; }
Get Instance of PDO Class as Singleton Pattern.

@param array|string $dsn
@param              $username
@param              $password
@param array        $settings

@return PdoWrapper|object
Get Instance of PDO Class as Singleton Pattern .