address Scrutinizer reported issues

This commit is contained in:
El RIDO 2025-07-19 21:01:38 +02:00
parent cbc0d99c59
commit 70842cf271
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
6 changed files with 45 additions and 47 deletions

View file

@ -69,10 +69,7 @@ class Filesystem extends AbstractData
public function __construct(array $options)
{
// if given update the data directory
if (
is_array($options) &&
array_key_exists('dir', $options)
) {
if (array_key_exists('dir', $options)) {
$this->_path = $options['dir'];
}
}
@ -315,7 +312,7 @@ class Filesystem extends AbstractData
$file = $this->_path . DIRECTORY_SEPARATOR . 'salt.php';
if (is_readable($file)) {
$items = explode('|', file_get_contents($file));
if (is_array($items) && count($items) == 3) {
if (count($items) == 3) {
return $items[1];
}
}
@ -505,7 +502,7 @@ class Filesystem extends AbstractData
if ($fileCreated === false || $writtenBytes === false || $writtenBytes < strlen($data)) {
return false;
}
@chmod($filename, 0640); // protect file from access by other users on the host
chmod($filename, 0640); // protect file from access by other users on the host
return true;
}