Skip to content

Commit 245c3b5

Browse files
authored
14.5 update of dependencies (#4357)
2 parents c1fce0e + eef5f87 commit 245c3b5

File tree

96 files changed

+656
-424
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+656
-424
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
/components
33
/vendor
44
/composer.lock
5-
/.phpunit.result.cache
5+
/.phpunit.cache

build.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,7 @@
15871587
<phingcall target="npm-translations-dump"/>
15881588
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
15891589
<arg value="${path.bin-console}"/>
1590-
<arg value="translation:extract"/>
1590+
<arg value="jms:translation:extract"/>
15911591
<arg value="--dir=${path.src}"/>
15921592
<arg value="--dir=${path.config}"/>
15931593
<arg value="--dir=${path.templates}"/>
@@ -1606,7 +1606,7 @@
16061606
<phingcall target="npm-translations-dump"/>
16071607
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
16081608
<arg value="${path.bin-console}"/>
1609-
<arg value="translation:extract"/>
1609+
<arg value="jms:translation:extract"/>
16101610
<arg value="--dir=${path.src}"/>
16111611
<arg value="--dir=${path.templates}"/>
16121612
<arg value="--dir=${path.var}/translations/projectBase"/>
@@ -1629,7 +1629,7 @@
16291629
<target name="translations-import" description="Import translatable messages from front-end source files in your project.">
16301630
<exec executable="${path.php.executable}" passthru="true" checkreturn="true">
16311631
<arg value="${path.bin-console}"/>
1632-
<arg value="translation:import"/>
1632+
<arg value="jms:translation:import"/>
16331633
<arg value="${path.root}/translations-update/"/>
16341634
<arg value="${path.root}/translations/"/>
16351635
<arg value="messages"/>

composer.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@
3737
"ext-pdo_pgsql": "*",
3838
"ext-redis": "*",
3939
"ext-xml": "*",
40-
"arvenil/ninja-mutex": "^0.4.1",
41-
"barryvdh/elfinder-flysystem-driver": "^0.4.3",
42-
"commerceguys/intl": "^1.0.0",
40+
"arvenil/ninja-mutex": "^0.6",
41+
"barryvdh/elfinder-flysystem-driver": "^0.5",
42+
"becklyn/ordered-form-bundle": "^1.4",
43+
"commerceguys/intl": "^2.0.0",
4344
"composer/composer": "^2.2.12",
4445
"craue/formflow-bundle": "^3.0.3",
4546
"defuse/php-encryption": "^2.2.1",
@@ -63,24 +64,24 @@
6364
"helios-ag/fm-elfinder-bundle": "^12.2",
6465
"heureka/overeno-zakazniky": "^4.0.1",
6566
"jms/metadata": "^2.6.1",
66-
"jms/translation-bundle": "^1.6.2",
67+
"jms/translation-bundle": "^2.2.1",
6768
"knplabs/knp-menu-bundle": "^3.2",
6869
"league/flysystem": "^3.11",
6970
"litipk/php-bignumbers": "^0.8.6",
7071
"league/iso3166": "^4.2.1",
7172
"nette/utils": "^3.0",
72-
"nikic/php-parser": "^4.0",
73+
"nikic/php-parser": "^5.0",
74+
"phar-io/version": "^3.0",
7375
"phpdocumentor/reflection-docblock": "^5.3.0",
7476
"presta/sitemap-bundle": "^3.3",
7577
"prezent/doctrine-translatable": "^3.3.0",
7678
"prezent/doctrine-translatable-bundle": "^1.4",
7779
"psr/log": "^1.0",
7880
"ramsey/uuid": "^4.3.1",
79-
"roave/better-reflection": "^6.0",
81+
"roave/better-reflection": "^6.37",
8082
"shopsys/form-types-bundle": "14.5.x-dev",
8183
"shopsys/jsformvalidator-bundle": "^1.7.0",
8284
"shopsys/migrations": "14.5.x-dev",
83-
"shopsys/ordered-form": "^5.2",
8485
"shopsys/plugin-interface": "14.5.x-dev",
8586
"snc/redis-bundle": "^4.8.0",
8687
"spatie/opening-hours": "^3.0",
@@ -111,7 +112,7 @@
111112
"phpstan/phpstan-doctrine": "^1.3.4",
112113
"phpstan/phpstan-phpunit": "^1.1.1",
113114
"phpstan/phpstan-symfony": "^1.1.8",
114-
"phpunit/phpunit": "^9.5.20",
115+
"phpunit/phpunit": "^11.2.1",
115116
"psr/event-dispatcher": "^1.0.0",
116117
"shopsys/coding-standards": "14.5.x-dev",
117118
"sspooky13/yaml-standards": "^9.0",

phpunit.xml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,20 @@
22
<!-- http://www.phpunit.de/manual/current/en/appendixes.configuration.html -->
33
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
backupGlobals="false"
5-
backupStaticAttributes="false"
65
bootstrap="tests/autoload.php"
76
colors="true"
8-
convertErrorsToExceptions="true"
9-
convertNoticesToExceptions="true"
10-
convertWarningsToExceptions="true"
117
processIsolation="false"
128
stopOnFailure="false"
139
failOnWarning="true"
1410
beStrictAboutTestsThatDoNotTestAnything="false"
15-
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
11+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/11.2/phpunit.xsd"
12+
cacheDirectory=".phpunit.cache"
13+
backupStaticProperties="false"
1614
>
17-
<coverage/>
18-
19-
<testsuites>
20-
<testsuite name="Unit">
21-
<directory>tests/Unit</directory>
22-
</testsuite>
23-
</testsuites>
24-
15+
<testsuites>
16+
<testsuite name="Unit">
17+
<directory>tests/Unit</directory>
18+
</testsuite>
19+
</testsuites>
20+
<source/>
2521
</phpunit>
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Shopsys\FrameworkBundle\Command;
6+
7+
use Exception;
8+
use Shopsys\FrameworkBundle\Component\Phing\PhingDownloader;
9+
use Symfony\Component\Console\Attribute\AsCommand;
10+
use Symfony\Component\Console\Command\Command;
11+
use Symfony\Component\Console\Input\InputArgument;
12+
use Symfony\Component\Console\Input\InputInterface;
13+
use Symfony\Component\Console\Output\OutputInterface;
14+
use Symfony\Component\Console\Style\SymfonyStyle;
15+
16+
#[AsCommand(name: 'shopsys:phing:download')]
17+
class DownloadPhingCommand extends Command
18+
{
19+
private const DEFAULT_PHING_VERSION = '3.0.1';
20+
21+
/**
22+
* @param string $vendorDir
23+
*/
24+
public function __construct(private readonly string $vendorDir)
25+
{
26+
parent::__construct();
27+
}
28+
29+
/**
30+
* {@inheritdoc}
31+
*/
32+
protected function configure(): void
33+
{
34+
$this
35+
->setDescription('Downloads Phing PHAR file')
36+
->addArgument(
37+
'version',
38+
InputArgument::OPTIONAL,
39+
'Phing version to download',
40+
self::DEFAULT_PHING_VERSION,
41+
);
42+
}
43+
44+
/**
45+
* {@inheritdoc}
46+
*/
47+
protected function execute(InputInterface $input, OutputInterface $output): int
48+
{
49+
$symfonyStyle = new SymfonyStyle($input, $output);
50+
$version = $input->getArgument('version');
51+
52+
$projectDir = dirname($this->vendorDir);
53+
$downloader = new PhingDownloader($projectDir);
54+
55+
try {
56+
$downloader->execute($input, $output);
57+
$symfonyStyle->success(sprintf('Phing %s downloaded successfully.', $version));
58+
59+
return Command::SUCCESS;
60+
} catch (Exception $e) {
61+
$symfonyStyle->error($e->getMessage());
62+
63+
return Command::FAILURE;
64+
}
65+
}
66+
}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Shopsys\FrameworkBundle\Component\Phing;
6+
7+
use PharIo\Version\InvalidVersionException;
8+
use PharIo\Version\Version;
9+
use Symfony\Component\Console\Command\Command;
10+
use Symfony\Component\Console\Input\InputInterface;
11+
use Symfony\Component\Console\Output\OutputInterface;
12+
use Symfony\Component\Console\Style\SymfonyStyle;
13+
14+
class PhingDownloader
15+
{
16+
public const string OPTION_VERSION = 'phing-version';
17+
protected const string VERSION_URL = 'https://github.com/phingofficial/phing/releases/download/%s/phing-%s.phar';
18+
protected const string SEMVER_REGEX = '/\b\d+\.\d+\.\d+(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?(\+[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?\b/';
19+
20+
/**
21+
* @param string $vendorDir
22+
*/
23+
public function __construct(protected readonly string $vendorDir)
24+
{
25+
}
26+
27+
/**
28+
* @param \Symfony\Component\Console\Input\InputInterface $input
29+
* @param \Symfony\Component\Console\Output\OutputInterface $output
30+
* @return int
31+
*/
32+
public function execute(InputInterface $input, OutputInterface $output): int
33+
{
34+
$io = new SymfonyStyle($input, $output);
35+
$version = $input->getOption(self::OPTION_VERSION);
36+
$currentPhingVersion = $this->getCurrentPhingVersion();
37+
38+
if ($version !== null) {
39+
try {
40+
new Version($version);
41+
} catch (InvalidVersionException) {
42+
$io->error('Invalid version format.');
43+
44+
return Command::FAILURE;
45+
}
46+
47+
if ($currentPhingVersion !== null && $currentPhingVersion->getVersionString() === $version) {
48+
$io->success('Phing is already installed in the specified version.');
49+
50+
return Command::SUCCESS;
51+
}
52+
53+
$downloadUrl = sprintf(self::VERSION_URL, $version, $version);
54+
} else {
55+
$phingLatestVersion = $this->getLatestPhingVersion();
56+
57+
if ($currentPhingVersion !== null && $phingLatestVersion !== null && $currentPhingVersion->getVersionString() === $phingLatestVersion->getVersionString()) {
58+
$io->success('Latest version of Phing is already installed.');
59+
60+
return Command::SUCCESS;
61+
}
62+
63+
$downloadUrl = sprintf(self::VERSION_URL, $phingLatestVersion->getVersionString(), $phingLatestVersion->getVersionString());
64+
}
65+
66+
$phar = @file_get_contents($downloadUrl);
67+
68+
if ($phar === false) {
69+
$io->error('Phing PHAR could not be downloaded. Make sure you have provided correct version and your internet connection is working correctly.');
70+
71+
return Command::FAILURE;
72+
}
73+
74+
file_put_contents($this->vendorDir . '/../phing.phar', $phar);
75+
76+
$io->success('Phing PHAR has been downloaded successfully.');
77+
78+
return Command::SUCCESS;
79+
}
80+
81+
/**
82+
* @return \PharIo\Version\Version|null
83+
*/
84+
protected function getCurrentPhingVersion(): ?Version
85+
{
86+
$phingVersionString = shell_exec('php phing -v');
87+
88+
return $this->getVersionFromString($phingVersionString);
89+
}
90+
91+
/**
92+
* @return \PharIo\Version\Version|null
93+
*/
94+
protected function getLatestPhingVersion(): ?Version
95+
{
96+
$phingLatestVersionString = shell_exec('composer show phing/phing -l -a | grep latest');
97+
98+
return $this->getVersionFromString($phingLatestVersionString);
99+
}
100+
101+
/**
102+
* @param string $string
103+
* @return \PharIo\Version\Version|null
104+
*/
105+
protected function getVersionFromString(string $string): ?Version
106+
{
107+
if (preg_match(self::SEMVER_REGEX, $string, $matches) === 1) {
108+
return new Version($matches[0]);
109+
}
110+
111+
return null;
112+
}
113+
}

src/Component/Translation/ConstraintMessageExtractor.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
use JMS\TranslationBundle\Model\MessageCatalogue;
1010
use JMS\TranslationBundle\Translation\Extractor\FileVisitorInterface;
1111
use PhpParser\Node;
12+
use PhpParser\Node\ArrayItem;
1213
use PhpParser\Node\Expr\Array_;
13-
use PhpParser\Node\Expr\ArrayItem;
1414
use PhpParser\Node\Expr\New_;
1515
use PhpParser\Node\Name\FullyQualified;
1616
use PhpParser\Node\Scalar\String_;
@@ -101,7 +101,7 @@ protected function extractMessagesFromOptions(Node $optionsNode)
101101
}
102102

103103
/**
104-
* @param \PhpParser\Node\Expr\ArrayItem $node
104+
* @param \PhpParser\Node\ArrayItem $node
105105
* @return bool
106106
*/
107107
protected function isMessageOptionItem(ArrayItem $node)

src/Component/Translation/ConstraintMessagePropertyExtractor.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
use JMS\TranslationBundle\Model\MessageCatalogue;
1010
use JMS\TranslationBundle\Translation\Extractor\FileVisitorInterface;
1111
use PhpParser\Node;
12+
use PhpParser\Node\PropertyItem;
1213
use PhpParser\Node\Stmt\Class_;
1314
use PhpParser\Node\Stmt\Property;
14-
use PhpParser\Node\Stmt\PropertyProperty;
1515
use PhpParser\NodeTraverser;
1616
use PhpParser\NodeVisitor;
1717
use PhpParser\NodeVisitor\NameResolver;
@@ -114,10 +114,10 @@ protected function extractMessagesFromProperty(Property $node)
114114
}
115115

116116
/**
117-
* @param \PhpParser\Node\Stmt\PropertyProperty $node
117+
* @param \PhpParser\Node\PropertyItem $node
118118
* @return bool
119119
*/
120-
protected function isMessagePropertyProperty(PropertyProperty $node)
120+
protected function isMessagePropertyProperty(PropertyItem $node)
121121
{
122122
return strtolower(substr($node->name->toString(), -7)) === 'message';
123123
}

src/Component/Translation/ConstraintViolationExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected function setCurrentExecutionContextVariableNamesFromNode(ClassMethod $
104104
protected function isParameterExecutionContextInterfaceSubclass(Node\Param $parameter)
105105
{
106106
if ($parameter->type instanceof FullyQualified) {
107-
$fullyQualifiedName = implode('\\', $parameter->type->parts);
107+
$fullyQualifiedName = implode('\\', $parameter->type->getParts());
108108

109109
return $fullyQualifiedName === ExecutionContextInterface::class
110110
|| is_subclass_of($fullyQualifiedName, ExecutionContextInterface::class);

src/Model/AdminNavigation/SideMenuBuilder.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,10 @@ protected function createAdministratorsMenu(): ItemInterface
307307
'edit',
308308
['route' => 'admin_administrator_edit', 'label' => t('Editing administrator'), 'display' => false],
309309
);
310+
$menu->addChild(
311+
'enable-two-factor-authentication',
312+
['route' => 'admin_administrator_enable-two-factor-authentication', 'label' => t('Enable two-factor authentication'), 'display' => false],
313+
);
310314

311315
$this->dispatchConfigureMenuEvent(ConfigureMenuEvent::SIDE_MENU_ADMINISTRATORS, $menu);
312316

0 commit comments

Comments
 (0)