Skip to content

Commit

Permalink
Merge pull request #1266 from NatLibFi/issue1243-support-php80
Browse files Browse the repository at this point in the history
Support PHP 8.0
  • Loading branch information
osma authored Feb 14, 2022
2 parents 52e7079 + 5e0de26 commit ddf35d7
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ on: [push]
jobs:
build-test:
runs-on: ubuntu-latest
timeout-minutes: 10
continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
php_version: [7.2, 7.3, 7.4]
php_version: ["7.2", "7.3", "7.4", "8.0"]
experimental: [false]
include:
- php_version: "8.1"
experimental: true

steps:
- name: Check out repository code
Expand Down Expand Up @@ -43,21 +47,26 @@ jobs:
php_extensions: gettext intl xsl pcov

- name: Run PHPUnit tests
uses: php-actions/phpunit@91ff02a58932e63741157ea8c04e7e7077233537
uses: php-actions/phpunit@v3
env:
LANGUAGE: fr
with:
version: 8.5
php_version: ${{ matrix.php_version }}
php_extensions: gettext intl xsl pcov
memory_limit: 512M
configuration: phpunit.xml

- name: Publish code coverage to Code Climate
uses: paambaati/codeclimate-action@v2.7.5
env:
CC_TEST_REPORTER_ID: fb98170a5c7ea9cc2bbab19ff26268335e6a11a4f8267ca935e5e8ff4624886c
with:
prefix: /app
# PHPUnit 8.5 doesn't support code coverage for PHP 8
if: ${{ matrix.php_version < '8.0' }}

- name: Publish code coverage to Codecov
uses: codecov/codecov-action@v1
# PHPUnit 8.5 doesn't support code coverage for PHP 8
if: ${{ matrix.php_version < '8.0' }}
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"twig/extensions": "1.5.*",
"twitter/bootstrap": "3.3.*",
"twitter/typeahead.js": "v0.10.5",
"willdurand/negotiation": "2.3.*",
"willdurand/negotiation": "3.0.*",
"vakata/jstree": "3.3.*",
"punic/punic": "3.5.1",
"ml/json-ld": "1.*",
Expand All @@ -83,8 +83,8 @@
"require-dev": {
"phpunit/phpunit": "8.5.*",
"umpirsky/twig-gettext-extractor": "1.3.*",
"symfony/dom-crawler": "3.4.3",
"mockery/mockery": "1.3.1"
"symfony/dom-crawler": "5.4.*",
"mockery/mockery": "1.3.5"
},
"autoload": {
"classmap": ["controller/", "model/", "model/sparql/"]
Expand Down
2 changes: 1 addition & 1 deletion model/Vocabulary.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ public function getConceptBroaders($uri, $lang)
* @param boolean $any set to true if you want to have a label even in case of a correct language one missing.
* @param string $lang language identifier.
*/
public function getConceptTransitiveBroaders($uri, $limit, $any = false, $lang)
public function getConceptTransitiveBroaders($uri, $limit, $any, $lang)
{
$lang = $lang ? $lang : $this->getEnvLang();
$fallback = $this->config->getDefaultLanguage();
Expand Down
8 changes: 4 additions & 4 deletions model/sparql/GenericSparql.php
Original file line number Diff line number Diff line change
Expand Up @@ -1198,13 +1198,13 @@ private function transformConceptSearchResults($results, $vocabs, $fields) {
/**
* Query for concepts using a search term.
* @param array $vocabs array of Vocabulary objects to search; empty for global search
* @param array $fields extra fields to include in the result (array of strings). (default: null = none)
* @param boolean $unique restrict results to unique concepts (default: false)
* @param boolean $showDeprecated whether to include deprecated concepts in the result (default: false)
* @param array $fields extra fields to include in the result (array of strings or null).
* @param boolean $unique restrict results to unique concepts
* @param ConceptSearchParameters $params
* @param boolean $showDeprecated whether to include deprecated concepts in the result (default: false)
* @return array query result object
*/
public function queryConcepts($vocabs, $fields = null, $unique = false, $params, $showDeprecated = false) {
public function queryConcepts($vocabs, $fields, $unique, $params, $showDeprecated = false) {
$query = $this->generateConceptSearchQuery($fields, $unique, $params,$showDeprecated);
$results = $this->query($query);
return $this->transformConceptSearchResults($results, $vocabs, $fields);
Expand Down
3 changes: 2 additions & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<phpunit colors="true" bootstrap="tests/bootstrap.php" processIsolation="true">
<phpunit colors="true" bootstrap="tests/bootstrap.php" processIsolation="true"
convertDeprecationsToExceptions="true">
<logging>
<log type="coverage-html" target="./report" lowUpperBound="35" highLowerBound="70"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
Expand Down
2 changes: 2 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

error_reporting(E_ALL);

// make sure that a SPARQL endpoint is set by an environment variable
$endpoint = getenv('SKOSMOS_SPARQL_ENDPOINT');
if (!$endpoint) {
Expand Down

0 comments on commit ddf35d7

Please sign in to comment.