aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Provider/Dce
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-11 18:41:34 +0000
committerMario <mario@mariovavti.com>2022-10-11 18:41:34 +0000
commit10ba98c4f5ec4efe6272516de47f0ce128ef2902 (patch)
treefbbde69114acba764cf6b735433c53e099fd19c5 /vendor/ramsey/uuid/src/Provider/Dce
parent108a3efe0b6d37a7ed394a84c69b924ca727f17a (diff)
downloadvolse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.tar.gz
volse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.tar.bz2
volse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.zip
Revert "update composer libs"
This reverts commit 108a3efe0b6d37a7ed394a84c69b924ca727f17a.
Diffstat (limited to 'vendor/ramsey/uuid/src/Provider/Dce')
-rw-r--r--vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php39
1 files changed, 21 insertions, 18 deletions
diff --git a/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php b/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php
index d5b6cf0c0..7ff407648 100644
--- a/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php
+++ b/vendor/ramsey/uuid/src/Provider/Dce/SystemDceSecurityProvider.php
@@ -21,6 +21,7 @@ use Ramsey\Uuid\Type\Integer as IntegerObject;
use function escapeshellarg;
use function preg_split;
use function str_getcsv;
+use function strpos;
use function strrpos;
use function strtolower;
use function strtoupper;
@@ -41,7 +42,6 @@ class SystemDceSecurityProvider implements DceSecurityProviderInterface
*/
public function getUid(): IntegerObject
{
- /** @var int|float|string|IntegerObject|null $uid */
static $uid = null;
if ($uid instanceof IntegerObject) {
@@ -72,7 +72,6 @@ class SystemDceSecurityProvider implements DceSecurityProviderInterface
*/
public function getGid(): IntegerObject
{
- /** @var int|float|string|IntegerObject|null $gid */
static $gid = null;
if ($gid instanceof IntegerObject) {
@@ -105,10 +104,15 @@ class SystemDceSecurityProvider implements DceSecurityProviderInterface
return '';
}
- return match ($this->getOs()) {
- 'WIN' => $this->getWindowsUid(),
- default => trim((string) shell_exec('id -u')),
- };
+ switch ($this->getOs()) {
+ case 'WIN':
+ return $this->getWindowsUid();
+ case 'DAR':
+ case 'FRE':
+ case 'LIN':
+ default:
+ return trim((string) shell_exec('id -u'));
+ }
}
/**
@@ -120,10 +124,15 @@ class SystemDceSecurityProvider implements DceSecurityProviderInterface
return '';
}
- return match ($this->getOs()) {
- 'WIN' => $this->getWindowsGid(),
- default => trim((string) shell_exec('id -g')),
- };
+ switch ($this->getOs()) {
+ case 'WIN':
+ return $this->getWindowsGid();
+ case 'DAR':
+ case 'FRE':
+ case 'LIN':
+ default:
+ return trim((string) shell_exec('id -g'));
+ }
}
/**
@@ -133,7 +142,7 @@ class SystemDceSecurityProvider implements DceSecurityProviderInterface
{
$disabledFunctions = strtolower((string) ini_get('disable_functions'));
- return !str_contains($disabledFunctions, 'shell_exec');
+ return strpos($disabledFunctions, 'shell_exec') === false;
}
/**
@@ -141,13 +150,7 @@ class SystemDceSecurityProvider implements DceSecurityProviderInterface
*/
private function getOs(): string
{
- /**
- * @psalm-suppress UnnecessaryVarAnnotation
- * @var string $phpOs
- */
- $phpOs = constant('PHP_OS');
-
- return strtoupper(substr($phpOs, 0, 3));
+ return strtoupper(substr(constant('PHP_OS'), 0, 3));
}
/**