Skip to content

Commit

Permalink
Support PHP 8.2 (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-worman authored Jun 9, 2023
1 parent 813dcf5 commit 3f9b225
Show file tree
Hide file tree
Showing 1,728 changed files with 2,613 additions and 5,568 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,8 @@ jobs:
experimental:
- false
php:
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"

env:
MYSQL_USER: "zftest"
Expand Down
4 changes: 1 addition & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Monorepo for zf1s (Zend Framework 1) packages",
"license": "BSD-3-Clause",
"require": {
"php": ">=7",
"php": "^8.1 || ^8.2",
"ext-ctype": "*",
"ext-dom": "*",
"ext-gd": "*",
Expand Down Expand Up @@ -87,7 +87,6 @@
"Zend_Service_Audioscrobbler": "packages/zend-service-audioscrobbler/library/",
"Zend_Service_Console": "packages/zend-service-console/library/",
"Zend_Service_Delicious": "packages/zend-service-delicious/library/",
"Zend_Service_Ebay": "packages/zend-service-ebay/library/",
"Zend_Service_Flickr": "packages/zend-service-flickr/library/",
"Zend_Service_LiveDocx": "packages/zend-service-livedocx/library/",
"Zend_Service_Rackspace": "packages/zend-service-rackspace/library/",
Expand Down Expand Up @@ -178,7 +177,6 @@
"zf1s/zend-service-audioscrobbler": "self.version",
"zf1s/zend-service-console": "self.version",
"zf1s/zend-service-delicious": "self.version",
"zf1s/zend-service-ebay": "self.version",
"zf1s/zend-service-flickr": "self.version",
"zf1s/zend-service-livedocx": "self.version",
"zf1s/zend-service-rackspace": "self.version",
Expand Down
1 change: 0 additions & 1 deletion monorepo-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ parameters:
packages/zend-service-audioscrobbler: 'https://github.com/zf1s/zend-service-audioscrobbler.git'
packages/zend-service-console: 'https://github.com/zf1s/zend-service-console.git'
packages/zend-service-delicious: 'https://github.com/zf1s/zend-service-delicious.git'
packages/zend-service-ebay: 'https://github.com/zf1s/zend-service-ebay.git'
packages/zend-service-flickr: 'https://github.com/zf1s/zend-service-flickr.git'
packages/zend-service-livedocx: 'https://github.com/zf1s/zend-service-livedocx.git'
packages/zend-service-rackspace: 'https://github.com/zf1s/zend-service-rackspace.git'
Expand Down
1 change: 1 addition & 0 deletions packages/zend-amf/library/Zend/Amf/Adobe/Introspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
class Zend_Amf_Adobe_Introspector
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
class Zend_Amf_Parse_Amf0_Serializer extends Zend_Amf_Parse_Serializer
{
/**
Expand Down
1 change: 1 addition & 0 deletions packages/zend-amf/library/Zend/Amf/Parse/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
abstract class Zend_Amf_Parse_Serializer
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
abstract class Zend_Application_Bootstrap_BootstrapAbstract
implements Zend_Application_Bootstrap_Bootstrapper,
Zend_Application_Bootstrap_ResourceBootstrapper
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,19 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
abstract class Zend_Cloud_Infrastructure_Adapter_AbstractAdapter implements Zend_Cloud_Infrastructure_Adapter
{
/**
* Store the last response from the adpter
*
*
* @var array
*/
protected $adapterResult;

/**
* Valid metrics for monitor
*
*
* @var array
*/
protected $validMetrics = array(
Expand All @@ -65,10 +66,10 @@ public function getAdapterResult()

/**
* Wait for status $status with a timeout of $timeout seconds
*
*
* @param string $id
* @param string $status
* @param integer $timeout
* @param integer $timeout
* @return boolean
*/
public function waitStatusInstance($id, $status, $timeout = self::TIMEOUT_STATUS_CHANGE)
Expand All @@ -92,7 +93,7 @@ public function waitStatusInstance($id, $status, $timeout = self::TIMEOUT_STATUS
* @param array $param
* @param string|array $cmd
* @return string|array
*/
*/
public function deployInstance($id, $params, $cmd)
{
if (!function_exists("ssh2_connect")) {
Expand All @@ -110,9 +111,9 @@ public function deployInstance($id, $params, $cmd)
throw new Zend_Cloud_Infrastructure_Exception('You must specify the shell commands to run on the instance');
}

if (empty($params)
|| empty($params[Zend_Cloud_Infrastructure_Instance::SSH_USERNAME])
|| (empty($params[Zend_Cloud_Infrastructure_Instance::SSH_PASSWORD])
if (empty($params)
|| empty($params[Zend_Cloud_Infrastructure_Instance::SSH_USERNAME])
|| (empty($params[Zend_Cloud_Infrastructure_Instance::SSH_PASSWORD])
&& empty($params[Zend_Cloud_Infrastructure_Instance::SSH_KEY]))
) {
// require_once 'Zend/Cloud/Infrastructure/Exception.php';
Expand All @@ -123,13 +124,13 @@ public function deployInstance($id, $params, $cmd)
if (empty($host)) {
// require_once 'Zend/Cloud/Infrastructure/Exception.php';
throw new Zend_Cloud_Infrastructure_Exception(sprintf(
'The instance identified by "%s" does not exist',
'The instance identified by "%s" does not exist',
$id
));
}

$conn = ssh2_connect($host);
if (!ssh2_auth_password($conn, $params[Zend_Cloud_Infrastructure_Instance::SSH_USERNAME],
if (!ssh2_auth_password($conn, $params[Zend_Cloud_Infrastructure_Instance::SSH_USERNAME],
$params[Zend_Cloud_Infrastructure_Instance::SSH_PASSWORD])) {
// require_once 'Zend/Cloud/Infrastructure/Exception.php';
throw new Zend_Cloud_Infrastructure_Exception('SSH authentication failed');
Expand All @@ -142,11 +143,11 @@ public function deployInstance($id, $params, $cmd)
$errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR);

stream_set_blocking($errorStream, true);
stream_set_blocking($stream, true);
stream_set_blocking($stream, true);

$output = stream_get_contents($stream);
$error = stream_get_contents($errorStream);

if (empty($error)) {
$result[$command] = $output;
} else {
Expand All @@ -159,17 +160,17 @@ public function deployInstance($id, $params, $cmd)
$errorStream = ssh2_fetch_stream($stream, SSH2_STREAM_STDERR);

stream_set_blocking($errorStream, true);
stream_set_blocking($stream, true);
stream_set_blocking($stream, true);

$output = stream_get_contents($stream);
$error = stream_get_contents($errorStream);

if (empty($error)) {
$result = $output;
} else {
$result = $error;
}
}
}
return $result;
}
}
7 changes: 4 additions & 3 deletions packages/zend-console-getopt/library/Zend/Console/Getopt.php
Original file line number Diff line number Diff line change
Expand Up @@ -524,9 +524,9 @@ public function toXml()
$doc->appendChild($optionsNode);
foreach ($this->_options as $flag => $value) {
$optionNode = $doc->createElement('option');
$optionNode->setAttribute('flag', utf8_encode($flag));
$optionNode->setAttribute('flag', mb_convert_encoding($flag, 'UTF-8', 'ISO-8859-1'));
if ($value !== true) {
$optionNode->setAttribute('parameter', utf8_encode($value));
$optionNode->setAttribute('parameter', mb_convert_encoding($value, 'UTF-8', 'ISO-8859-1'));
}
$optionsNode->appendChild($optionNode);
}
Expand Down Expand Up @@ -784,7 +784,8 @@ protected function _parseLongOption(&$argv)
protected function _parseShortOptionCluster(&$argv)
{
$flagCluster = ltrim((string) array_shift($argv), '-');
foreach (str_split($flagCluster) as $flag) {
$splitString = $flagCluster === '' ? [''] : str_split($flagCluster);
foreach ($splitString as $flag) {
$this->_parseSingleOption($flag, $argv);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public function addControllerDirectory($path, $args = null);
* Specify a string or an array; if an array is specified, all paths will be
* added.
*
* @param string|array $dir
* @return Zend_Controller_Dispatcher_Interface
*/
public function setControllerDirectory($path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public function getErrorHandlerAction()
* Route shutdown hook -- Ccheck for router exceptions
*
* @param Zend_Controller_Request_Abstract $request
* @return void
*/
public function routeShutdown(Zend_Controller_Request_Abstract $request)
{
Expand All @@ -206,6 +207,7 @@ public function routeShutdown(Zend_Controller_Request_Abstract $request)
* necessary
*
* @param Zend_Controller_Request_Abstract $request
* @return void
*/
public function preDispatch(Zend_Controller_Request_Abstract $request)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
abstract class Zend_Controller_Router_Route_Abstract implements Zend_Controller_Router_Route_Interface
{
/**
Expand Down
1 change: 1 addition & 0 deletions packages/zend-exception/library/Zend/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
class Zend_Exception extends Exception
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
class Zend_Feed_Writer_Feed_FeedAbstract
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/
#[AllowDynamicProperties]
abstract class Zend_Form_Decorator_Abstract implements Zend_Form_Decorator_Interface
{
/**
Expand Down
1 change: 1 addition & 0 deletions packages/zend-form/library/Zend/Form/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/
#[AllowDynamicProperties]
class Zend_Form_Element implements Zend_Validate_Interface
{
/**
Expand Down
4 changes: 2 additions & 2 deletions packages/zend-gdata/library/Zend/Gdata/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -1087,11 +1087,11 @@ public function __call($method, $args)
} else {
// require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception(
"Unable to find '${class}' in registered packages");
"Unable to find '{$class}' in registered packages");
}
} else {
// require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception("No such method ${method}");
throw new Zend_Gdata_App_Exception("No such method {$method}");
}
}

Expand Down
4 changes: 2 additions & 2 deletions packages/zend-gdata/library/Zend/Gdata/App/Base.php
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ public function transferFromXML($xml)
{
if ($xml) {
error_clear_last();

// Load the feed as an XML DOMDocument object
$doc = new DOMDocument();
$doc = @Zend_Xml_Security::scan($xml, $doc);
Expand Down Expand Up @@ -482,7 +482,7 @@ public function __get($name)
$method = 'get'.ucfirst($name);
if (method_exists($this, $method)) {
return call_user_func(array(&$this, $method));
} else if (property_exists($this, "_${name}")) {
} else if (property_exists($this, "_{$name}")) {
return $this->{'_' . $name};
} else {
// require_once 'Zend/Gdata/App/InvalidArgumentException.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public function __get($name)
$method = 'get'.ucfirst($name);
if (method_exists($this, $method)) {
return call_user_func(array(&$this, $method));
} else if (property_exists($this, "_${name}")) {
} else if (property_exists($this, "_{$name}")) {
return $this->{'_' . $name};
} else {
// require_once 'Zend/Gdata/App/InvalidArgumentException.php';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function log($message)
*/
public function connect($host, $port = 80, $secure = false)
{
$this->log("Connecting to: ${host}:${port}");
$this->log("Connecting to: {$host}:{$port}");
return parent::connect($host, $port, $secure);
}

Expand Down Expand Up @@ -102,7 +102,7 @@ public function write($method, $uri, $http_ver = '1.1', $headers = array(), $bod
public function read()
{
$response = parent::read();
$this->log("${response}\n\n");
$this->log("{$response}\n\n");
return $response;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/zend-gdata/library/Zend/Gdata/Gapps.php
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ public function __call($method, $args) {
} else {
// require_once 'Zend/Gdata/App/Exception.php';
throw new Zend_Gdata_App_Exception(
"Unable to find '${class}' in registered packages");
"Unable to find '{$class}' in registered packages");
}
} else {
return parent::__call($method, $args);
Expand Down
1 change: 1 addition & 0 deletions packages/zend-http/library/Zend/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
class Zend_Http_Client
{
/**
Expand Down
1 change: 1 addition & 0 deletions packages/zend-http/library/Zend/Http/Header/SetCookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
class Zend_Http_Header_SetCookie
{

Expand Down
1 change: 1 addition & 0 deletions packages/zend-json/library/Zend/Json/Decoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
class Zend_Json_Decoder
{
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
class Zend_Loader_Autoloader_Resource implements Zend_Loader_Autoloader_Interface
{
/**
Expand Down
1 change: 1 addition & 0 deletions packages/zend-pdf/library/Zend/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
class Zend_Pdf
{
/**** Class Constants ****/
Expand Down
1 change: 1 addition & 0 deletions packages/zend-pdf/library/Zend/Pdf/Parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
class Zend_Pdf_Parser
{
/**
Expand Down
1 change: 1 addition & 0 deletions packages/zend-pdf/library/Zend/Pdf/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
#[AllowDynamicProperties]
abstract class Zend_Pdf_Resource
{
/**
Expand Down
Loading

0 comments on commit 3f9b225

Please sign in to comment.