Skip to content

Commit

Permalink
testing php 8.1 (#138)
Browse files Browse the repository at this point in the history
Bumping deps, upgrading to phpunit 9, fixing all errors in php 8.1
  • Loading branch information
jaydiablo authored Dec 5, 2021
1 parent 54259f9 commit 55dd3fa
Show file tree
Hide file tree
Showing 104 changed files with 9,173 additions and 7,321 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,8 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.2', '7.3', '7.4']
php-versions: ['7.4', '8.0', '8.1']
composer-args: ['', '--prefer-lowest']
include:
- operating-system: ubuntu-latest
php-versions: '8.0'
composer-args: '--ignore-platform-reqs --no-scripts'
- operating-system: ubuntu-latest
php-versions: '8.0'
composer-args: '--prefer-lowest --ignore-platform-reqs --no-scripts'
runs-on: ${{ matrix.operating-system }}
steps:
- name: Checkout
Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/merge-me.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Merge me!

on:
workflow_run:
types:
- completed
workflows:
- 'Build'

jobs:
merge-me:
name: Merge me!
runs-on: ubuntu-latest
steps:
- # It is often a desired behavior to merge only when a workflow execution
# succeeds. This can be changed as needed.
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Merge me!
uses: ridedott/merge-me-action@v2
with:
# Depending on branch protection rules, a manually populated
# `GITHUB_TOKEN_WORKAROUND` secret with permissions to push to
# a protected branch must be used. This secret can have an arbitrary
# name, as an example, this repository uses `DOTTBOTT_TOKEN`.
#
# When using a custom token, it is recommended to leave the following
# comment for other developers to be aware of the reasoning behind it:
#
# This must be used as GitHub Actions token does not support pushing
# to protected branches.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ENABLE_GITHUB_API_PREVIEW: true
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ bin/phpstan
bin/phpstan.phar
bin/php-cs-fixer
tests/.phpunit.result.cache
.php_cs.cache
.php_cs.cache
.php-cs-fixer.cache
File renamed without changes.
104 changes: 52 additions & 52 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,81 +10,81 @@
"license": "BSD-3-Clause",
"prefer-stable": true,
"require": {
"diablomedia/zendframework1-acl": "^1.0.4",
"diablomedia/zendframework1-application": "^1.0.5",
"diablomedia/zendframework1-auth": "^1.0.4",
"diablomedia/zendframework1-auth-adapter-dbtable": "^1.0.5",
"diablomedia/zendframework1-acl": "^1.0.5",
"diablomedia/zendframework1-application": "^1.0.6",
"diablomedia/zendframework1-auth": "^1.0.5",
"diablomedia/zendframework1-auth-adapter-dbtable": "^1.0.6",
"diablomedia/zendframework1-auth-adapter-http": "^1.0.4",
"diablomedia/zendframework1-auth-adapter-ldap": "^1.0.4",
"diablomedia/zendframework1-auth-adapter-openid": "^1.0.4",
"diablomedia/zendframework1-cache": "^1.0.5",
"diablomedia/zendframework1-captcha": "^1.0.5",
"diablomedia/zendframework1-config": "^2.0.2",
"diablomedia/zendframework1-controller": "^1.0.5",
"diablomedia/zendframework1-cache": "^1.0.6",
"diablomedia/zendframework1-captcha": "^1.0.6",
"diablomedia/zendframework1-config": "^2.0.3",
"diablomedia/zendframework1-controller": "^1.0.6",
"diablomedia/zendframework1-controller-action-helper-ajaxcontext": "^1.0.4",
"diablomedia/zendframework1-controller-action-helper-autocomplete": "^1.0.4",
"diablomedia/zendframework1-controller-action-helper-contextswitch": "^1.0.5",
"diablomedia/zendframework1-controller-action-helper-json": "^1.0.4",
"diablomedia/zendframework1-crypt": "^1.0.4",
"diablomedia/zendframework1-crypt": "^1.0.5",
"diablomedia/zendframework1-currency": "^1.0.4",
"diablomedia/zendframework1-date": "^1.0.4",
"diablomedia/zendframework1-date": "^1.0.5",
"diablomedia/zendframework1-db": "^1.0.4",
"diablomedia/zendframework1-dojo": "^1.0.4",
"diablomedia/zendframework1-dom": "^1.0.4",
"diablomedia/zendframework1-eventmanager": "^1.0.4",
"diablomedia/zendframework1-exception": "^1.0.4",
"diablomedia/zendframework1-file": "^1.0.4",
"diablomedia/zendframework1-filter": "^1.0.4",
"diablomedia/zendframework1-dojo": "^1.0.5",
"diablomedia/zendframework1-dom": "^1.0.5",
"diablomedia/zendframework1-eventmanager": "^1.0.5",
"diablomedia/zendframework1-exception": "^1.1.1",
"diablomedia/zendframework1-file": "^1.0.5",
"diablomedia/zendframework1-filter": "^1.0.5",
"diablomedia/zendframework1-filter-input": "^1.0.4",
"diablomedia/zendframework1-form": "^1.0.5",
"diablomedia/zendframework1-http": "^1.0.4",
"diablomedia/zendframework1-json": "^1.0.6",
"diablomedia/zendframework1-form": "^1.0.6",
"diablomedia/zendframework1-http": "^1.0.5",
"diablomedia/zendframework1-json": "^1.0.7",
"diablomedia/zendframework1-layout": "^1.0.5",
"diablomedia/zendframework1-ldap": "^1.0.4",
"diablomedia/zendframework1-loader": "^1.0.4",
"diablomedia/zendframework1-locale": "^1.0.5",
"diablomedia/zendframework1-log": "^1.0.4",
"diablomedia/zendframework1-log-writer-db": "^1.0.4",
"diablomedia/zendframework1-ldap": "^1.0.5",
"diablomedia/zendframework1-loader": "^1.0.5",
"diablomedia/zendframework1-locale": "^1.0.6",
"diablomedia/zendframework1-log": "^1.0.5",
"diablomedia/zendframework1-log-writer-db": "^1.0.5",
"diablomedia/zendframework1-log-writer-firebug": "^1.0.4",
"diablomedia/zendframework1-log-writer-mail": "^1.0.4",
"diablomedia/zendframework1-mail": "^1.0.4",
"diablomedia/zendframework1-mime": "^1.0.4",
"diablomedia/zendframework1-navigation": "^1.0.4",
"diablomedia/zendframework1-oauth": "^1.0.3",
"diablomedia/zendframework1-openid": "^1.0.4",
"diablomedia/zendframework1-paginator": "^1.0.4",
"diablomedia/zendframework1-log-writer-mail": "^1.0.5",
"diablomedia/zendframework1-mail": "^1.0.5",
"diablomedia/zendframework1-mime": "^1.0.5",
"diablomedia/zendframework1-navigation": "^1.0.5",
"diablomedia/zendframework1-oauth": "^1.0.4",
"diablomedia/zendframework1-openid": "^1.0.5",
"diablomedia/zendframework1-paginator": "^1.0.5",
"diablomedia/zendframework1-progressbar": "^1.0.4",
"diablomedia/zendframework1-registry": "^1.0.4",
"diablomedia/zendframework1-rest": "^1.0.4",
"diablomedia/zendframework1-server": "^1.0.4",
"diablomedia/zendframework1-registry": "^1.0.5",
"diablomedia/zendframework1-rest": "^1.0.5",
"diablomedia/zendframework1-server": "^1.0.5",
"diablomedia/zendframework1-service": "^1.0.4",
"diablomedia/zendframework1-service-amazon": "^1.0.4",
"diablomedia/zendframework1-service-amazon": "^1.0.5",
"diablomedia/zendframework1-service-recaptcha": "^1.0.4",
"diablomedia/zendframework1-session": "^1.1.2",
"diablomedia/zendframework1-session-savehandler-dbtable": "^1.0.4",
"diablomedia/zendframework1-soap": "^1.0.3",
"diablomedia/zendframework1-stdlib": "^1.0.4",
"diablomedia/zendframework1-test": "^3.0.0",
"diablomedia/zendframework1-session": "^1.1.3",
"diablomedia/zendframework1-session-savehandler-dbtable": "^1.0.5",
"diablomedia/zendframework1-soap": "^1.0.4",
"diablomedia/zendframework1-stdlib": "^1.0.5",
"diablomedia/zendframework1-test": "^3.0.1",
"diablomedia/zendframework1-text": "^1.0.4",
"diablomedia/zendframework1-translate": "^1.0.4",
"diablomedia/zendframework1-uri": "^1.0.4",
"diablomedia/zendframework1-validate": "^1.0.4",
"diablomedia/zendframework1-translate": "^1.0.5",
"diablomedia/zendframework1-uri": "^1.0.5",
"diablomedia/zendframework1-validate": "^1.0.5",
"diablomedia/zendframework1-validate-db": "^1.0.4",
"diablomedia/zendframework1-validate-file": "^1.0.4",
"diablomedia/zendframework1-validate-file": "^1.0.5",
"diablomedia/zendframework1-validate-ldap": "^1.0.4",
"diablomedia/zendframework1-validate-sitemap": "^1.0.4",
"diablomedia/zendframework1-view": "^1.0.4",
"diablomedia/zendframework1-view-helper-action": "^1.0.4",
"diablomedia/zendframework1-view": "^1.0.5",
"diablomedia/zendframework1-view-helper-action": "^1.0.5",
"diablomedia/zendframework1-view-helper-baseurl": "^1.0.4",
"diablomedia/zendframework1-view-helper-json": "^1.0.4",
"diablomedia/zendframework1-view-helper-layout": "^1.0.4",
"diablomedia/zendframework1-view-helper-navigation": "^1.0.4",
"diablomedia/zendframework1-view-helper-paginationcontrol": "^1.0.4",
"diablomedia/zendframework1-view-helper-partial": "^1.0.4",
"diablomedia/zendframework1-view-helper-partial": "^1.0.5",
"diablomedia/zendframework1-view-helper-url": "^1.0.4",
"diablomedia/zendframework1-wildfire": "^1.0.4",
"diablomedia/zendframework1-xml": "^1.0.5",
"php": "^7.0 || ^8.0"
"php": "^7.4 || ~8.0 || ~8.1"
},
"autoload": {
"psr-0": {
Expand Down Expand Up @@ -153,10 +153,10 @@
"bin-dir": "bin"
},
"require-dev": {
"phpunit/phpunit": "^8.0",
"phpunit/phpcov": "^6.0 || ^7.0 || ^8.0",
"phpstan/phpstan": "0.12.82",
"friendsofphp/php-cs-fixer": "^2.18"
"phpunit/phpunit": "^9.5.10",
"phpunit/phpcov": "^8.0",
"phpstan/phpstan": "1.2.0",
"friendsofphp/php-cs-fixer": "3.3.2"
},
"archive": {
"exclude": [
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Amf/Adobe/Introspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected function _addService(Zend_Server_Reflection_Class $refclass, DOMElemen
foreach ($refclass->getMethods() as $method) {
if (!$method->isPublic()
|| $method->isConstructor()
|| ('__' == substr($method->name, 0, 2))
|| ('__' == substr($method->name ?? '', 0, 2))
) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Barcode/Object/Code25.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ protected function _calculateBarcodeWidth()
$startCharacter = (2 * $this->_barThickWidth + 4 * $this->_barThinWidth) * $this->_factor;
$characterLength = (3 * $this->_barThinWidth + 2 * $this->_barThickWidth + 5 * $this->_barThinWidth)
* $this->_factor;
$encodedData = strlen($this->getText()) * $characterLength;
$encodedData = strlen($this->getText() ?? '') * $characterLength;
$stopCharacter = (2 * $this->_barThickWidth + 4 * $this->_barThinWidth) * $this->_factor;
return $quietZone + $startCharacter + $encodedData + $stopCharacter + $quietZone;
}
Expand Down
2 changes: 1 addition & 1 deletion library/Zend/Barcode/Object/Code25interleaved.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function _calculateBarcodeWidth()
$quietZone = $this->getQuietZone();
$startCharacter = (4 * $this->_barThinWidth) * $this->_factor;
$characterLength = (3 * $this->_barThinWidth + 2 * $this->_barThickWidth) * $this->_factor;
$encodedData = strlen($this->getText()) * $characterLength;
$encodedData = strlen($this->getText() ?? '') * $characterLength;
$stopCharacter = ($this->_barThickWidth + 2 * $this->_barThinWidth) * $this->_factor;
return $quietZone + $startCharacter + $encodedData + $stopCharacter + $quietZone;
}
Expand Down
4 changes: 2 additions & 2 deletions library/Zend/Barcode/Object/ObjectAbstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ protected function _addLeadingZeros($text, $withoutChecksum = false)
}
} else {
if ($this->_barcodeLength == 'even') {
$text = ((strlen($text) - $omitChecksum) % 2 ? '0' . $text : $text);
$text = ((strlen($text ?? '') - $omitChecksum) % 2 ? '0' . $text : $text);
}
}
}
Expand Down Expand Up @@ -979,7 +979,7 @@ protected function _checkText($value = null)
if ($value === null) {
$value = $this->_text;
}
if (!strlen($value)) {
if (!strlen($value ?? '')) {
throw new Zend_Barcode_Object_Exception(
'A text must be provide to Barcode before drawing'
);
Expand Down
25 changes: 18 additions & 7 deletions library/Zend/Barcode/Renderer/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ protected function _initRenderer()
$height = $this->_userHeight;
}

$width = (int) $width;
$height = (int) $height;

$foreColor = $this->_barcode->getForeColor();
$backgroundColor = $this->_barcode->getBackgroundColor();
$this->_resource = imagecreatetruecolor($width, $height);
Expand All @@ -262,11 +265,11 @@ protected function _initRenderer()
$this->_adjustPosition(imagesy($this->_resource), imagesx($this->_resource));
imagefilledrectangle(
$this->_resource,
$this->_leftOffset,
$this->_topOffset,
$this->_leftOffset + $barcodeWidth - 1,
$this->_topOffset + $barcodeHeight - 1,
$this->_imageBackgroundColor
(int) $this->_leftOffset,
(int) $this->_topOffset,
(int) $this->_leftOffset + (int) $barcodeWidth - 1,
(int) $this->_topOffset + (int) $barcodeHeight - 1,
(int) $this->_imageBackgroundColor
);
}

Expand Down Expand Up @@ -368,9 +371,17 @@ protected function _drawPolygon($points, $color, $filled = true)
);

if ($filled) {
imagefilledpolygon($this->_resource, $newPoints, 4, $allocatedColor);
if (version_compare(PHP_VERSION, '8.0.0', '>=')) {
imagefilledpolygon($this->_resource, $newPoints, $allocatedColor);
} else {
imagefilledpolygon($this->_resource, $newPoints, 4, $allocatedColor);
}
} else {
imagepolygon($this->_resource, $newPoints, 4, $allocatedColor);
if (version_compare(PHP_VERSION, '8.0.0', '>=')) {
imagepolygon($this->_resource, $newPoints, $allocatedColor);
} else {
imagepolygon($this->_resource, $newPoints, 4, $allocatedColor);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getAdapter()
/**
* Assemble the query into a format the adapter can utilize
*
* @var string $collectionName Name of collection from which to select
* @param string $collectionName Name of collection from which to select
* @return string
*/
public function assemble($collectionName = null)
Expand Down
6 changes: 6 additions & 0 deletions library/Zend/Cloud/DocumentService/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ public function __set($name, $value)
* @param string $name
* @return bool
*/
#[\ReturnTypeWillChange]
public function offsetExists($name)
{
return isset($this->_fields[$name]);
Expand All @@ -171,6 +172,7 @@ public function offsetExists($name)
* @param string $name
* @return mixed
*/
#[\ReturnTypeWillChange]
public function offsetGet($name)
{
return $this->getField($name);
Expand All @@ -183,6 +185,7 @@ public function offsetGet($name)
* @param mixed $value
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetSet($name, $value)
{
$this->setField($name, $value);
Expand All @@ -194,6 +197,7 @@ public function offsetSet($name, $value)
* @param string $name
* @return void
*/
#[\ReturnTypeWillChange]
public function offsetUnset($name)
{
if ($this->offsetExists($name)) {
Expand Down Expand Up @@ -229,6 +233,7 @@ public function __call($name, $args)
*
* @return int
*/
#[\ReturnTypeWillChange]
public function count()
{
return count($this->_fields);
Expand All @@ -239,6 +244,7 @@ public function count()
*
* @return Iterator
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return new ArrayIterator($this->_fields);
Expand Down
2 changes: 2 additions & 0 deletions library/Zend/Cloud/DocumentService/DocumentSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public function __construct(array $documents)
*
* @return int
*/
#[\ReturnTypeWillChange]
public function count()
{
return $this->_documentCount;
Expand All @@ -61,6 +62,7 @@ public function count()
*
* @return Traversable
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return $this->_documents;
Expand Down
Loading

0 comments on commit 55dd3fa

Please sign in to comment.