diff --git a/src/Adapter/MySQL.php b/src/Adapter/MySQL.php index 6b9c525..4e20906 100644 --- a/src/Adapter/MySQL.php +++ b/src/Adapter/MySQL.php @@ -79,7 +79,7 @@ class MySQL implements AdapterInterface, MigrateInterface, SqlAdapterInterface { $pdo->setAttribute(\PDO::ATTR_EMULATE_PREPARES, false); $pdo->setAttribute(\PDO::ATTR_AUTOCOMMIT, false); $pdo->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC); - $pdo->setAttribute(\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false); + $pdo->setAttribute(\Pdo\Mysql::ATTR_USE_BUFFERED_QUERY, false); } catch(\PDOException $ex){ throw $ex; diff --git a/src/EntityCollection.php b/src/EntityCollection.php index 7e67902..696d722 100644 --- a/src/EntityCollection.php +++ b/src/EntityCollection.php @@ -322,7 +322,7 @@ class EntityCollection extends \ArrayObject implements \JsonSerializable { case is_string($value): $value = (string) $value; - $list[$key] = $item->$value; + $list[(string) $key] = $item->$value; break; } } diff --git a/src/Repository/JoinBuilderTrait.php b/src/Repository/JoinBuilderTrait.php index b7ff4d6..114f655 100644 --- a/src/Repository/JoinBuilderTrait.php +++ b/src/Repository/JoinBuilderTrait.php @@ -30,7 +30,7 @@ trait JoinBuilderTrait $fields = (array) $fields; - usort($fields, fn($e1, $e2) => str_contains($e1, '.') <=> str_contains($e2, '.')); + usort($fields, fn($e1, $e2) => str_contains((string) $e1, '.') <=> str_contains((string) $e2, '.')); # @TODO Apply fff annotation to this too ! foreach(array_filter($fields, fn($e) => $e && ! isset($this->joined[$e]) ) as $item) { @@ -127,7 +127,7 @@ trait JoinBuilderTrait return $this; } - protected function joinFieldObject(mixed $field, string $entityClass, string $alias = null) : \Stringable + protected function joinFieldObject(mixed $field, string $entityClass, ?string $alias = null) : \Stringable { if ( ! is_object($field) ) { return $entityClass::field($field, $alias); @@ -138,7 +138,7 @@ trait JoinBuilderTrait } - protected function joinFieldValue(mixed $value, string $alias = null) : mixed + protected function joinFieldValue(mixed $value, ?string $alias = null) : mixed { if ( $value instanceof EntityField ) { $value = clone $value; @@ -150,4 +150,4 @@ trait JoinBuilderTrait return $value; } -} \ No newline at end of file +}