aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/ramsey/uuid/src/Provider/Node
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/Node
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/Node')
-rw-r--r--vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php10
-rw-r--r--vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php5
-rw-r--r--vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php27
3 files changed, 17 insertions, 25 deletions
diff --git a/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php
index d2eb20b70..fe890cc4d 100644
--- a/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php
+++ b/vendor/ramsey/uuid/src/Provider/Node/FallbackNodeProvider.php
@@ -25,17 +25,23 @@ use Ramsey\Uuid\Type\Hexadecimal;
class FallbackNodeProvider implements NodeProviderInterface
{
/**
+ * @var iterable<NodeProviderInterface>
+ */
+ private $nodeProviders;
+
+ /**
* @param iterable<NodeProviderInterface> $providers Array of node providers
*/
- public function __construct(private iterable $providers)
+ public function __construct(iterable $providers)
{
+ $this->nodeProviders = $providers;
}
public function getNode(): Hexadecimal
{
$lastProviderException = null;
- foreach ($this->providers as $provider) {
+ foreach ($this->nodeProviders as $provider) {
try {
return $provider->getNode();
} catch (NodeException $exception) {
diff --git a/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php
index 0f7536a82..51f1b02ea 100644
--- a/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php
+++ b/vendor/ramsey/uuid/src/Provider/Node/StaticNodeProvider.php
@@ -32,7 +32,10 @@ use const STR_PAD_LEFT;
*/
class StaticNodeProvider implements NodeProviderInterface
{
- private Hexadecimal $node;
+ /**
+ * @var Hexadecimal
+ */
+ private $node;
/**
* @param Hexadecimal $node The static node value to use
diff --git a/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php b/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php
index d0a1e697f..d512f22aa 100644
--- a/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php
+++ b/vendor/ramsey/uuid/src/Provider/Node/SystemNodeProvider.php
@@ -27,8 +27,8 @@ use function ob_start;
use function preg_match;
use function preg_match_all;
use function reset;
-use function str_contains;
use function str_replace;
+use function strpos;
use function strtolower;
use function strtoupper;
use function substr;
@@ -100,18 +100,12 @@ class SystemNodeProvider implements NodeProviderInterface
{
$disabledFunctions = strtolower((string) ini_get('disable_functions'));
- if (str_contains($disabledFunctions, 'passthru')) {
+ if (strpos($disabledFunctions, 'passthru') !== false) {
return '';
}
- /**
- * @psalm-suppress UnnecessaryVarAnnotation
- * @var string $phpOs
- */
- $phpOs = constant('PHP_OS');
-
ob_start();
- switch (strtoupper(substr($phpOs, 0, 3))) {
+ switch (strtoupper(substr(constant('PHP_OS'), 0, 3))) {
case 'WIN':
passthru('ipconfig /all 2>&1');
@@ -148,20 +142,13 @@ class SystemNodeProvider implements NodeProviderInterface
{
$mac = '';
- /**
- * @psalm-suppress UnnecessaryVarAnnotation
- * @var string $phpOs
- */
- $phpOs = constant('PHP_OS');
-
- if (strtoupper($phpOs) === 'LINUX') {
+ if (strtoupper(constant('PHP_OS')) === 'LINUX') {
$addressPaths = glob('/sys/class/net/*/address', GLOB_NOSORT);
if ($addressPaths === false || count($addressPaths) === 0) {
return '';
}
- /** @var array<array-key, string> $macs */
$macs = [];
array_walk($addressPaths, function (string $addressPath) use (&$macs): void {
@@ -170,10 +157,7 @@ class SystemNodeProvider implements NodeProviderInterface
}
});
- /** @var callable $trim */
- $trim = 'trim';
-
- $macs = array_map($trim, $macs);
+ $macs = array_map('trim', $macs);
// Remove invalid entries.
$macs = array_filter($macs, function (string $address) {
@@ -181,7 +165,6 @@ class SystemNodeProvider implements NodeProviderInterface
&& preg_match(self::SYSFS_PATTERN, $address);
});
- /** @var string|bool $mac */
$mac = reset($macs);
}