diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 00000000..51dfe7a9 --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,36 @@ +name: "Continuous Integration" + +on: + pull_request: + push: + branches: + - '[0-9]+.[0-9]+.x' + - 'refs/pull/*' + tags: + +jobs: + matrix: + name: Generate job matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.matrix.outputs.matrix }} + steps: + - name: Gather CI configuration + id: matrix + uses: laminas/laminas-ci-matrix-action@v1 + + qa: + name: QA Checks + needs: [matrix] + runs-on: ${{ matrix.operatingSystem }} + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.matrix.outputs.matrix) }} + steps: + - name: ${{ matrix.name }} + uses: laminas/laminas-continuous-integration-action@v1 + with: + job: ${{ matrix.job }} + services: + mongodb: + image: mongo:4.4 diff --git a/.laminas-ci.json b/.laminas-ci.json new file mode 100644 index 00000000..7fba3e45 --- /dev/null +++ b/.laminas-ci.json @@ -0,0 +1,7 @@ +{ + "extensions": [ + "mongodb", + "pdo", + "pdo-sqlite" + ] +} diff --git a/.laminas-ci/pre-run.sh b/.laminas-ci/pre-run.sh new file mode 100755 index 00000000..d78a1885 --- /dev/null +++ b/.laminas-ci/pre-run.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e + +JOB=$3 +PHP_VERSION=$(echo "${JOB}" | jq -r '.php') + +if [[ "$PHP_VERSION" =~ 8. ]];then + composer require --ignore-platform-req=php --dev --no-interaction --prefer-dist alcaeus/mongo-php-adapter +else + composer require --dev --no-interaction --prefer-dist alcaeus/mongo-php-adapter +fi + diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a117a3ad..00000000 --- a/.travis.yml +++ /dev/null @@ -1,63 +0,0 @@ -language: php - -services: - - mongodb - -cache: - directories: - - $HOME/.composer/cache - - vendor - -env: - global: - - COMPOSER_ARGS="--no-interaction" - - ADAPTER_DEPS="alcaeus/mongo-php-adapter" - - COVERAGE_DEPS="php-coveralls/php-coveralls" - - MONGO_DRIVER=mongodb - -matrix: - fast_finish: true - include: - - php: 7.3 - env: - - DEPS=lowest - - php: 7.3 - env: - - DEPS=latest - - php: 7.4 - env: - - DEPS=latest - - CS_CHECK=true - - TEST_COVERAGE=true - - php: 8.0 - env: - - DEPS=lowest - - COMPOSER_ARGS="--no-interaction --ignore-platform-reqs" - - php: 8.0 - env: - - DEPS=latest - - COMPOSER_ARGS="--no-interaction --ignore-platform-reqs" - -before_install: - - if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi - -install: - - yes '' | pecl -q install -f $MONGO_DRIVER - - composer config platform.ext-mongo '1.999' - - travis_retry composer install $COMPOSER_ARGS --ignore-platform-reqs - - if [[ $LEGACY_DEPS != '' ]]; then travis_retry composer update $COMPOSER_ARGS --with-dependencies $LEGACY_DEPS ; fi - - if [[ $DEPS == 'latest' ]]; then travis_retry composer update $COMPOSER_ARGS ; fi - - if [[ $DEPS == 'lowest' ]]; then travis_retry composer update --prefer-lowest --prefer-stable $COMPOSER_ARGS ; fi - - if [[ $MONGO_DRIVER == 'mongodb' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $ADAPTER_DEPS ; fi - - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry composer require --dev $COMPOSER_ARGS $COVERAGE_DEPS ; fi - - stty cols 120 && composer show - -script: - - if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi - - if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi - -after_script: - - if [[ $TEST_COVERAGE == 'true' ]]; then travis_retry php vendor/bin/php-coveralls -v ; fi - -notifications: - email: false diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index d70e438f..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,187 +0,0 @@ -# Changelog - -All notable changes to this project will be documented in this file, in reverse chronological order by release. - -## 1.9.1 - TBD - -### Added - -- Nothing. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.9.0 - 2021-01-07 - -### Added - -- [#5](https://github.com/laminas-api-tools/api-tools-doctrine-querybuilder/pull/5) adds the interface `Laminas\ApiTools\Doctrine\QueryBuilder\Filter\TypeCastInterface` and the default implementations `Laminas\ApiTools\Doctrine\QueryBuilder\Filter\ODM\TypeCaster` and `Laminas\ApiTools\Doctrine\QueryBuilder\ORM\TypeCaster`, extracted from logic originally present in the ORM and ODM `AbstractFilter` implementations. Users can supply their own implementation by aliasing the `Laminas\ApiTools\Doctrine\QueryBuilder\Filter\TypeCastInterface` service to their own implementation. This ability allows users to supply their own type casting rules for their projects. - -- [#12](https://github.com/laminas-api-tools/api-tools-doctrine-querybuilder/pull/12) adds support for PHP 7.3, 7.4, and 8.0. - -### Removed - -- [#12](https://github.com/laminas-api-tools/api-tools-doctrine-querybuilder/pull/12) removes support for PHP versions prior to 7.3. - - ------ - -### Release Notes for [1.9.0](https://github.com/laminas-api-tools/api-tools-doctrine-querybuilder/milestone/1) - - - -### 1.9.0 - -- Total issues resolved: **2** -- Total pull requests resolved: **2** -- Total contributors: **4** - -#### Enhancement - - - [12: PHP8 Support](https://github.com/laminas-api-tools/api-tools-doctrine-querybuilder/pull/12) thanks to @javabudd - - [5: Extract type cast behaviour](https://github.com/laminas-api-tools/api-tools-doctrine-querybuilder/pull/5) thanks to @netiul - - [1: Extract type cast behaviour](https://github.com/laminas-api-tools/api-tools-doctrine-querybuilder/issues/1) thanks to @weierophinney - -#### Enhancement,hacktoberfest-accepted - - - [11: PHP 8.0 support](https://github.com/laminas-api-tools/api-tools-doctrine-querybuilder/issues/11) thanks to @boesing - -## 1.8.0 - 2019-02-02 - -### Added - -- [zfcampus/zf-doctrine-querybuilder#52](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/52) adds support for PHP 7.3. - -- [zfcampus/zf-doctrine-querybuilder#46](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/46) adds support for DoctrineModule 2.1 - and DoctrineORMModule 2.1. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.7.0 - 2018-12-11 - -### Added - -- [zfcampus/zf-doctrine-querybuilder#50](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/50) adds support for laminas-hydrator version 3 releases, while retaining - compatibility with previous versions. - -### Changed - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- Nothing. - -## 1.6.0 - 2018-01-17 - -### Added - -- [zfcampus/zf-doctrine-querybuilder#42](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/42) adds - `leftjoin` ORM query type. - -- [zfcampus/zf-doctrine-querybuilder#44](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/44) adds - support for PHP 7.2. - -### Changed - -- [zfcampus/zf-doctrine-querybuilder#38](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/38) changes - methods visibility in Query Providers to `protected`: - - `getConfig()` - - `getFilterManager()` - - `getOrderByManager()` - -### Deprecated - -- Nothing. - -### Removed - -- [zfcampus/zf-doctrine-querybuilder#44](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/44) removes - support for HHVM. - -### Fixed - -- [zfcampus/zf-doctrine-querybuilder#40](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/40) fixes - ODM `isnull` and `isnotnull` query filters to give correct result with - nullable fields. - -## 1.5.1 - 2016-11-14 - -### Added - -- Nothing. - -### Deprecated - -- Nothing. - -### Removed - -- Nothing. - -### Fixed - -- [zfcampus/zf-doctrine-querybuilder#35](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/35) fixes - an issue with `DefaultOdmFactory` and `DefaultOrmFactory` when used with - Laminas with context of `AbstractPluginManager`. - -## 1.5.0 - 2016-11-10 - -### Added - -- [zfcampus/zf-doctrine-querybuilder#32](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/32) adds - support for PHP 7. -- [zfcampus/zf-doctrine-querybuilder#32](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/32) adds - support for v3 releases of Laminas components, while retaining - compatibility for v2 releases. -- [zfcampus/zf-doctrine-querybuilder#32](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/32) exposes - the module to [laminas/laminas-component-installer](https://github.com/zendframework/zend-component-installer). - -### Deprecated - -- Nothing. - -### Removed - -- [zfcampus/zf-doctrine-querybuilder#32](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/32) removes - support for PHP 5.4 and PHP 5.5. - -### Fixed - -- [zfcampus/zf-doctrine-querybuilder#32](https://github.com/zfcampus/zf-doctrine-querybuilder/pull/32) adds a - ton of tests to the module. diff --git a/README.md b/README.md index f3d4ba63..3aa43d37 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,7 @@ Laminas Doctrine QueryBuilder ======================== -[![Build Status](https://travis-ci.com/laminas-api-tools/api-tools-doctrine-querybuilder.svg)](https://travis-ci.com/laminas-api-tools/api-tools-doctrine-querybuilder) -[![Coverage Status](https://coveralls.io/repos/github/laminas-api-tools/api-tools-doctrine-querybuilder/badge.svg)](https://coveralls.io/github/laminas-api-tools/api-tools-doctrine-querybuilder) -[![Total Downloads](https://poser.pugx.org/laminas-api-tools/api-tools-doctrine-querybuilder/downloads)](https://packagist.org/packages/laminas-api-tools/api-tools-doctrine-querybuilder) +[![Build Status](https://github.com/laminas-api-tools/api-tools-doctrine-querybuilder/actions/workflows/continuous-integration.yml/badge.svg)](https://github.com/laminas-api-tools/api-tools-doctrine-querybuilder/actions/workflows/continuous-integration.yml) This library provides query builder directives from array parameters. This library was designed to apply filters from an HTTP request to give an API fluent filter and order-by dialects. diff --git a/test/Filter/local.php b/test/Filter/local.php index cecc13e9..09e23ef3 100644 --- a/test/Filter/local.php +++ b/test/Filter/local.php @@ -22,7 +22,7 @@ ], ], 'odm_default' => [ - 'server' => 'localhost', + 'server' => 'mongodb', 'port' => '27017', 'user' => '', 'password' => '', diff --git a/test/OrderBy/local.php b/test/OrderBy/local.php index 863656b1..9db126f9 100644 --- a/test/OrderBy/local.php +++ b/test/OrderBy/local.php @@ -22,7 +22,7 @@ ], ], 'odm_default' => [ - 'server' => 'localhost', + 'server' => 'mongodb', 'port' => '27017', 'user' => '', 'password' => '',