Skip to content

Commit 9fb7e83

Browse files
committed
ISSUE-337: update dependencies
1 parent ca43fca commit 9fb7e83

File tree

7 files changed

+61
-69
lines changed

7 files changed

+61
-69
lines changed

bin/console

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use PhpList\Core\Core\Bootstrap;
77
use PhpList\Core\Core\Environment;
88
use Symfony\Bundle\FrameworkBundle\Console\Application;
99
use Symfony\Component\Console\Input\ArgvInput;
10-
use Symfony\Component\Debug\Debug;
10+
use Symfony\Component\ErrorHandler\ErrorHandler;
1111

1212
set_time_limit(0);
1313

@@ -19,7 +19,7 @@ $debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-d
1919
&& $environment !== Environment::PRODUCTION;
2020

2121
if ($debug) {
22-
Debug::enable();
22+
ErrorHandler::register();
2323
}
2424

2525
Bootstrap::getInstance()->setEnvironment($environment)->configure();

composer.json

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -34,28 +34,26 @@
3434
"source": "https://github.com/phpList/core"
3535
},
3636
"require": {
37-
"php": "^7.2|^8.0",
38-
"doctrine/orm": "^2.5.0",
39-
"doctrine/common": "^2.6.0",
40-
"doctrine/doctrine-bundle": "^1.8.0",
41-
"symfony/symfony": "^3.4.37",
42-
"symfony/monolog-bundle": "^3.1.0",
43-
"symfony/dependency-injection": "^3.4.37",
44-
"symfony/config": "^3.4.37",
45-
"symfony/yaml": "^3.4.37",
46-
"jms/serializer-bundle": "^3.8.0",
47-
"sensio/framework-extra-bundle": "^5.1.0",
48-
"sensio/distribution-bundle": "^5.0.6"
37+
"php": "^8.1",
38+
"doctrine/orm": "^2.11",
39+
"doctrine/common": "^3.3",
40+
"doctrine/doctrine-bundle": "^2.7",
41+
"symfony/symfony": "^4.4|^5.4",
42+
"symfony/monolog-bundle": "^3.8|^4.0",
43+
"symfony/dependency-injection": "^4.4|^5.4",
44+
"symfony/config": "^4.4|^5.4",
45+
"symfony/yaml": "^4.4|^5.4",
46+
"doctrine/annotations": "*",
47+
"symfony/error-handler": "*",
48+
"symfony/serializer": "*"
4949
},
5050
"require-dev": {
51-
"phpunit/phpunit": "^6.5.6",
52-
"phpunit/phpunit-mock-objects": "^5.0.6",
53-
"phpunit/dbunit": "^3.0.0",
51+
"phpunit/phpunit": "^10.0",
5452
"guzzlehttp/guzzle": "^6.3.0",
5553
"squizlabs/php_codesniffer": "^3.2.0",
5654
"phpstan/phpstan": "^0.7.0|0.12.57",
5755
"nette/caching": "^2.5.0|^3.0.0",
58-
"nikic/php-parser": "^3.1.0",
56+
"nikic/php-parser": "^4.19.1",
5957
"phpmd/phpmd": "^2.6.0",
6058
"composer/composer": "^1.6.0",
6159
"doctrine/instantiator": "^1.0.5"
@@ -83,7 +81,7 @@
8381
"PhpList\\Core\\Composer\\ScriptHandler::createBundleConfiguration",
8482
"PhpList\\Core\\Composer\\ScriptHandler::createRoutesConfiguration",
8583
"PhpList\\Core\\Composer\\ScriptHandler::createParametersConfiguration",
86-
"PhpList\\Core\\Composer\\ScriptHandler::clearAllCaches"
84+
"php bin/console cache:clear"
8785
],
8886
"post-install-cmd": [
8987
"@update-configuration"

config/services.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,24 @@ services:
2626
autowire: true
2727
autoconfigure: false
2828
public: true
29-
factory: Doctrine\ORM\EntityManagerInterface:getRepository
29+
factory: ['@doctrine.orm.entity_manager', getRepository]
3030

3131
# controllers are imported separately to make sure they're public
3232
# and have a tag that allows actions to type-hint services
3333
PhpList\Core\EmptyStartPageBundle\Controller\:
3434
resource: '../src/EmptyStartPageBundle/Controller'
3535
public: true
3636
tags: [controller.service_arguments]
37+
38+
doctrine.orm.metadata.annotation_reader:
39+
alias: doctrine.annotation_reader
40+
41+
doctrine.annotation_reader:
42+
class: Doctrine\Common\Annotations\AnnotationReader
43+
autowire: true
44+
45+
doctrine.orm.default_annotation_metadata_driver:
46+
class: Doctrine\ORM\Mapping\Driver\AnnotationDriver
47+
arguments:
48+
- '@annotation_reader'
49+
- '%kernel.project_dir%/src/Domain/Model/'

src/Composer/ScriptHandler.php

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
use Composer\Package\PackageInterface;
77
use Composer\Script\Event;
88
use PhpList\Core\Core\ApplicationStructure;
9-
use Sensio\Bundle\DistributionBundle\Composer\ScriptHandler as SensioScriptHandler;
109
use Symfony\Component\Filesystem\Filesystem;
1110

1211
/**
1312
* This class provides Composer-related functionality for setting up and managing phpList modules.
1413
*
1514
* @author Oliver Klee <[email protected]>
1615
*/
17-
class ScriptHandler extends SensioScriptHandler
16+
class ScriptHandler
1817
{
1918
/**
2019
* @var string
@@ -262,23 +261,6 @@ public static function clearAllCaches()
262261
$fileSystem->remove(static::getApplicationRoot() . '/var/cache');
263262
}
264263

265-
/**
266-
* Warms the production cache.
267-
*
268-
* @param Event $event
269-
*
270-
* @return void
271-
*/
272-
public static function warmProductionCache(Event $event)
273-
{
274-
$consoleDir = static::getConsoleDir($event, 'warm the cache');
275-
if ($consoleDir === null) {
276-
return;
277-
}
278-
279-
static::executeCommand($event, $consoleDir, 'cache:warm -e prod');
280-
}
281-
282264
/**
283265
* Creates config/parameters.yml (the parameters configuration file).
284266
*

src/Core/ApplicationKernel.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace PhpList\Core\Core;
56

6-
use Symfony\Bundle\WebServerBundle\WebServerBundle;
7+
use Exception;
8+
use RuntimeException;
79
use Symfony\Component\Config\Loader\LoaderInterface;
810
use Symfony\Component\DependencyInjection\ContainerBuilder;
911
use Symfony\Component\HttpKernel\Bundle\Bundle;
@@ -28,12 +30,7 @@ class ApplicationKernel extends Kernel
2830
*/
2931
public function registerBundles(): array
3032
{
31-
$bundles = $this->bundlesFromConfiguration();
32-
if ($this->shouldHaveDevelopmentBundles()) {
33-
$bundles[] = new WebServerBundle();
34-
}
35-
36-
return $bundles;
33+
return $this->bundlesFromConfiguration();
3734
}
3835

3936
/**
@@ -117,7 +114,7 @@ protected function build(ContainerBuilder $container)
117114
*
118115
* @return void
119116
*
120-
* @throws \Exception
117+
* @throws Exception
121118
*/
122119
public function registerContainerConfiguration(LoaderInterface $loader)
123120
{
@@ -162,13 +159,13 @@ private function bundlesFromConfiguration(): array
162159
*
163160
* @return string[][]
164161
*
165-
* @throws \RuntimeException if the configuration file cannot be read
162+
* @throws RuntimeException if the configuration file cannot be read
166163
*/
167164
private function readBundleConfiguration(): array
168165
{
169166
$configurationFilePath = $this->getApplicationDir() . '/config/bundles.yml';
170167
if (!is_readable($configurationFilePath)) {
171-
throw new \RuntimeException('The file "' . $configurationFilePath . '" could not be read.', 1504272377);
168+
throw new RuntimeException('The file "' . $configurationFilePath . '" could not be read.', 1504272377);
172169
}
173170

174171
return Yaml::parse(file_get_contents($configurationFilePath));

src/Core/Bootstrap.php

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
<?php
2+
23
declare(strict_types=1);
34

45
namespace PhpList\Core\Core;
56

67
use Doctrine\ORM\EntityManagerInterface;
7-
use Symfony\Component\Debug\Debug;
8+
use Exception;
9+
use RuntimeException;
10+
use Symfony\Component\ErrorHandler\ErrorHandler;
811
use Symfony\Component\DependencyInjection\ContainerInterface;
912
use Symfony\Component\HttpFoundation\Request;
13+
use UnexpectedValueException;
1014

1115
/**
1216
* This class bootstraps the phpList core system.
@@ -98,7 +102,7 @@ public static function purgeInstance()
98102
*
99103
* @return Bootstrap fluent interface
100104
*
101-
* @throws \UnexpectedValueException
105+
* @throws UnexpectedValueException
102106
*/
103107
public function setEnvironment(string $environment): Bootstrap
104108
{
@@ -175,12 +179,12 @@ public function configure(): Bootstrap
175179
*
176180
* @return void
177181
*
178-
* @throws \RuntimeException if configure has not been called before
182+
* @throws RuntimeException if configure has not been called before
179183
*/
180184
private function assertConfigureHasBeenCalled()
181185
{
182186
if (!$this->isConfigured) {
183-
throw new \RuntimeException('Please call configure() first.', 1501170550);
187+
throw new RuntimeException('Please call configure() first.', 1501170550);
184188
}
185189
}
186190

@@ -191,8 +195,8 @@ private function assertConfigureHasBeenCalled()
191195
*
192196
* @return null
193197
*
194-
* @throws \RuntimeException if configure has not been called before
195-
* @throws \Exception
198+
* @throws RuntimeException if configure has not been called before
199+
* @throws Exception
196200
*/
197201
public function dispatch()
198202
{
@@ -212,7 +216,7 @@ public function dispatch()
212216
private function configureDebugging(): Bootstrap
213217
{
214218
if ($this->isDebugEnabled()) {
215-
Debug::enable();
219+
ErrorHandler::register();
216220
}
217221

218222
return $this;
@@ -234,7 +238,7 @@ private function configureApplicationKernel(): Bootstrap
234238
/**
235239
* @return ApplicationKernel
236240
*
237-
* @throws \RuntimeException if configure has not been called before
241+
* @throws RuntimeException if configure has not been called before
238242
*/
239243
public function getApplicationKernel(): ApplicationKernel
240244
{
@@ -258,7 +262,7 @@ public function getContainer(): ContainerInterface
258262
/**
259263
* @return EntityManagerInterface
260264
*
261-
* @throws \RuntimeException if configure has not been called before
265+
* @throws RuntimeException if configure has not been called before
262266
*/
263267
public function getEntityManager(): EntityManagerInterface
264268
{
@@ -278,7 +282,7 @@ public function getEntityManager(): EntityManagerInterface
278282
*
279283
* @return string the absolute path without the trailing slash.
280284
*
281-
* @throws \RuntimeException if there is no composer.json in the application root
285+
* @throws RuntimeException if there is no composer.json in the application root
282286
*/
283287
public function getApplicationRoot(): string
284288
{

src/EmptyStartPageBundle/Controller/DefaultController.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,25 @@
33

44
namespace PhpList\Core\EmptyStartPageBundle\Controller;
55

6-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
7-
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
8-
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6+
use InvalidArgumentException;
7+
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
98
use Symfony\Component\HttpFoundation\Response;
9+
use Symfony\Component\Routing\Annotation\Route;
1010

1111
/**
1212
* This controller provides an empty start page.
1313
*
1414
* @author Oliver Klee <[email protected]>
1515
*/
16-
class DefaultController extends Controller
16+
class DefaultController extends AbstractController
1717
{
1818
/**
19-
* @Route("/")
20-
* @Method("GET")
19+
* An empty start page route.
2120
*
22-
* @return Response
23-
*
24-
* @throws \InvalidArgumentException
21+
* @throws InvalidArgumentException
2522
*/
26-
public function indexAction(): Response
23+
#[Route('/', name: 'empty_start_page', methods: ['GET'])]
24+
public function index(): Response
2725
{
2826
return new Response('This page has been intentionally left empty.');
2927
}

0 commit comments

Comments
 (0)