Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add compatibility for PHP8 #116

Merged
merged 10 commits into from
Mar 1, 2021
Merged
Show file tree
Hide file tree
Changes from 3 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
11 changes: 5 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ 'ubuntu-18.04' ] #, macos-latest, windows-latest ]
php-version: [ '7.2', '7.3', '7.4' ]
php-version: [ '7.3', '7.4', '8.0' ]

name: PHP ${{ matrix.php-version }} on OS ${{ matrix.os }}
steps:
Expand All @@ -32,8 +32,7 @@ jobs:
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
# Select PHPUnit version suitable for PHP 7.2.
tools: composer, phpunit:^8.5
tools: composer, phpunit:^9.5

# Cache Composer Dependencies
# https://github.com/marketplace/actions/setup-php-action#cache-composer-dependencies
Expand All @@ -51,22 +50,22 @@ jobs:
run: composer install

- name: Run code style checks
run: composer run style
run: composer run check-style

- name: Run tests
run: composer run test

# https://github.com/php-coveralls/php-coveralls#github-actions
- name: Upload coverage results to Coveralls
if: always() && matrix.php-version == '7.4'
if: always() && (matrix.php-version == '7.4' || matrix.php-version == '8.0')
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
composer global require php-coveralls/php-coveralls
php-coveralls --coverage_clover=build/logs/clover.xml -v

- name: Upload coverage results to Scrutinizer CI
if: always() && matrix.php-version == '7.4'
if: always() && (matrix.php-version == '7.4' || matrix.php-version == '8.0')
run: |
echo "Git HEAD ref:"
git log --pretty=%P -n1 HEAD
Expand Down
10 changes: 8 additions & 2 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ build:
analysis:
environment:
php:
version: 7.4
version: 8.0
tests:
override:
- php-scrutinizer-run --enable-security-analysis
Expand All @@ -39,4 +39,10 @@ build:

# https://scrutinizer-ci.com/docs/tools/external-code-coverage/
tools:
external_code_coverage: true
external_code_coverage:

enabled: true

# Scrutinizer will wait for two code coverage submissions
# in order to cover both PHP7 and PHP8.
runs: 2
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
Unreleased
==========

- Added compatibility for PHP8, deprecated PHP7.2
amotl marked this conversation as resolved.
Show resolved Hide resolved

- Bumped required guzzle http client dependency to ``^7.2``

2020/09/28 1.1.0
Expand Down
18 changes: 15 additions & 3 deletions DEVELOP.rst
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,22 @@ Installation

Install prerequisites::

brew install [email protected] composer
# Install different PHP releases.
brew install [email protected] [email protected] [email protected] composer

# Select PHP version.
brew-php-switcher 7.3
brew-php-switcher 7.4
brew-php-switcher 8.0

# Install xdebug extension for tracking code coverage.
pecl install xdebug

Get the sources::

git clone [email protected]:crate/crate-pdo.git

Setup environment::
Setup project dependencies::

composer install

Expand All @@ -109,7 +117,11 @@ Running the Tests
composer run test

# Run code style checks
composer run style
composer run check-style

# Some code style quirks can be automatically fixed
composer run fix-style



****************************
Expand Down
10 changes: 7 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ CrateDB PDO Adapter
:target: https://packagist.org/packages/crate/crate-pdo
:alt: Latest stable version

.. image:: https://poser.pugx.org/crate/crate-pdo/downloads
.. image:: https://img.shields.io/badge/PHP-7.3%2C%207.4%2C%208.0-green.svg
:target: https://packagist.org/packages/crate/crate-pdo
:alt: Total downloads
:alt: Supported PHP versions

.. image:: https://poser.pugx.org/crate/crate-pdo/d/monthly
:target: https://packagist.org/packages/crate/crate-pdo
:alt: Monthly downloads

.. image:: https://poser.pugx.org/crate/crate-pdo/license
:target: https://packagist.org/packages/crate/crate-pdo
Expand All @@ -48,7 +52,7 @@ Installation

The CrateDB PDO adapter is available as a Composer package. Install it like::

composer add crate/crate-pdo
composer require crate/crate-pdo

See the `installation documentation`_ for more info.

Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"homepage": "https://github.com/crate/crate-pdo",
"keywords": ["database", "pdo", "cratedb"],
"require": {
"php": "^7.2",
"php": "^7.3|^8.0|^8.1",
"ext-pdo": "*",
"guzzlehttp/guzzle": "^7.2"
},
Expand All @@ -23,7 +23,7 @@
}
},
"require-dev": {
"phpunit/phpunit": "^8.5",
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^0.12",
"squizlabs/php_codesniffer": "^3.5"
},
Expand All @@ -35,6 +35,7 @@
},
"scripts": {
"test": "XDEBUG_MODE=coverage phpunit --coverage-clover build/logs/clover.xml",
"style": "phpcs"
"check-style": "phpcs",
"fix-style": "phpcbf"
}
}
Loading