Skip to content

Commit

Permalink
Fix #19328: Passing null to parameter #1 ($string) of type string is …
Browse files Browse the repository at this point in the history
…deprecated in `yii\db\oci\Schema`

Co-authored-by: Kevin Desmettre <kdesmettre@oph74.fr>
  • Loading branch information
Arkeins and kdesmettreoph74 committed Apr 6, 2022
1 parent 10f6045 commit 9f6d24d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Yii Framework 2 Change Log
- Enh #19309: Optimize `yii\base\Model::attributes()` (WinterSilence)
- Bug #19322: Revert force setting value to empty string in case it's `null` in `yii\validators\FilterValidator::validateAttribute()` (bizley)
- Bug #19329: Fix `yii\web\GroupUrlRule` to properly normalize prefix (bizley)
- Bug #19328: Passing null to parameter #1 ($string) of type string is deprecated in `yii\db\oci\Schema` (Arkeins)


2.0.45 February 11, 2022
Expand Down
8 changes: 4 additions & 4 deletions framework/db/oci/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ protected function createColumn($column)
$c->phpType = $this->getColumnPhpType($c);

if (!$c->isPrimaryKey) {
if (stripos($column['DATA_DEFAULT'], 'timestamp') !== false) {
if (stripos((string) $column['DATA_DEFAULT'], 'timestamp') !== false) {
$c->defaultValue = null;
} else {
$defaultValue = $column['DATA_DEFAULT'];
Expand Down Expand Up @@ -594,9 +594,9 @@ protected function extractColumnType($column, $dbType, $precision, $scale, $leng
*/
protected function extractColumnSize($column, $dbType, $precision, $scale, $length)
{
$column->size = trim($length) === '' ? null : (int) $length;
$column->precision = trim($precision) === '' ? null : (int) $precision;
$column->scale = trim($scale) === '' ? null : (int) $scale;
$column->size = trim((string) $length) === '' ? null : (int) $length;
$column->precision = trim((string) $precision) === '' ? null : (int) $precision;
$column->scale = trim((string) $scale) === '' ? null : (int) $scale;
}

/**
Expand Down

0 comments on commit 9f6d24d

Please sign in to comment.