Skip to content

Commit

Permalink
Preparing for PHP 8.2 (diablomedia#176
Browse files Browse the repository at this point in the history
* Preparing for PHP 8.2

* final deps
  • Loading branch information
jaydiablo authored Apr 20, 2023
1 parent e6db06b commit c67c83f
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 43 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ["7.4", "8.0", "8.1"]
php-versions: ["7.4", "8.0", "8.1", "8.2"]
composer-args: ["", "--prefer-lowest"]
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup PHP
uses: shivammathur/setup-php@2.19.1
uses: shivammathur/setup-php@2.24.0
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring
Expand All @@ -30,7 +30,7 @@ jobs:
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v3
with:
Expand All @@ -52,5 +52,4 @@ jobs:
uses: codecov/codecov-action@v3
with:
files: ./clover.xml
fail_ci_if_error: true
verbose: true
22 changes: 22 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Dependabot auto-merge
on: pull_request

permissions:
contents: write
pull-requests: write

jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
32 changes: 0 additions & 32 deletions .github/workflows/merge-me.yml

This file was deleted.

12 changes: 8 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
],
"homepage": "http://framework.zend.com/",
"license": "BSD-3-Clause",
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"ext-ctype": "*",
"php": "^7.4 || ~8.0.0 || ~8.1.0",
"php": "^7.4 || ~8.0.0 || ~8.1.0 || ~8.2.0",
"diablomedia/zendframework1-exception": "^1.0.0",
"diablomedia/zendframework1-config": "^1.0.0 || ^2.0.0",
"diablomedia/zendframework1-loader": "^1.0.0",
Expand All @@ -33,8 +32,8 @@
},
"require-dev": {
"phpunit/phpunit": "^9.5.10",
"phpstan/phpstan": "1.8.0",
"friendsofphp/php-cs-fixer": "3.6.0",
"phpstan/phpstan": "1.10.13",
"friendsofphp/php-cs-fixer": "3.16.0",
"maglnet/composer-require-checker": "^3.0.0",
"phpro/grumphp-shim": "^1.5.0"
},
Expand All @@ -51,5 +50,10 @@
"test-with-coverage": "phpunit --coverage-clover=clover.xml",
"phpstan": "phpstan analyze -c phpstan.neon --no-progress --ansi",
"style-check": "php-cs-fixer fix --dry-run -vv"
},
"config": {
"allow-plugins": {
"phpro/grumphp-shim": true
}
}
}
2 changes: 1 addition & 1 deletion src/Zend/Uri/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ protected function _parseUri($schemeSpecific)
$this->_username = isset($matches[2]) === true ? $matches[2] : '';
$this->_password = isset($matches[4]) === true ? $matches[4] : '';
$this->_host = isset($matches[5]) === true
? preg_replace('~^\[([^]]+)\]$~', '\1', $matches[5]) // Strip wrapper [] from IPv6 literal
? (string) preg_replace('~^\[([^]]+)\]$~', '\1', $matches[5]) // Strip wrapper [] from IPv6 literal
: '';
$this->_port = isset($matches[7]) === true ? $matches[7] : '';
}
Expand Down
9 changes: 7 additions & 2 deletions tests/Zend/UriTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@
*/
class Zend_UriTest extends PHPUnit\Framework\TestCase
{
protected $notices;
protected $errorReporting;
protected $displayErrors;
protected $error;

public function setUp(): void
{
$this->notices = array();
Expand Down Expand Up @@ -169,7 +174,7 @@ protected function _testInvalidUri($uri, $regex)
protected function _testValidUri($uri, $className = null)
{
$uri = Zend_Uri::factory($uri, $className);
$this->assertTrue($uri instanceof Zend_Uri, 'Zend_Uri object not returned.');
$this->assertInstanceOf(Zend_Uri::class, $uri, 'Zend_Uri object not returned.');
return $uri;
}

Expand All @@ -190,7 +195,7 @@ public function testFactoryWithExistingClassButNotImplementingZendUriThrowExcept
public function testFactoryWithExistingClassReturnObject()
{
$uri = $this->_testValidUri('http://example.net', 'Zend_Uri_Mock');
$this->assertTrue($uri instanceof Zend_Uri_Mock, 'Zend_Uri_Mock object not returned.');
$this->assertInstanceOf(Zend_Uri_Mock::class, $uri, 'Zend_Uri_Mock object not returned.');
}
}
class Zend_Uri_Mock extends Zend_Uri
Expand Down

0 comments on commit c67c83f

Please sign in to comment.