Skip to content

Commit 870a5c2

Browse files
authored
Merge pull request #8 from dkd-kaehm/task/prepare_PHP7.2
[TASK] Update to PHP 7.2+
2 parents ce4a1c2 + 9cb0f36 commit 870a5c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+671
-1828
lines changed

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
custom: ["https://www.typo3-solr.com/"]

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG] Please add a speaking title"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
_Note:_
21+
You can use https://github.com/TYPO3-Solr/solr-ddev-site
22+
to describe each step to reproduce your issue.
23+
24+
**Expected behavior**
25+
A clear and concise description of what you expected to happen.
26+
27+
**Screenshots**
28+
If applicable, add screenshots to help explain your problem.
29+
30+
**Used versions (please complete the following information):**
31+
- TYPO3 Version: [e.g. 10.4.20]
32+
- Browser: [e.g. chrome, safari]
33+
- EXT:solr Version: [e.g. 11.1.1]
34+
- Used Apache Solr Version: [e.g. 8.9.0]
35+
- PHP Version: [e.g. 7.4.0]
36+
- MySQL Version: [e.g. 8.0.0]
37+
38+
**Additional context**
39+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[FEATURE] Please describe your feature wish here"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/task.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
name: Task
3+
about: This template is used to describe regular tasks
4+
title: "[TASK]"
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**What should be done in the scope of this task?**

.github/no-response.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Configuration for probot-no-response - https://github.com/probot/no-response
2+
3+
# Number of days of inactivity before an Issue is closed for lack of response
4+
daysUntilClose: 28
5+
# Label requiring a response
6+
responseRequiredLabel: more-information-needed
7+
# Comment to post when closing an Issue for lack of response. Set to `false` to disable
8+
closeComment: >
9+
This issue has been automatically closed because there has been no response
10+
to our request for more information from the original author. With only the
11+
information that is currently in the issue, we don't have enough information
12+
to take action. Please reach out if you have or find the answers we need so
13+
that we can investigate further.
14+

.github/workflows/ci.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: php-solr-explain Github Actions
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
tags:
7+
- "**"
8+
pull_request:
9+
branches: [ master ]
10+
11+
env:
12+
PHP_CS_FIXER_VERSION: '^3.0.2'
13+
CI_BUILD_DIRECTORY: '/ramfs/data-build'
14+
jobs:
15+
tests:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
PHP: [ '7.2', '7.3', '7.4', '8.0' ]
20+
21+
name: On PHP ${{ matrix.PHP }}
22+
steps:
23+
# Workaround for issue with actions/checkout@v2 wrong PR commit checkout: See https://github.com/actions/checkout/issues/299#issuecomment-677674415
24+
- name: Checkout current state of Pull Request
25+
if: github.event_name == 'pull_request'
26+
uses: actions/checkout@v2
27+
with:
28+
ref: ${{ github.event.pull_request.head.sha }}
29+
- name: Checkout current state of Branch
30+
if: github.event_name == 'push'
31+
uses: actions/checkout@v2
32+
33+
- name: Mount RAMFS
34+
run: |
35+
id
36+
sudo mkdir /ramfs
37+
sudo mount -t tmpfs -o size=2048m none /ramfs
38+
sudo mkdir -p /ramfs/data-build && sudo chown $USER /ramfs/data-*
39+
40+
- name: Setup PHP
41+
uses: shivammathur/setup-php@v2
42+
with:
43+
php-version: ${{ matrix.PHP }}
44+
coverage: xdebug
45+
tools: composer:v2
46+
47+
- name: CI-Bootstrap
48+
run: |
49+
echo "CI_BUILD_DIRECTORY=$CI_BUILD_DIRECTORY/"
50+
cp -r ../php-solr-explain $CI_BUILD_DIRECTORY/.
51+
cd $CI_BUILD_DIRECTORY/php-solr-explain
52+
./Build/Test/bootstrap.sh
53+
echo "Current Size of php-solr-explain build Artefacts: " && du -sh $CI_BUILD_DIRECTORY/php-solr-explain
54+
55+
- name: CI-Build
56+
run: |
57+
cd $CI_BUILD_DIRECTORY/php-solr-explain
58+
./Build/Test/cibuild.sh
59+
echo "Current Size of php-solr-explain build Artefacts: " && du -sh $CI_BUILD_DIRECTORY/ && du -sh $CI_BUILD_DIRECTORY/php-solr-explain/.Build/*
60+
61+
# - name: Upload code coverage to Scrutinizer
62+
# run: |
63+
# cd $CI_BUILD_DIRECTORY/php-solr-explain
64+
# mkdir -p $GITHUB_WORKSPACE/bin
65+
# wget https://scrutinizer-ci.com/ocular.phar -O $GITHUB_WORKSPACE/bin/ocular && chmod +x $GITHUB_WORKSPACE/bin/ocular
66+
# php $GITHUB_WORKSPACE/bin/ocular code-coverage:upload --format=php-clover coverage.unit.clover
67+
68+
publish:
69+
name: Publish PHAR file on Release
70+
needs: tests
71+
if: startsWith(github.ref, 'refs/tags/')
72+
runs-on: ubuntu-20.04
73+
steps:
74+
- name: Checkout repository
75+
uses: actions/checkout@v2
76+
with:
77+
ref: ${{ github.event.pull_request.head.sha }}
78+
79+
# Build PHAR
80+
- name: Build PHAR
81+
run: |
82+
./Build/phar.sh
83+
84+
- name: Upload PHAR on release
85+
uses: softprops/action-gh-release@v1
86+
if: startsWith(github.ref, 'refs/tags/')
87+
with:
88+
files: |
89+
../php-solr-explain.phar

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

Build/Test/bootstrap.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
#!/usr/bin/env bash
22

3-
SCRIPTPATH=$( cd $(dirname ${BASH_SOURCE[0]}) ; pwd -P )
4-
ROOTPATH="$SCRIPTPATH/../../"
3+
SCRIPT_PATH=$( cd $(dirname "${BASH_SOURCE[0]}"); pwd -P )
4+
ROOT_PATH="$SCRIPT_PATH/../../"
55

6-
cd $ROOTPATH
7-
composer install
6+
cd "$ROOT_PATH"
7+
if ! composer install; then
8+
echo "Could not install composer dependencies. Please fix that issue first."
9+
exit 1;
10+
fi
11+
12+
echo "The environment is ready."

Build/Test/cibuild.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/usr/bin/env bash
22

3-
SCRIPTPATH=$( cd $(dirname ${BASH_SOURCE[0]}) ; pwd -P )
4-
ROOTPATH="$SCRIPTPATH/../../"
3+
SCRIPT_PATH=$( cd $(dirname "${BASH_SOURCE[0]}"); pwd -P )
4+
ROOT_PATH="$SCRIPT_PATH/../../"
55

6-
cd $ROOTPATH
7-
./.Build/bin/phpunit -c Build/Test/phpunit.xml
6+
cd "$ROOT_PATH"
7+
if ! .Build/bin/phpunit --config Build/Test/phpunit.xml --colors --coverage-clover=coverage.unit.clover; then
8+
echo "There are failed unit tests. Please fix the issues."
9+
exit 1;
10+
fi

Build/Test/phpunit.xml

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,27 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
43
bootstrap="../../.Build/vendor/autoload.php"
4+
backupGlobals="false"
5+
backupStaticAttributes="false"
56
colors="true"
67
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
88
convertWarningsToExceptions="true"
9+
forceCoversAnnotation="false"
910
processIsolation="false"
10-
stopOnFailure="false"
11-
syntaxCheck="false"
11+
stopOnError="true"
12+
stopOnFailure="true"
13+
stopOnIncomplete="false"
14+
stopOnSkipped="false"
15+
verbose="false"
1216
>
17+
<coverage processUncoveredFiles="false">
18+
<include>
19+
<directory suffix=".php">../../Classes/</directory>
20+
</include>
21+
</coverage>
1322
<testsuites>
14-
<testsuite name="Domain">
23+
<testsuite name="php-solr-explain-unit-tests">
1524
<directory suffix="TestCase.php">../../Tests/</directory>
1625
</testsuite>
1726
</testsuites>
18-
</phpunit>
27+
</phpunit>

Build/phar.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env bash
22

3-
SCRIPTPATH=$( cd $(dirname ${BASH_SOURCE[0]}) ; pwd -P )
4-
ROOTPATH="$SCRIPTPATH/../"
3+
SCRIPT_PATH=$( cd $(dirname "${BASH_SOURCE[0]}"); pwd -P )
4+
ROOT_PATH="$SCRIPT_PATH/../"
55

6-
cd $ROOTPATH
6+
cd "$ROOT_PATH"
77
rm -fR .Build
88
composer install --no-dev
99

1010
cd ..
11-
wget https://github.com/clue/phar-composer/releases/download/v1.0.0/phar-composer.phar
12-
php phar-composer.phar build "$ROOTPATH/../php-solr-explain"
11+
wget https://github.com/clue/phar-composer/releases/download/v1.2.0/phar-composer-1.2.0.phar -O phar-composer
12+
php phar-composer build "$ROOT_PATH/../php-solr-explain"

Classes/Domain/Result/Document/Collection.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
namespace ApacheSolrForTypo3\SolrExplain\Domain\Result\Document;
44

5-
use ApacheSolrForTypo3\SolrExplain\Domain\Result\Document\Document;
5+
use ArrayObject;
66

7-
class Collection extends \ArrayObject {
7+
class Collection extends ArrayObject
8+
{
89

910
/**
1011
* @param $offset
1112
* @return Document
1213
*/
13-
public function getDocument($offset) {
14+
public function getDocument($offset): Document
15+
{
1416
return $this->offsetGet($offset);
1517
}
1618
}

Classes/Domain/Result/Document/Document.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
use ApacheSolrForTypo3\SolrExplain\Domain\Result\Document\Field\Collection;
66
use ApacheSolrForTypo3\SolrExplain\Domain\Result\Document\Field\Field;
77

8-
class Document {
8+
class Document
9+
{
910

1011
/**
1112
* @var Collection
@@ -20,43 +21,49 @@ class Document {
2021
/**
2122
* @return void
2223
*/
23-
public function __construct() {
24+
public function __construct()
25+
{
2426
$this->fieldCollection = new Collection();
2527
}
2628

2729
/**
2830
* @param Field $field
2931
*/
30-
public function addField(Field $field) {
32+
public function addField(Field $field)
33+
{
3134
$this->fieldCollection->offsetSet($field->getName(),$field);
3235
}
3336

3437
/**
3538
* @return Collection
3639
*/
37-
public function getFields() {
40+
public function getFields(): Collection
41+
{
3842
return $this->fieldCollection;
3943
}
4044

4145
/**
4246
* @param string
4347
* @return Field
4448
*/
45-
public function getFieldByName($fieldName) {
49+
public function getFieldByName(string $fieldName): Field
50+
{
4651
return $this->fieldCollection->offsetGet($fieldName);
4752
}
4853

4954
/**
5055
* @param string $rawExplainData
5156
*/
52-
public function setRawExplainData($rawExplainData) {
57+
public function setRawExplainData(string $rawExplainData)
58+
{
5359
$this->rawExplainData = $rawExplainData;
5460
}
5561

5662
/**
5763
* @return string
5864
*/
59-
public function getRawExplainData() {
65+
public function getRawExplainData(): string
66+
{
6067
return $this->rawExplainData;
6168
}
6269
}

Classes/Domain/Result/Document/Field/Collection.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,8 @@
22

33
namespace ApacheSolrForTypo3\SolrExplain\Domain\Result\Document\Field;
44

5-
class Collection extends \ArrayObject {}
5+
use ArrayObject;
6+
7+
class Collection extends ArrayObject
8+
{
9+
}

0 commit comments

Comments
 (0)