Skip to content

Commit 37d24c7

Browse files
Change bitnamy docker images to bitnamylegacy
Fix PHPStan errors on Zend_Amf_Parse_Amf3_Serializer, Zend_Acl & Zend_Auth_Storage_NonPersistent Fix errors on Couchbase and Rediscluster cache backends Fix tests to match custom changes
1 parent 8134909 commit 37d24c7

File tree

33 files changed

+440
-421
lines changed

33 files changed

+440
-421
lines changed

.github/workflows/phpunit.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555
- 11211:11211
5656

5757
mysql:
58-
image: bitnami/mysql:8.0.31
58+
image: bitnamilegacy/mysql:8.0.31
5959
env:
6060
MYSQL_ROOT_USER: ${{ env.TESTS_ZEND_DB_ADAPTER_MYSQL_USERNAME }}
6161
MYSQL_ROOT_PASSWORD: ${{ env.TESTS_ZEND_DB_ADAPTER_MYSQL_PASSWORD }}
@@ -84,7 +84,7 @@ jobs:
8484
--health-retries 5
8585
8686
openldap:
87-
image: bitnami/openldap:2.5
87+
image: bitnamilegacy/openldap:2.5
8888
ports:
8989
- 1389:1389
9090
env:

library/Zend/Amf/Parse/Amf3/Serializer.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,14 +359,26 @@ public function writeArray(&$array)
359359
$this->writeInteger($id);
360360

361361
//Write the mixed type array to the output stream
362+
/**
363+
* @phpstan-ignore-next-line
364+
*/
362365
foreach($string as $key => &$value) {
363366
$this->writeString($key)
367+
/**
368+
* @phpstan-ignore-next-line
369+
*/
364370
->writeTypeMarker($value);
365371
}
366372
$this->writeString($this->_strEmpty);
367373

368374
// Write the numeric array to ouput stream
375+
/**
376+
* @phpstan-ignore-next-line
377+
*/
369378
foreach($numeric as &$value) {
379+
/**
380+
* @phpstan-ignore-next-line
381+
*/
370382
$this->writeTypeMarker($value);
371383
}
372384
return $this;

library/Zend/Auth/Storage/NonPersistent.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class Zend_Auth_Storage_NonPersistent implements Zend_Auth_Storage_Interface
5050
/**
5151
* Returns true if and only if storage is empty
5252
*
53-
* @throws Zend_Auth_Storage_Exception If it is impossible to determine whether storage is empty
5453
* @return boolean
5554
*/
5655
public function isEmpty()
@@ -62,7 +61,6 @@ public function isEmpty()
6261
* Returns the contents of storage
6362
* Behavior is undefined when storage is empty.
6463
*
65-
* @throws Zend_Auth_Storage_Exception If reading contents from storage is impossible
6664
* @return mixed
6765
*/
6866
public function read()
@@ -74,7 +72,6 @@ public function read()
7472
* Writes $contents to storage
7573
*
7674
* @param mixed $contents
77-
* @throws Zend_Auth_Storage_Exception If writing $contents to storage is impossible
7875
* @return void
7976
*/
8077
public function write($contents)
@@ -85,7 +82,6 @@ public function write($contents)
8582
/**
8683
* Clears contents from storage
8784
*
88-
* @throws Zend_Auth_Storage_Exception If clearing contents from storage is impossible
8985
* @return void
9086
*/
9187
public function clear()

library/Zend/Cache/Backend/Couchbase.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,23 +67,23 @@ class Zend_Cache_Backend_Couchbase extends Zend_Cache_Backend implements Zend_Ca
6767
const METHOD_UNSUPPORTED_BY_COUCHBASE_BACKEND = 'method unsupported by Zend_Cache_Backend_Couchbase';
6868
const TAGS_UNSUPPORTED_BY = 'tags unsupported by Zend_Cache_Backend_Couchbase';
6969

70-
protected $_options = array(
71-
'servers' => array(array(
70+
protected $_options = [
71+
'servers' => [[
7272
'host' => self::DEFAULT_HOST,
7373
'operation_timeout' => self::DEFAULT_TIMEOUT,
7474
'config_total_timeout' => self::DEFAULT_TOTAL_TIMEOUT,
7575
'config_node_timeout' => self::DEFAULT_NODE_TIMEOUT,
7676
'durabilty_timeout' => self::DEFAULT_DURABILITY_TIMEOUT,
7777
'durabilty_interval' => self::DEFAULT_DURABILITY_INTERVAL,
7878
'randomize_nodes' => self::RANDOMIZE_NODES_CONNECTION
79-
)),
79+
]],
8080
'port' => self::DEFAULT_PORT,
8181
'bucket' => self::DEFAULT_BUCKET,
8282
'compression' => false,
8383
'compatibility' => false,
8484
'write_control' => false,
8585
'password' => self::DEFAULT_PASSWORD,
86-
);
86+
];
8787

8888
/**
8989
* Couchbase object
@@ -420,14 +420,14 @@ public function getMetadatas($id)
420420
*/
421421
public function getCapabilities()
422422
{
423-
return array(
423+
return [
424424
'automatic_cleaning' => false,
425425
'tags' => false,
426426
'expired_read' => false,
427427
'priority' => false,
428428
'infinite_lifetime' => false,
429429
'get_list' => false
430-
);
430+
];
431431
}
432432

433433
}

library/Zend/Cache/Backend/Libmemcached.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ public function loadMulti($ids = [])
512512
return $data;
513513
}
514514

515-
public function saveMulti($data, $tags = array(), $specificLifetime = false)
515+
public function saveMulti($data, $tags = [], $specificLifetime = false)
516516
{
517517
$result = false;
518518
if (is_array($data)) {

library/Zend/Cache/Backend/Redis.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,17 @@ class Zend_Cache_Backend_Redis extends Zend_Cache_Backend implements Zend_Cache_
6262
const DEFAULT_PERSISTENT = true;
6363
const DEFAULT_DBINDEX = 0;
6464

65-
protected $_options = array(
66-
'servers' => array(
67-
array(
65+
protected $_options = [
66+
'servers' => [
67+
[
6868
'host' => self::DEFAULT_HOST,
6969
'port' => self::DEFAULT_PORT,
7070
'persistent' => self::DEFAULT_PERSISTENT,
7171
'dbindex' => self::DEFAULT_DBINDEX,
72-
),
73-
),
72+
],
73+
],
7474
'key_prefix' => '',
75-
);
75+
];
7676

7777
/**
7878
* Redis object
@@ -206,9 +206,9 @@ public function save($data, $id, $tags =[], $specificLifetime = false)
206206
$lifetime = $this->getLifetime($specificLifetime);
207207

208208
if (!$tags || !count($tags))
209-
$tags = array('');
209+
$tags = [''];
210210
if (is_string($tags))
211-
$tags = array($tags);
211+
$tags = [$tags];
212212

213213
if (!count($tags)) {
214214
$this->_redis->delete($this->_keyFromItemTags($id));
@@ -255,7 +255,7 @@ public function save($data, $id, $tags =[], $specificLifetime = false)
255255
$redis = $redis->setex($this->_keyFromId($id), $lifetime, $data);
256256
}
257257

258-
$itemTags = array($this->_keyFromItemTags($id));
258+
$itemTags = [$this->_keyFromItemTags($id)];
259259
foreach ($tags as $tag) {
260260
$itemTags[] = $tag;
261261
if ($tag) {
@@ -268,9 +268,9 @@ public function save($data, $id, $tags =[], $specificLifetime = false)
268268
}
269269
if (count($itemTags) > 1) {
270270
if (!$redis)
271-
$return[] = call_user_func_array(array($this->_redis, 'sAdd'), $itemTags);
271+
$return[] = call_user_func_array([$this->_redis, 'sAdd'], $itemTags);
272272
else
273-
$redis = call_user_func_array(array($redis, 'sAdd'), $itemTags);
273+
$redis = call_user_func_array([$redis, 'sAdd'], $itemTags);
274274
}
275275

276276
if ($lifetime !== null) {
@@ -381,7 +381,7 @@ public function remove($id, $hardReset = false)
381381
if (!$id)
382382
return false;
383383
if (is_string($id))
384-
$id = array($id);
384+
$id = [$id];
385385
if (!count($id))
386386
return false;
387387
$deleteIds = [];
@@ -410,7 +410,7 @@ public function removeTag($tag)
410410
if (!$tag)
411411
return false;
412412
if (is_string($tag))
413-
$id = array($tag);
413+
$id = [$tag];
414414
if (!count($tag))
415415
return false;
416416
$deleteTags = [];
@@ -457,7 +457,7 @@ public function addToSet($member, $set, $specificLifetime = false)
457457

458458
if (is_array($member)) {
459459
$redis = $this->_redis;
460-
$return = call_user_func_array(array($redis, 'sAdd'), array_merge(array($this->_keyFromId($set)), $member));
460+
$return = call_user_func_array([$redis, 'sAdd'], array_merge([$this->_keyFromId($set)], $member));
461461
} else {
462462
$return = $this->_redis->sAdd($this->_keyFromId($set), $member);
463463
}
@@ -483,7 +483,7 @@ public function removeFromSet($member, $set)
483483
if (!count($member))
484484
return true;
485485
$redis = $this->_redis;
486-
$return = call_user_func_array(array($redis, 'sRem'), array_merge(array($this->_keyFromId($set)), $member));
486+
$return = call_user_func_array([$redis, 'sRem'], array_merge([$this->_keyFromId($set)], $member));
487487
} else {
488488
$return = $this->_redis->sRem($this->_keyFromId($set), $member);
489489
}
@@ -652,7 +652,7 @@ public function getIdsMatchingTags($tags = [])
652652
if (!$tags)
653653
return [];
654654
if ($tags && is_string($tags))
655-
$tags = array($tags);
655+
$tags = [$tags];
656656

657657
$matchTags = [];
658658
foreach ($tags as $tag) {
@@ -693,7 +693,7 @@ public function getIdsMatchingAnyTags($tags = [])
693693
if (!$tags)
694694
return [];
695695
if ($tags && is_string($tags))
696-
$tags = array($tags);
696+
$tags = [$tags];
697697

698698
$return = [];
699699
foreach ($tags as $tag) {
@@ -798,13 +798,13 @@ protected function _touchKey($id, $extraLifetime)
798798
*/
799799
public function getCapabilities()
800800
{
801-
return array(
801+
return [
802802
'automatic_cleaning' => true,
803803
'tags' => true,
804804
'expired_read' => false,
805805
'priority' => false,
806806
'infinite_lifetime' => true,
807807
'get_list' => false
808-
);
808+
];
809809
}
810810
}

library/Zend/Cache/Backend/RedisCluster.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ class Zend_Cache_Backend_RedisCluster extends Zend_Cache_Backend implements Zend
8989
'write_control' => false,
9090
];
9191

92+
/**
93+
* @var string
94+
*/
95+
protected $_compressPrefix = '';
96+
9297
/**
9398
* @var int
9499
*/
@@ -456,7 +461,7 @@ public function getIdsNotMatchingTags($tags = [])
456461
* @param array $tags array of tags
457462
* @return array array of any matching cache ids (string)
458463
*/
459-
public function getIdsMatchingAnyTags($tags = array())
464+
public function getIdsMatchingAnyTags($tags = [])
460465
{
461466
$this->_log(self::METHOD_UNSUPPORTED_BY_REDISCLUSTER_BACKEND);
462467
return [];

library/Zend/Controller/Router/Route.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ public function assemble($data = [], $reset = false, $encode = false, $partial =
450450
unset($data[$variable]);
451451
}
452452

453-
if (!empty($data) && !$partial) {
453+
if (!empty($data) && count($data) > 0 && !$partial) {
454454
$return = $return . '?'. http_build_query($data);
455455
}
456456

library/Zend/Db/Select.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ public function useIndex($index)
14501450
{
14511451
if(empty($this->_parts[self::FORCE_INDEX])) {
14521452
if(!is_array($index)) {
1453-
$index = array($index);
1453+
$index = [$index];
14541454
}
14551455
$this->_parts[self::USE_INDEX] = $index;
14561456
return $this;
@@ -1468,7 +1468,7 @@ public function forceIndex($index)
14681468
{
14691469
if(empty($this->_parts[self::USE_INDEX])) {
14701470
if(!is_array($index)) {
1471-
$index = array($index);
1471+
$index = [$index];
14721472
}
14731473
$this->_parts[self::FORCE_INDEX] = $index;
14741474
return $this;

library/Zend/Translate/Adapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,7 @@ public function translate($messageId, $locale = null)
785785

786786
$rule = Zend_Translate_Plural::getPlural($number, $regionlessLocale);
787787
if (isset($this->_translate[$regionlessLocale][$plural[0]][$rule])) {
788-
$this->_routed = array();
788+
$this->_routed = [];
789789
return $this->_translate[$regionlessLocale][$plural[0]][$rule];
790790
}
791791

0 commit comments

Comments
 (0)