Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mathsgod committed Apr 8, 2022
1 parent a3a3eb1 commit 0bcb36b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/DB/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,8 @@
class Schema extends PDO implements LoggerAwareInterface
{
private $logger;
public function __construct(string $database, string $hostname, string $username, string $password = "", string $charset = "utf8", LoggerInterface $logger = null)
public function __construct(string $database, string $hostname, string $username, string $password = "", string $charset = "utf8mb4", int $port = 3306)
{
//PDO::ERRMODE_EXCEPTION;
$this->logger = $logger;

try {
parent::__construct("mysql:dbname={$database};host={$hostname};charset={$charset}", $username, $password, [
Expand All @@ -26,7 +24,6 @@ public function __construct(string $database, string $hostname, string $username
]);
} catch (PDOException $e) {
echo $e->getMessage();
if ($this->logger) $logger->error("SQLSTATE[HY000] [1045] Access denied");
exit();
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/ORM/Query.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?
<?php

namespace R\ORM;

use R\RSList;
use R\ObjectList;
use Traversable;

class Query extends \R\DB\Query
{
Expand All @@ -13,7 +14,7 @@ public function __construct(string $class)
parent::__construct($class::__db(), $class::_table());
}

public function getIterator()
public function getIterator(): Traversable
{
$iterator = parent::getIterator();
if ($this->select) {
Expand Down

0 comments on commit 0bcb36b

Please sign in to comment.