Skip to content

Commit

Permalink
ADDED: Support for PHP 8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiang committed Nov 28, 2022
1 parent b2203ff commit 0520764
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 138 deletions.
71 changes: 37 additions & 34 deletions .github/workflows/unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Unit Tests
on:
push:
branches:
- '*'
- "*"
pull_request:
- '*'
- "*"

jobs:
unittest:
Expand All @@ -15,39 +15,42 @@ jobs:
matrix:
# operating-system: [ubuntu-latest, windows-latest, macOS-latest]
php:
- version: '7.4'
composer-args: ''
- version: '8.0'
composer-args: ''
- version: '8.1'
composer-args: '--ignore-platform-req=php'
prefer-lowest: ['', '--prefer-lowest']
- version: "7.4"
composer-args: ""
- version: "8.0"
composer-args: ""
- version: "8.1"
composer-args: "--ignore-platform-req=php"
- version: "8.2"
composer-args: "--ignore-platform-req=php"
prefer-lowest: ["", "--prefer-lowest"]

name: Unit Tests - PHP ${{ matrix.php.version }} ${{ matrix.prefer-lowest }}

steps:
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php.version }}
# extensions: intl #optional
# ini-values: "post_max_size=256M" #optional

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer update --prefer-dist --no-progress ${{ matrix.prefer-lowest }} ${{ matrix.php.composer-args }}

- name: Run test suite
run: composer run-script test
- uses: actions/checkout@v2

- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php.version }}
# extensions: intl #optional
# ini-values: "post_max_size=256M" #optional

- name: Validate composer.json and composer.lock
run: composer validate --strict

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer update --prefer-dist --no-progress ${{ matrix.prefer-lowest }} ${{ matrix.php.composer-args }}

- name: Run test suite
run: composer run-script test
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
}
},
"require": {
"php": "^7.4 || ~8.0.0 || ~8.1.0",
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0",
"doctrine/orm": "^2.11",
"doctrine/dbal": "^3.1.2"
},
Expand All @@ -51,4 +51,4 @@
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
}
8 changes: 4 additions & 4 deletions src/LiquibaseDOMDocumentOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function createChangeSet(string $id): DOMElement
$changeSet->setAttribute(
'id',
$this->options->isChangeSetUniqueId()
? $sanitizedId . '-' . uniqid() : $sanitizedId
? $sanitizedId . '-' . uniqid() : $sanitizedId
);
$this->root->appendChild($changeSet);
return $changeSet;
Expand Down Expand Up @@ -231,14 +231,14 @@ protected function fillColumnAttributes(DOMElement $columnElt, Column $column, I
$unique = true;
$uniqueConstraintName = $indexColumns->getUniqueColumns()[$column->getName()]->getName();
}
$nullable = ! $column->getNotnull();
$nullable = !$column->getNotnull();

if ($primaryKey || ! $nullable || $unique) {
if ($primaryKey || !$nullable || $unique) {
$constraintsElt = $this->document->createElement('constraints');
if ($primaryKey) {
$constraintsElt->setAttribute('primaryKey', "true");
}
if (! $nullable) {
if (!$nullable) {
$constraintsElt->setAttribute('nullable', "false");
}
if ($unique) {
Expand Down
Loading

0 comments on commit 0520764

Please sign in to comment.