Skip to content

Commit

Permalink
better-typing-v2 (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-worman authored Apr 10, 2024
1 parent 18b7932 commit c5ee85d
Show file tree
Hide file tree
Showing 247 changed files with 2,146 additions and 2,142 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
experimental:
- false
php:
- "8.2"
- "8.3"

env:
Expand Down Expand Up @@ -64,7 +63,7 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup PHP ${{ matrix.php }}
uses: shivammathur/setup-php@v2
Expand Down
4 changes: 2 additions & 2 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": "~8.2 || ~8.3",
"php": "~8.3",
"ext-ctype": "*",
"ext-dom": "*",
"ext-gd": "*",
Expand All @@ -18,7 +18,7 @@
"ext-zlib": "*"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.47",
"friendsofphp/php-cs-fixer": "^3.53",
"jworman/dbunit": "5.0.0",
"jworman/phpunit": "1.0.0",
"php-parallel-lint/php-parallel-lint": "1.3.0",
Expand Down
40 changes: 20 additions & 20 deletions packages/zend-acl/library/Zend/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,13 @@ class Zend_Acl
'allPrivileges' => [
'type' => self::TYPE_DENY,
'assert' => null,
],
'byPrivilegeId' => [],
],
'byRoleId' => [],
'byPrivilegeId' => [],
],
'byRoleId' => [],
],
'byResourceId' => [],
];
];

/**
* Adds a Role having an identifier unique to the registry.
Expand Down Expand Up @@ -326,7 +326,7 @@ public function addResource($resource, $parent = null)
'instance' => $resource,
'parent' => $resourceParent,
'children' => [],
];
];

return $this;
}
Expand Down Expand Up @@ -515,7 +515,7 @@ public function removeAll()
*
* @return Zend_Acl Provides a fluent interface
*/
public function allow($roles = null, $resources = null, $privileges = null, Zend_Acl_Assert_Interface $assert = null)
public function allow($roles = null, $resources = null, $privileges = null, ?Zend_Acl_Assert_Interface $assert = null)
{
return $this->setRule(self::OP_ADD, self::TYPE_ALLOW, $roles, $resources, $privileges, $assert);
}
Expand All @@ -531,7 +531,7 @@ public function allow($roles = null, $resources = null, $privileges = null, Zend
*
* @return Zend_Acl Provides a fluent interface
*/
public function deny($roles = null, $resources = null, $privileges = null, Zend_Acl_Assert_Interface $assert = null)
public function deny($roles = null, $resources = null, $privileges = null, ?Zend_Acl_Assert_Interface $assert = null)
{
return $this->setRule(self::OP_ADD, self::TYPE_DENY, $roles, $resources, $privileges, $assert);
}
Expand Down Expand Up @@ -623,7 +623,7 @@ public function removeDeny($roles = null, $resources = null, $privileges = null)
* @uses Zend_Acl::get()
*/
public function setRule($operation, $type, $roles = null, $resources = null, $privileges = null,
Zend_Acl_Assert_Interface $assert = null)
?Zend_Acl_Assert_Interface $assert = null)
{
// ensure that the rule type is valid; normalize input to uppercase
$type = strtoupper((string) $type);
Expand Down Expand Up @@ -737,9 +737,9 @@ public function setRule($operation, $type, $roles = null, $resources = null, $pr
'allPrivileges' => [
'type' => self::TYPE_DENY,
'assert' => null,
],
],
'byPrivilegeId' => [],
];
];
}
continue;
}
Expand Down Expand Up @@ -778,9 +778,9 @@ public function setRule($operation, $type, $roles = null, $resources = null, $pr
'allPrivileges' => [
'type' => self::TYPE_DENY,
'assert' => null,
],
],
'byPrivilegeId' => [],
];
];
}
continue;
}
Expand Down Expand Up @@ -935,12 +935,12 @@ protected function _getRoleRegistry()
*
* @return bool|null
*/
protected function _roleDFSAllPrivileges(Zend_Acl_Role_Interface $role, Zend_Acl_Resource_Interface $resource = null)
protected function _roleDFSAllPrivileges(Zend_Acl_Role_Interface $role, ?Zend_Acl_Resource_Interface $resource = null)
{
$dfs = [
'visited' => [],
'stack' => [],
];
];

if (null !== ($result = $this->_roleDFSVisitAllPrivileges($role, $resource, $dfs))) {
return $result;
Expand Down Expand Up @@ -971,7 +971,7 @@ protected function _roleDFSAllPrivileges(Zend_Acl_Role_Interface $role, Zend_Acl
*
* @throws Zend_Acl_Exception
*/
protected function _roleDFSVisitAllPrivileges(Zend_Acl_Role_Interface $role, Zend_Acl_Resource_Interface $resource = null,
protected function _roleDFSVisitAllPrivileges(Zend_Acl_Role_Interface $role, ?Zend_Acl_Resource_Interface $resource = null,
&$dfs = null)
{
if (null === $dfs) {
Expand Down Expand Up @@ -1014,7 +1014,7 @@ protected function _roleDFSVisitAllPrivileges(Zend_Acl_Role_Interface $role, Zen
*
* @throws Zend_Acl_Exception
*/
protected function _roleDFSOnePrivilege(Zend_Acl_Role_Interface $role, Zend_Acl_Resource_Interface $resource = null,
protected function _roleDFSOnePrivilege(Zend_Acl_Role_Interface $role, ?Zend_Acl_Resource_Interface $resource = null,
$privilege = null)
{
if (null === $privilege) {
Expand All @@ -1028,7 +1028,7 @@ protected function _roleDFSOnePrivilege(Zend_Acl_Role_Interface $role, Zend_Acl_
$dfs = [
'visited' => [],
'stack' => [],
];
];

if (null !== ($result = $this->_roleDFSVisitOnePrivilege($role, $resource, $privilege, $dfs))) {
return $result;
Expand Down Expand Up @@ -1060,7 +1060,7 @@ protected function _roleDFSOnePrivilege(Zend_Acl_Role_Interface $role, Zend_Acl_
*
* @throws Zend_Acl_Exception
*/
protected function _roleDFSVisitOnePrivilege(Zend_Acl_Role_Interface $role, Zend_Acl_Resource_Interface $resource = null,
protected function _roleDFSVisitOnePrivilege(Zend_Acl_Role_Interface $role, ?Zend_Acl_Resource_Interface $resource = null,
$privilege = null, &$dfs = null)
{
if (null === $privilege) {
Expand Down Expand Up @@ -1113,7 +1113,7 @@ protected function _roleDFSVisitOnePrivilege(Zend_Acl_Role_Interface $role, Zend
*
* @return string|null
*/
protected function _getRuleType(Zend_Acl_Resource_Interface $resource = null, Zend_Acl_Role_Interface $role = null,
protected function _getRuleType(?Zend_Acl_Resource_Interface $resource = null, ?Zend_Acl_Role_Interface $role = null,
$privilege = null)
{
// get the rules for the $resource and $role
Expand Down Expand Up @@ -1168,7 +1168,7 @@ protected function _getRuleType(Zend_Acl_Resource_Interface $resource = null, Ze
*
* @return array|null
*/
protected function &_getRules(Zend_Acl_Resource_Interface $resource = null, Zend_Acl_Role_Interface $role = null,
protected function &_getRules(?Zend_Acl_Resource_Interface $resource = null, ?Zend_Acl_Role_Interface $role = null,
$create = false)
{
// create a reference to null
Expand Down
2 changes: 1 addition & 1 deletion packages/zend-acl/library/Zend/Acl/Assert/Interface.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ interface Zend_Acl_Assert_Interface
*
* @return bool
*/
public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null, Zend_Acl_Resource_Interface $resource = null,
public function assert(Zend_Acl $acl, ?Zend_Acl_Role_Interface $role = null, ?Zend_Acl_Resource_Interface $resource = null,
$privilege = null);
}
2 changes: 1 addition & 1 deletion packages/zend-acl/library/Zend/Acl/Role/Registry.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function add(Zend_Acl_Role_Interface $role, $parents = null)
'instance' => $role,
'parents' => $roleParents,
'children' => [],
];
];

return $this;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/zend-amf/library/Zend/Amf/Adobe/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function __construct($rolefile)
$this->_acl->addRole(new Zend_Acl_Role((string) $role['id']));
foreach ($role->user as $user) {
$this->_users[(string) $user['name']] = ['password' => (string) $user['password'],
'role' => (string) $role['id']];
'role' => (string) $role['id']];
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/zend-amf/library/Zend/Amf/Parse/Amf3/Serializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,10 +487,10 @@ public function writeObject($object)
}

$this->_referenceDefinitions[$className] = [
'id' => count($this->_referenceDefinitions),
'encoding' => $encoding,
'propertyNames' => $propertyNames,
];
'id' => count($this->_referenceDefinitions),
'encoding' => $encoding,
'propertyNames' => $propertyNames,
];

$traitsInfo = Zend_Amf_Constants::AMF3_OBJECT_ENCODING;
$traitsInfo |= $encoding << 2;
Expand Down
10 changes: 5 additions & 5 deletions packages/zend-amf/library/Zend/Amf/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,10 @@ protected function _errorMessage($objectEncoding, $message, $description, $detai
switch ($objectEncoding) {
case Zend_Amf_Constants::AMF0_OBJECT_ENCODING:
return [
'description' => ($this->isProduction()) ? '' : $description,
'detail' => ($this->isProduction()) ? '' : $detail,
'line' => ($this->isProduction()) ? 0 : $line,
'code' => $code,
'description' => ($this->isProduction()) ? '' : $description,
'detail' => ($this->isProduction()) ? '' : $detail,
'line' => ($this->isProduction()) ? 0 : $line,
'code' => $code,
];
case Zend_Amf_Constants::AMF3_OBJECT_ENCODING:
// require_once 'Zend/Amf/Value/Messaging/ErrorMessage.php';
Expand Down Expand Up @@ -922,7 +922,7 @@ protected function _buildDispatchTable()
*
* Unimplemented
*
* @param string|\Throwable $fault
* @param string|Throwable $fault
*
* @return void
*/
Expand Down
6 changes: 3 additions & 3 deletions packages/zend-auth/library/Zend/Auth/Adapter/DbTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Zend_Auth_Adapter_DbTable implements Zend_Auth_Adapter_Interface
* @param string $credentialColumn
* @param string $credentialTreatment
*/
public function __construct(Zend_Db_Adapter_Abstract $zendDb = null, $tableName = null, $identityColumn = null,
public function __construct(?Zend_Db_Adapter_Abstract $zendDb = null, $tableName = null, $identityColumn = null,
$credentialColumn = null, $credentialTreatment = null)
{
$this->_setDbAdapter($zendDb);
Expand Down Expand Up @@ -160,7 +160,7 @@ public function __construct(Zend_Db_Adapter_Abstract $zendDb = null, $tableName
*
* @throws Zend_Auth_Adapter_Exception
*/
protected function _setDbAdapter(Zend_Db_Adapter_Abstract $zendDb = null)
protected function _setDbAdapter(?Zend_Db_Adapter_Abstract $zendDb = null)
{
$this->_zendDb = $zendDb;

Expand Down Expand Up @@ -436,7 +436,7 @@ protected function _authenticateSetup()
'code' => Zend_Auth_Result::FAILURE,
'identity' => $this->_identity,
'messages' => [],
];
];

return true;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/zend-auth/library/Zend/Auth/Adapter/Digest.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ public function authenticate()
'identity' => [
'realm' => $this->_realm,
'username' => $this->_username,
],
],
'messages' => [],
];
];

while ($line = \trim((string) fgets($fileHandle))) {
if (substr((string) $line, 0, $idLength) === $id) {
Expand Down
2 changes: 1 addition & 1 deletion packages/zend-auth/library/Zend/Auth/Adapter/Ldap.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ protected function _prepareOptions(Zend_Ldap $ldap, array $options)
case 'groupScope':
$value = (int) $value;
if (in_array($value, [Zend_Ldap::SEARCH_SCOPE_BASE,
Zend_Ldap::SEARCH_SCOPE_ONE, Zend_Ldap::SEARCH_SCOPE_SUB], true)) {
Zend_Ldap::SEARCH_SCOPE_ONE, Zend_Ldap::SEARCH_SCOPE_SUB], true)) {
$adapterOptions[$key] = $value;
}
break;
Expand Down
4 changes: 2 additions & 2 deletions packages/zend-auth/library/Zend/Auth/Adapter/OpenId.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ class Zend_Auth_Adapter_OpenId implements Zend_Auth_Adapter_Interface
* object to perform HTTP or HTML form redirection
*/
public function __construct($id = null,
Zend_OpenId_Consumer_Storage $storage = null,
?Zend_OpenId_Consumer_Storage $storage = null,
$returnTo = null,
$root = null,
$extensions = null,
Zend_Controller_Response_Abstract $response = null)
?Zend_Controller_Response_Abstract $response = null)
{
$this->_id = $id;
$this->_storage = $storage;
Expand Down
74 changes: 37 additions & 37 deletions packages/zend-barcode/library/Zend/Barcode/Object/Code128.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,43 +54,43 @@ class Zend_Barcode_Object_Code128 extends Zend_Barcode_Object_ObjectAbstract
protected $_convertedText = [];

protected $_codingMap = [
0 => '11011001100', 1 => '11001101100', 2 => '11001100110',
3 => '10010011000', 4 => '10010001100', 5 => '10001001100',
6 => '10011001000', 7 => '10011000100', 8 => '10001100100',
9 => '11001001000', 10 => '11001000100', 11 => '11000100100',
12 => '10110011100', 13 => '10011011100', 14 => '10011001110',
15 => '10111001100', 16 => '10011101100', 17 => '10011100110',
18 => '11001110010', 19 => '11001011100', 20 => '11001001110',
21 => '11011100100', 22 => '11001110100', 23 => '11101101110',
24 => '11101001100', 25 => '11100101100', 26 => '11100100110',
27 => '11101100100', 28 => '11100110100', 29 => '11100110010',
30 => '11011011000', 31 => '11011000110', 32 => '11000110110',
33 => '10100011000', 34 => '10001011000', 35 => '10001000110',
36 => '10110001000', 37 => '10001101000', 38 => '10001100010',
39 => '11010001000', 40 => '11000101000', 41 => '11000100010',
42 => '10110111000', 43 => '10110001110', 44 => '10001101110',
45 => '10111011000', 46 => '10111000110', 47 => '10001110110',
48 => '11101110110', 49 => '11010001110', 50 => '11000101110',
51 => '11011101000', 52 => '11011100010', 53 => '11011101110',
54 => '11101011000', 55 => '11101000110', 56 => '11100010110',
57 => '11101101000', 58 => '11101100010', 59 => '11100011010',
60 => '11101111010', 61 => '11001000010', 62 => '11110001010',
63 => '10100110000', 64 => '10100001100', 65 => '10010110000',
66 => '10010000110', 67 => '10000101100', 68 => '10000100110',
69 => '10110010000', 70 => '10110000100', 71 => '10011010000',
72 => '10011000010', 73 => '10000110100', 74 => '10000110010',
75 => '11000010010', 76 => '11001010000', 77 => '11110111010',
78 => '11000010100', 79 => '10001111010', 80 => '10100111100',
81 => '10010111100', 82 => '10010011110', 83 => '10111100100',
84 => '10011110100', 85 => '10011110010', 86 => '11110100100',
87 => '11110010100', 88 => '11110010010', 89 => '11011011110',
90 => '11011110110', 91 => '11110110110', 92 => '10101111000',
93 => '10100011110', 94 => '10001011110', 95 => '10111101000',
96 => '10111100010', 97 => '11110101000', 98 => '11110100010',
99 => '10111011110', 100 => '10111101110', 101 => '11101011110',
102 => '11110101110',
103 => '11010000100', 104 => '11010010000', 105 => '11010011100',
106 => '1100011101011'];
0 => '11011001100', 1 => '11001101100', 2 => '11001100110',
3 => '10010011000', 4 => '10010001100', 5 => '10001001100',
6 => '10011001000', 7 => '10011000100', 8 => '10001100100',
9 => '11001001000', 10 => '11001000100', 11 => '11000100100',
12 => '10110011100', 13 => '10011011100', 14 => '10011001110',
15 => '10111001100', 16 => '10011101100', 17 => '10011100110',
18 => '11001110010', 19 => '11001011100', 20 => '11001001110',
21 => '11011100100', 22 => '11001110100', 23 => '11101101110',
24 => '11101001100', 25 => '11100101100', 26 => '11100100110',
27 => '11101100100', 28 => '11100110100', 29 => '11100110010',
30 => '11011011000', 31 => '11011000110', 32 => '11000110110',
33 => '10100011000', 34 => '10001011000', 35 => '10001000110',
36 => '10110001000', 37 => '10001101000', 38 => '10001100010',
39 => '11010001000', 40 => '11000101000', 41 => '11000100010',
42 => '10110111000', 43 => '10110001110', 44 => '10001101110',
45 => '10111011000', 46 => '10111000110', 47 => '10001110110',
48 => '11101110110', 49 => '11010001110', 50 => '11000101110',
51 => '11011101000', 52 => '11011100010', 53 => '11011101110',
54 => '11101011000', 55 => '11101000110', 56 => '11100010110',
57 => '11101101000', 58 => '11101100010', 59 => '11100011010',
60 => '11101111010', 61 => '11001000010', 62 => '11110001010',
63 => '10100110000', 64 => '10100001100', 65 => '10010110000',
66 => '10010000110', 67 => '10000101100', 68 => '10000100110',
69 => '10110010000', 70 => '10110000100', 71 => '10011010000',
72 => '10011000010', 73 => '10000110100', 74 => '10000110010',
75 => '11000010010', 76 => '11001010000', 77 => '11110111010',
78 => '11000010100', 79 => '10001111010', 80 => '10100111100',
81 => '10010111100', 82 => '10010011110', 83 => '10111100100',
84 => '10011110100', 85 => '10011110010', 86 => '11110100100',
87 => '11110010100', 88 => '11110010010', 89 => '11011011110',
90 => '11011110110', 91 => '11110110110', 92 => '10101111000',
93 => '10100011110', 94 => '10001011110', 95 => '10111101000',
96 => '10111100010', 97 => '11110101000', 98 => '11110100010',
99 => '10111011110', 100 => '10111101110', 101 => '11101011110',
102 => '11110101110',
103 => '11010000100', 104 => '11010010000', 105 => '11010011100',
106 => '1100011101011'];

/**
* Character sets ABC.
Expand Down
Loading

0 comments on commit c5ee85d

Please sign in to comment.