From 67a82a6734f6723d1f88790224f12b999ae8def2 Mon Sep 17 00:00:00 2001 From: Jan Pecha Date: Wed, 6 Jan 2021 20:36:23 +0100 Subject: [PATCH] Fixed compatibility with PHP 8.0 --- .github/workflows/tests.yml | 2 +- src/Statements/AddForeignKey.php | 2 +- src/Statements/AddIndex.php | 2 +- src/Statements/AlterTable.php | 4 ++-- src/Statements/CreateTable.php | 2 +- src/Statements/ForeignKeyDefinition.php | 2 +- src/Statements/IndexDefinition.php | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 613f08a..50dbc2a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] + php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0'] fail-fast: false diff --git a/src/Statements/AddForeignKey.php b/src/Statements/AddForeignKey.php index e3d44bf..de1394b 100644 --- a/src/Statements/AddForeignKey.php +++ b/src/Statements/AddForeignKey.php @@ -20,7 +20,7 @@ class AddForeignKey implements IStatement * @param string * @param string[]|string */ - public function __construct($name, $columns = [], $targetTable, $targetColumns = []) + public function __construct($name, $columns, $targetTable, $targetColumns) { $this->definition = new ForeignKeyDefinition($name, $columns, $targetTable, $targetColumns); } diff --git a/src/Statements/AddIndex.php b/src/Statements/AddIndex.php index 889742e..37c56fb 100644 --- a/src/Statements/AddIndex.php +++ b/src/Statements/AddIndex.php @@ -18,7 +18,7 @@ class AddIndex implements IStatement * @param string|NULL * @param string */ - public function __construct($name = NULL, $type) + public function __construct($name, $type) { $this->definition = new IndexDefinition($name, $type); } diff --git a/src/Statements/AlterTable.php b/src/Statements/AlterTable.php index f000cdf..c4e85c9 100644 --- a/src/Statements/AlterTable.php +++ b/src/Statements/AlterTable.php @@ -73,7 +73,7 @@ public function modifyColumn($name, $type, array $parameters = NULL, array $opti * @param string * @return AddIndex */ - public function addIndex($name = NULL, $type) + public function addIndex($name, $type) { return $this->statements[] = new AddIndex($name, $type); } @@ -96,7 +96,7 @@ public function dropIndex($index) * @param string[]|string * @return AddForeignKey */ - public function addForeignKey($name, $columns = [], $targetTable, $targetColumns = []) + public function addForeignKey($name, $columns, $targetTable, $targetColumns) { return $this->statements[] = new AddForeignKey($name, $columns, $targetTable, $targetColumns); } diff --git a/src/Statements/CreateTable.php b/src/Statements/CreateTable.php index ef55908..6ed8402 100644 --- a/src/Statements/CreateTable.php +++ b/src/Statements/CreateTable.php @@ -75,7 +75,7 @@ public function addIndex($name, $type) * @param string[]|string * @return ForeignKeyDefinition */ - public function addForeignKey($name, $columns = [], $targetTable, $targetColumns = []) + public function addForeignKey($name, $columns, $targetTable, $targetColumns) { if (isset($this->foreignKeys[$name])) { throw new DuplicateException("Foreign key '$name' already exists."); diff --git a/src/Statements/ForeignKeyDefinition.php b/src/Statements/ForeignKeyDefinition.php index a861107..5630104 100644 --- a/src/Statements/ForeignKeyDefinition.php +++ b/src/Statements/ForeignKeyDefinition.php @@ -40,7 +40,7 @@ class ForeignKeyDefinition implements IStatement * @param string * @param string[]|string */ - public function __construct($name, $columns = [], $targetTable, $targetColumns = []) + public function __construct($name, $columns, $targetTable, $targetColumns) { $this->name = $name; $this->targetTable = $targetTable; diff --git a/src/Statements/IndexDefinition.php b/src/Statements/IndexDefinition.php index 148e407..9a9d62e 100644 --- a/src/Statements/IndexDefinition.php +++ b/src/Statements/IndexDefinition.php @@ -29,7 +29,7 @@ class IndexDefinition implements IStatement * @param string|NULL * @param string */ - public function __construct($name = NULL, $type) + public function __construct($name, $type) { $this->name = $name; $this->setType($type);