Skip to content
This repository was archived by the owner on Oct 16, 2019. It is now read-only.

Commit 90d8d4f

Browse files
authored
PHP 7.2 support change
1 parent 10c11f9 commit 90d8d4f

File tree

7 files changed

+15
-42
lines changed

7 files changed

+15
-42
lines changed

library/Zend/Cache/Frontend/Page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ protected function _makePartialId($arrayName, $bool1, $bool2)
395395
}
396396
return '';
397397
}
398-
if (count($var) > 0) {
398+
if (is_array($var) && count($var) > 0) {
399399
return false;
400400
}
401401
return '';

library/Zend/Config/Yaml.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -362,11 +362,11 @@ protected static function _parseValue($value)
362362
$value = trim($value);
363363

364364
// remove quotes from string.
365-
if ('"' == $value['0']) {
366-
if ('"' == $value[count($value) -1]) {
365+
if ('"' == substr($value, 0, 1)) {
366+
if ('"' == substr($value, -1)) {
367367
$value = substr($value, 1, -1);
368368
}
369-
} elseif ('\'' == $value['0'] && '\'' == $value[count($value) -1]) {
369+
} elseif ('\'' == substr($value, 0, 1) && '\'' == substr($value, -1)) {
370370
$value = strtr($value, array("''" => "'", "'" => ''));
371371
}
372372

library/Zend/Controller/Action/Interface.php

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,6 @@
2929
*/
3030
interface Zend_Controller_Action_Interface
3131
{
32-
/**
33-
* Class constructor
34-
*
35-
* The request and response objects should be registered with the
36-
* controller, as should be any additional optional arguments; these will be
37-
* available via {@link getRequest()}, {@link getResponse()}, and
38-
* {@link getInvokeArgs()}, respectively.
39-
*
40-
* When overriding the constructor, please consider this usage as a best
41-
* practice and ensure that each is registered appropriately; the easiest
42-
* way to do so is to simply call parent::__construct($request, $response,
43-
* $invokeArgs).
44-
*
45-
* After the request, response, and invokeArgs are set, the
46-
* {@link $_helper helper broker} is initialized.
47-
*
48-
* Finally, {@link init()} is called as the final action of
49-
* instantiation, and may be safely overridden to perform initialization
50-
* tasks; as a general rule, override {@link init()} instead of the
51-
* constructor to customize an action controller's instantiation.
52-
*
53-
* @param Zend_Controller_Request_Abstract $request
54-
* @param Zend_Controller_Response_Abstract $response
55-
* @param array $invokeArgs Any additional invocation arguments
56-
* @return void
57-
*/
58-
public function __construct(Zend_Controller_Request_Abstract $request,
59-
Zend_Controller_Response_Abstract $response,
60-
array $invokeArgs = array());
61-
6232
/**
6333
* Dispatch the requested action
6434
*

library/Zend/Db/Table/Abstract.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -789,7 +789,7 @@ protected function _setupTableName()
789789
*/
790790
protected function _setupMetadata()
791791
{
792-
if ($this->metadataCacheInClass() && (count($this->_metadata) > 0)) {
792+
if ($this->metadataCacheInClass() && is_array($this->_metadata) && count($this->_metadata) > 0) {
793793
return true;
794794
}
795795

@@ -1304,7 +1304,10 @@ public function find()
13041304
$whereList = array();
13051305
$numberTerms = 0;
13061306
foreach ($args as $keyPosition => $keyValues) {
1307-
$keyValuesCount = count($keyValues);
1307+
// If the value is a string, cast it to int to be Countable.
1308+
// The coercion to array could be done first, but if so we
1309+
// are to be sure the string value is always '1'.
1310+
$keyValuesCount = gettype($keyValues) === 'string' ? (int) $keyValues : count($keyValues);
13081311
// Coerce the values to an array.
13091312
// Don't simply typecast to array, because the values
13101313
// might be Zend_Db_Expr objects.

library/Zend/Feed/Element.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ public function __get($var)
193193
if ($length == 1) {
194194
return new Zend_Feed_Element($nodes[0]);
195195
} elseif ($length > 1) {
196-
return array_map(create_function('$e', 'return new Zend_Feed_Element($e);'), $nodes);
196+
return array_map(function ($e) { return new Zend_Feed_Element($e); }, $nodes);
197197
} else {
198198
// When creating anonymous nodes for __set chaining, don't
199199
// call appendChild() on them. Instead we pass the current

library/Zend/File/Transfer/Adapter/Abstract.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,10 @@ public function addPrefixPaths(array $spec)
324324
/**
325325
* Adds a new validator for this class
326326
*
327-
* @param string|array $validator Type of validator to add
328-
* @param boolean $breakChainOnFailure If the validation chain should stop an failure
329-
* @param string|array $options Options to set for the validator
330-
* @param string|array $files Files to limit this validator to
327+
* @param string|array|Zend_Validate_Interface $validator Type of validator to add
328+
* @param boolean $breakChainOnFailure If the validation chain should stop an failure
329+
* @param string|array $options Options to set for the validator
330+
* @param string|array $files Files to limit this validator to
331331
* @return Zend_File_Transfer_Adapter
332332
*/
333333
public function addValidator($validator, $breakChainOnFailure = false, $options = null, $files = null)

library/Zend/Validate/File/Upload.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public function setFiles($files = array())
161161
*/
162162
public function isValid($value, $file = null)
163163
{
164-
$this->_messages = null;
164+
$this->_messages = array();
165165
if (array_key_exists($value, $this->_files)) {
166166
$files[$value] = $this->_files[$value];
167167
} else {

0 commit comments

Comments
 (0)