Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/workflows/bc.yml_
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.1']
['8.4']
4 changes: 3 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
strategy:
matrix:
php:
- 8.3
- 8.4

oracle:
- 18
Expand All @@ -46,6 +46,8 @@ jobs:
oracle: 21
- php: 8.2
oracle: 21
- php: 8.3
oracle: 21

services:
oci:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/composer-require-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- 8.1
- 8.2
- 8.3
- 8.4

steps:
- name: Checkout.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mutation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- ubuntu-latest

php:
- 8.3
- 8.4

services:
oci:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
os: >-
['ubuntu-latest']
php: >-
['8.3']
['8.4']
7 changes: 4 additions & 3 deletions .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ jobs:
- ubuntu-latest

php:
- '8.1'
- '8.2'
- '8.3'
- 8.1
- 8.2
- 8.3
- 8.4

steps:
- name: Checkout.
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
- New #301: Add `IndexType` class (@Tigrov)
- New #303: Support JSON type (@Tigrov)
- Bug #305: Explicitly mark nullable parameters (@vjik)
- Chg #306: Change supported PHP versions to `8.1 - 8.4` (@Tigrov)
- Enh #306: Minor refactoring (@Tigrov)
- New #307: Add parameters `$ifExists` and `$cascade` to `CommandInterface::dropTable()` and
`DDLQueryBuilderInterface::dropTable()` methods (@vjik)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ your Oracle database and perform various database operations as needed.

| PHP | Oracle Version | CI-Actions |
|---------------|----------------|------------|
| **8.1 - 8.3** | **12c - 21c**|[![build](https://github.com/yiisoft/db-oracle/actions/workflows/build.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-oracle/actions/workflows/build.yml) [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fdb-oracle%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/db-oracle/master) [![static analysis](https://github.com/yiisoft/db-oracle/actions/workflows/static.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-oracle/actions/workflows/static.yml) [![type-coverage](https://shepherd.dev/github/yiisoft/db-oracle/coverage.svg)](https://shepherd.dev/github/yiisoft/db-oracle)
| **8.1 - 8.4** | **12c - 21c**|[![build](https://github.com/yiisoft/db-oracle/actions/workflows/build.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-oracle/actions/workflows/build.yml) [![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fyiisoft%2Fdb-oracle%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/yiisoft/db-oracle/master) [![static analysis](https://github.com/yiisoft/db-oracle/actions/workflows/static.yml/badge.svg?branch=dev)](https://github.com/yiisoft/db-oracle/actions/workflows/static.yml) [![type-coverage](https://shepherd.dev/github/yiisoft/db-oracle/coverage.svg)](https://shepherd.dev/github/yiisoft/db-oracle)

## Installation

Expand Down
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@
],
"require": {
"ext-pdo": "*",
"php": "^8.1",
"php": "8.1 - 8.4",
"yiisoft/db": "dev-master"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.2",
"phpunit/phpunit": "^10.0",
"rector/rector": "^2.0",
"roave/infection-static-analysis-plugin": "^1.16",
"spatie/phpunit-watcher": "^1.23",
"vimeo/psalm": "^5.25",
"vlucas/phpdotenv": "^5.6",
"maglnet/composer-require-checker": "^4.7.1",
"phpunit/phpunit": "^10.5.45",
"rector/rector": "^2.0.10",
"roave/infection-static-analysis-plugin": "^1.35",
"spatie/phpunit-watcher": "^1.24",
"vimeo/psalm": "^5.26.1 || ^6.8.8",
"vlucas/phpdotenv": "^5.6.1",
"yiisoft/aliases": "^2.0",
"yiisoft/cache-file": "^3.1",
"yiisoft/var-dumper": "^1.5"
"yiisoft/cache-file": "^3.2",
"yiisoft/var-dumper": "^1.7"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<?xml version="1.0"?>
<psalm
errorLevel="1"
ensureOverrideAttribute="false"
findUnusedBaselineEntry="true"
findUnusedCode="false"
resolveFromConfigFile="true"
strictBinaryOperands="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
Expand Down
4 changes: 3 additions & 1 deletion src/Column/ColumnDefinitionParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ public function parse(string $definition): array
{
preg_match(self::TYPE_PATTERN, $definition, $matches);

$type = strtolower(preg_replace('/\s*\(\d+\)/', '', $matches[4] ?? $matches[1]));
/** @var string $type */
$type = preg_replace('/\s*\(\d+\)/', '', $matches[4] ?? $matches[1]);
$type = strtolower($type);
$info = ['type' => $type];

$typeDetails = $matches[6] ?? $matches[2] ?? '';
Expand Down
4 changes: 3 additions & 1 deletion src/Column/JsonColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ public function phpTypecast(mixed $value): mixed
}

if (is_resource($value)) {
return json_decode(stream_get_contents($value), true, 512, JSON_THROW_ON_ERROR);
/** @var string */
$value = stream_get_contents($value);
return json_decode($value, true, 512, JSON_THROW_ON_ERROR);
}

return $value;
Expand Down
2 changes: 1 addition & 1 deletion src/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
final class Command extends AbstractPdoCommand
{
public function insertWithReturningPks(string $table, array $columns): bool|array
public function insertWithReturningPks(string $table, array $columns): array|false
{
$tableSchema = $this->db->getSchema()->getTableSchema($table);
$returnColumns = $tableSchema?->getPrimaryKey() ?? [];
Expand Down
4 changes: 3 additions & 1 deletion src/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,9 @@ protected function getTableSequenceName(string $tableName): string|null
*/
private function loadColumn(array $info): ColumnInterface
{
$dbType = strtolower(preg_replace('/\([^)]+\)/', '', $info['data_type']));
/** @var string $dbType */
$dbType = preg_replace('/\([^)]+\)/', '', $info['data_type']);
$dbType = strtolower($dbType);

match ($dbType) {
'timestamp',
Expand Down
8 changes: 4 additions & 4 deletions tests/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,12 +228,12 @@ public function testCreateView(): void
)->execute();
$command->setSql(
<<<SQL
INSERT INTO [[testCreateViewTable]] ("id", "bar") VALUES(testCreateTable_SEQ.NEXTVAL, 1)
INSERT INTO [[testCreateViewTable]] ("id", "bar") VALUES(testCreateViewTable_SEQ.NEXTVAL, 1)
SQL,
)->execute();
$command->setSql(
<<<SQL
INSERT INTO [[testCreateViewTable]] ("id", "bar") VALUES(testCreateTable_SEQ.NEXTVAL, 6)
INSERT INTO [[testCreateViewTable]] ("id", "bar") VALUES(testCreateViewTable_SEQ.NEXTVAL, 6)
SQL,
)->execute();
$command->createView('{{testCreateView}}', $subquery)->execute();
Expand Down Expand Up @@ -640,12 +640,12 @@ public function testQueryScalarWithBlob(): void
$this->assertEquals($value, $scalarValue);
}

public function testProfiler(string $sql = null): void
public function testProfiler(string|null $sql = null): void
{
parent::testProfiler('SELECT 123 FROM DUAL');
}

public function testProfilerData(string $sql = null): void
public function testProfilerData(string|null $sql = null): void
{
parent::testProfilerData('SELECT 123 FROM DUAL');
}
Expand Down
2 changes: 1 addition & 1 deletion tests/QuoterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function testQuoteColumnName(string $columnName, string $expected): void
public function testQuoteSimpleColumnName(
string $columnName,
string $expectedQuotedColumnName,
string $expectedUnQuotedColumnName = null
string|null $expectedUnQuotedColumnName = null
): void {
parent::testQuoteSimpleColumnName($columnName, $expectedQuotedColumnName, $expectedUnQuotedColumnName);
}
Expand Down
Loading