Skip to content

Commit a0085b7

Browse files
committed
Reorder paramters for consistency
1 parent 1ed125c commit a0085b7

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/Config/Settings.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace CodeIgniter\Settings\Config;
44

5+
use CodeIgniter\Settings\Handlers\ArrayHandler;
56
use CodeIgniter\Settings\Handlers\DatabaseHandler;
67

78
class Settings
@@ -15,6 +16,14 @@ class Settings
1516
*/
1617
public $handlers = ['database'];
1718

19+
/**
20+
* Array handler settings.
21+
*/
22+
public $array = [
23+
'class' => ArrayHandler::class,
24+
'writeable' => true,
25+
];
26+
1827
/**
1928
* Database handler settings.
2029
*/

src/Handlers/ArrayHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ protected function getStored(string $class, string $property, ?string $context)
8484
*
8585
* @param mixed $value
8686
*/
87-
protected function setStored(string $class, string $property, ?string $context, $value): void
87+
protected function setStored(string $class, string $property, $value, ?string $context): void
8888
{
8989
$type = gettype($value);
9090
$value = $this->prepareValue($value);

src/Handlers/DatabaseHandler.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public function set(string $class, string $property, $value = null, ?string $con
102102
}
103103

104104
// Update storage
105-
$this->setStored($class, $property, $context, $value);
105+
$this->setStored($class, $property, $value, $context);
106106

107107
return $result;
108108
}
@@ -167,7 +167,7 @@ private function hydrate(?string $context)
167167
}
168168

169169
foreach ($result->getResultObject() as $row) {
170-
$this->setStored($row->class, $row->key, $row->context, $this->parseValue($row->value, $row->type));
170+
$this->setStored($row->class, $row->key, $this->parseValue($row->value, $row->type), $row->context);
171171
}
172172
}
173173
}

0 commit comments

Comments
 (0)