git subrepo commit mailcow/src/mailcow-dockerized
subrepo: subdir: "mailcow/src/mailcow-dockerized"
merged: "308860af"
upstream: origin: "https://github.com/mailcow/mailcow-dockerized.git"
branch: "master"
commit: "3f1a5af8"
git-subrepo: version: "0.4.5"
origin: "???"
commit: "???"
Change-Id: I5d51c14b45db54fe706be40a591ddbfcea50d4b0
diff --git a/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php b/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php
index c5efb5f..1b86cc5 100644
--- a/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php
+++ b/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/symfony/translation/Extractor/PhpExtractor.php
@@ -27,15 +27,11 @@
/**
* Prefix for new found message.
- *
- * @var string
*/
- private $prefix = '';
+ private string $prefix = '';
/**
* The sequence that captures translation messages.
- *
- * @var array
*/
protected $sequences = [
[
@@ -135,7 +131,7 @@
/**
* {@inheritdoc}
*/
- public function extract($resource, MessageCatalogue $catalog)
+ public function extract(string|iterable $resource, MessageCatalogue $catalog)
{
$files = $this->extractFiles($resource);
foreach ($files as $file) {
@@ -155,12 +151,8 @@
/**
* Normalizes a token.
- *
- * @param mixed $token
- *
- * @return string|null
*/
- protected function normalizeToken($token)
+ protected function normalizeToken(mixed $token): ?string
{
if (isset($token[1]) && 'b"' !== $token) {
return $token[1];
@@ -315,11 +307,9 @@
}
/**
- * @return bool
- *
* @throws \InvalidArgumentException
*/
- protected function canBeExtracted(string $file)
+ protected function canBeExtracted(string $file): bool
{
return $this->isFile($file) && 'php' === pathinfo($file, \PATHINFO_EXTENSION);
}
@@ -327,8 +317,12 @@
/**
* {@inheritdoc}
*/
- protected function extractFromDirectory($directory)
+ protected function extractFromDirectory(string|array $directory): iterable
{
+ if (!class_exists(Finder::class)) {
+ throw new \LogicException(sprintf('You cannot use "%s" as the "symfony/finder" package is not installed. Try running "composer require symfony/finder".', static::class));
+ }
+
$finder = new Finder();
return $finder->files()->name('*.php')->in($directory);