Skip to content

Commit

Permalink
Allow php8 (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
snapshotpl authored Feb 18, 2021
1 parent add8501 commit 5c6e48e
Show file tree
Hide file tree
Showing 15 changed files with 5,374 additions and 187 deletions.
49 changes: 28 additions & 21 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
version: 2
version: 2.1
jobs:
build:
parameters:
php-versions:
type: string
docker:
- image: circleci/php:7.2.9-apache-stretch-node-browsers
- image: circleci/php:<< parameters.php-versions >>-apache-buster-node-browsers
- image: docker.elastic.co/elasticsearch/elasticsearch:7.1.1
environment:
- discovery.type=single-node
Expand All @@ -26,6 +29,7 @@ jobs:
- run: .circleci/wait_es_up.sh

# enable xdebug
- run: echo -e "xdebug.mode = coverage" | sudo tee /usr/local/etc/php/php.ini > /dev/null
- run: sudo ln -s /etc/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
- run: php --ini

Expand All @@ -37,7 +41,7 @@ jobs:

analyze_phpcs:
docker:
- image: circleci/php:7.2.9-apache-stretch-node-browsers
- image: circleci/php:7.4-apache-buster-node-browsers
working_directory: ~/repo
steps:
- checkout
Expand All @@ -61,7 +65,7 @@ jobs:

analyze_phpstan:
docker:
- image: circleci/php:7.2.9-apache-stretch-node-browsers
- image: circleci/php:7.4-apache-buster-node-browsers
working_directory: ~/repo
steps:
- checkout
Expand All @@ -80,7 +84,7 @@ jobs:
key: v1-dependencies-{{ checksum "composer.json" }}

# run code analyzer
- run: composer analyse src tests
- run: composer analyse
analyze_eol:
docker:
- image: nexucis/ci-checkfiles
Expand All @@ -97,20 +101,23 @@ jobs:
- checkout
- run: checkEncoding utf-8 *.php *.md *.xml *.sh composer.json phpstan.neon


workflows:
version: 2
build_and_analyze:
jobs:
- build
- analyze_phpcs:
requires:
- build
- analyze_phpstan:
requires:
- build
- analyze_eol:
requires:
- build
- analyze_encoding_utf8:
requires:
- build
build_and_analyze:
jobs:
- build:
matrix:
parameters:
php-versions: ["7.1", "7.2", "7.3", "7.4", "8.0"]
- analyze_phpcs:
requires:
- build
- analyze_phpstan:
requires:
- build
- analyze_eol:
requires:
- build
- analyze_encoding_utf8:
requires:
- build
4 changes: 2 additions & 2 deletions .circleci/wait_es_up.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

loop=0
endLoop=4
endLoop=5
wait=1

# for some strange reason, HEAD request go in infinity loop ...
Expand All @@ -21,4 +21,4 @@ if [ ${response} != 0 ]; then
exit 1;
else
echo "elasticsearch is available, starting php test"
fi
fi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ composer.lock
# intelliJ files
.idea/
/**/clover.xml

.phpunit.result.cache
13 changes: 7 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
}
],
"require": {
"php": "^7.1",
"php": "^7.1 | ^8.0",
"elasticsearch/elasticsearch": "^7.0.1"
},
"require-dev": {
"phpunit/phpunit": "^6.4",
"squizlabs/php_codesniffer": "3.1.1",
"phpstan/phpstan": "^0.8.5"
"phpunit/phpunit": "^7.5.20 | ^9.3.8",
"squizlabs/php_codesniffer": "3.5.8",
"phpstan/phpstan": "^0.12.77",
"yoast/phpunit-polyfills": "^0.2.0"
},
"autoload": {
"psr-4": {
Expand All @@ -30,7 +31,7 @@
},
"scripts": {
"test": "./vendor/bin/phpunit",
"lint": "./vendor/bin/phpcs --standard=ruleset.xml --extensions=php --encoding=utf-8 --tab-width=4",
"analyse": "./vendor/bin/phpstan analyse --level 7 -c phpstan.neon"
"lint": "./vendor/bin/phpcs --standard=ruleset.xml --extensions=php --encoding=utf-8 --tab-width=4 -v src/ tests/",
"analyse": "./vendor/bin/phpstan analyse --level 7 -c phpstan.neon src/"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
class IndexAlreadyExistException extends \Exception implements ElasticsearchException
{

/**
* @var string
*/
private $index;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
*/
class IndexNotFoundException extends \Exception implements ElasticsearchException
{


/**
* @var string
*/
private $index;

/**
Expand Down
Loading

0 comments on commit 5c6e48e

Please sign in to comment.