Skip to content

Commit

Permalink
Merge pull request #38 from luyadev/php-81
Browse files Browse the repository at this point in the history
php 8.1
  • Loading branch information
nadar authored May 25, 2022
2 parents bcd995c + 05931c2 commit 85ea144
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']

steps:
## checkout the repoistory
Expand All @@ -27,7 +27,7 @@ jobs:
with:
php-version: ${{ matrix.php }}
extensions: apc, curl, dom, imagick, intl, mbstring, mcrypt, memcached, mysql, pdo, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, sqlite
ini-values: date.timezone='UTC'
ini-values: date.timezone='UTC',error_reporting=E_ALL,display_errors=On

## install composer
- name: Install dependencies
Expand All @@ -36,7 +36,7 @@ jobs:
## run unit tests
- name: PHP Unit tests for PHP
run: vendor/bin/phpunit --verbose --configuration actions.phpunit.xml
if: matrix.php == '8.0' || matrix.php == '7.4' || matrix.php == '7.3' || matrix.php == '7.2' || matrix.php == '7.0'
if: matrix.php == '8.1' || matrix.php == '8.0' || matrix.php == '7.4' || matrix.php == '7.3' || matrix.php == '7.2' || matrix.php == '7.0'

## unit test with coverage
- name: PHP Unit tests for PHP 7.1
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](http://semver.org/).

## 2.9.1 (25. May 2022)

+ [#38](https://github.com/luyadev/luya-headless/pull/38) PHP 8.1 compatibility

## 2.9.0 (22. September 2021)

+ [#35](https://github.com/luyadev/luya-headless/pull/35) Added strict caching property which is by default enabled. Strict cache will only cache data which are from status 200 response code.
Expand Down
2 changes: 1 addition & 1 deletion src/base/AbstractRequestClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function setEndpoint($endpoint)
*/
public function getRequestUrl()
{
$parts = [rtrim($this->client->serverUrl, '/'), $this->client->language, ltrim($this->endpoint, '/')];
$parts = [rtrim($this->client->serverUrl, '/'), $this->client->language, ltrim((string) $this->endpoint, '/')];

$url = implode("/", array_filter($parts));

Expand Down
13 changes: 13 additions & 0 deletions src/base/BaseIterator.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public function addItem(array $item, $key)
* {@inheritDoc}
* @see Countable::count()
*/
#[\ReturnTypeWillChange]
public function count()
{
return count($this->data);
Expand All @@ -131,6 +132,7 @@ public function count()
* {@inheritDoc}
* @see Iterator::rewind()
*/
#[\ReturnTypeWillChange]
public function rewind()
{
return reset($this->data);
Expand All @@ -140,11 +142,16 @@ public function rewind()
* {@inheritDoc}
* @see Iterator::current()
*/
#[\ReturnTypeWillChange]
public function current()
{
return current($this->data);
}

/**
* {@inheritDoc}
*/
#[\ReturnTypeWillChange]
public function key()
{
return key($this->data);
Expand All @@ -154,6 +161,7 @@ public function key()
* {@inheritDoc}
* @see Iterator::next()
*/
#[\ReturnTypeWillChange]
public function next()
{
return next($this->data);
Expand All @@ -163,6 +171,7 @@ public function next()
* {@inheritDoc}
* @see Iterator::valid()
*/
#[\ReturnTypeWillChange]
public function valid()
{
return key($this->data) !== null;
Expand All @@ -174,6 +183,7 @@ public function valid()
* {@inheritDoc}
* @see ArrayAccess::offsetSet()
*/
#[\ReturnTypeWillChange]
public function offsetSet($offset, $value)
{
$this->data[$offset] = $value;
Expand All @@ -183,6 +193,7 @@ public function offsetSet($offset, $value)
* {@inheritDoc}
* @see ArrayAccess::offsetExists()
*/
#[\ReturnTypeWillChange]
public function offsetExists($offset)
{
return isset($this->data[$offset]);
Expand All @@ -192,6 +203,7 @@ public function offsetExists($offset)
* {@inheritDoc}
* @see ArrayAccess::offsetUnset()
*/
#[\ReturnTypeWillChange]
public function offsetUnset($offset)
{
unset($this->data[$offset]);
Expand All @@ -201,6 +213,7 @@ public function offsetUnset($offset)
* {@inheritDoc}
* @see ArrayAccess::offsetGet()
*/
#[\ReturnTypeWillChange]
public function offsetGet($offset)
{
return isset($this->data[$offset]) ? $this->data[$offset] : null;
Expand Down

0 comments on commit 85ea144

Please sign in to comment.