Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a0aa941

Browse files
minor #32054 Prepare for PHP 7.4 preload (nicolas-grekas)
This PR was merged into the 4.4 branch. Discussion ---------- Prepare for PHP 7.4 preload | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - PHP 7.4 preloading is not compatible with declaring the same class twice in if/else blocks. Let's split the ones we have in several files. Commits ------- 7cf3fb4 Prepare for PHP 7.4 preload
2 parents 8496003 + 7cf3fb4 commit a0aa941

21 files changed

+384
-166
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
13+
14+
use Symfony\Contracts\Service\ServiceSubscriberInterface;
15+
16+
/**
17+
* @internal
18+
*/
19+
interface CompatibilityServiceSubscriberInterface extends ServiceSubscriberInterface
20+
{
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
13+
14+
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface as LegacyServiceSubscriberInterface;
15+
16+
/**
17+
* @internal
18+
*/
19+
interface CompatibilityServiceSubscriberInterface extends LegacyServiceSubscriberInterface
20+
{
21+
}

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,9 @@
1212
namespace Symfony\Bundle\FrameworkBundle\DependencyInjection;
1313

1414
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface as LegacyServiceSubscriberInterface;
15-
use Symfony\Contracts\Service\ServiceSubscriberInterface;
1615

1716
if (interface_exists(LegacyServiceSubscriberInterface::class)) {
18-
/**
19-
* @internal
20-
*/
21-
interface CompatibilityServiceSubscriberInterface extends LegacyServiceSubscriberInterface
22-
{
23-
}
17+
require __DIR__.\DIRECTORY_SEPARATOR.'CompatibilityServiceSubscriberInterface.legacy.php';
2418
} else {
25-
/**
26-
* @internal
27-
*/
28-
interface CompatibilityServiceSubscriberInterface extends ServiceSubscriberInterface
29-
{
30-
}
19+
require __DIR__.\DIRECTORY_SEPARATOR.'CompatibilityServiceSubscriberInterface.contracts.php';
3120
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\TwigBundle\DependencyInjection;
13+
14+
use Symfony\Contracts\Service\ServiceSubscriberInterface;
15+
16+
/**
17+
* @internal
18+
*/
19+
interface CompatibilityServiceSubscriberInterface extends ServiceSubscriberInterface
20+
{
21+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Bundle\TwigBundle\DependencyInjection;
13+
14+
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface as LegacyServiceSubscriberInterface;
15+
16+
/**
17+
* @internal
18+
*/
19+
interface CompatibilityServiceSubscriberInterface extends LegacyServiceSubscriberInterface
20+
{
21+
}

src/Symfony/Bundle/TwigBundle/DependencyInjection/CompatibilityServiceSubscriberInterface.php

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,9 @@
1212
namespace Symfony\Bundle\TwigBundle\DependencyInjection;
1313

1414
use Symfony\Component\DependencyInjection\ServiceSubscriberInterface as LegacyServiceSubscriberInterface;
15-
use Symfony\Contracts\Service\ServiceSubscriberInterface;
1615

1716
if (interface_exists(LegacyServiceSubscriberInterface::class)) {
18-
/**
19-
* @internal
20-
*/
21-
interface CompatibilityServiceSubscriberInterface extends LegacyServiceSubscriberInterface
22-
{
23-
}
17+
require __DIR__.\DIRECTORY_SEPARATOR.'CompatibilityServiceSubscriberInterface.legacy.php';
2418
} else {
25-
/**
26-
* @internal
27-
*/
28-
interface CompatibilityServiceSubscriberInterface extends ServiceSubscriberInterface
29-
{
30-
}
19+
require __DIR__.\DIRECTORY_SEPARATOR.'CompatibilityServiceSubscriberInterface.contracts.php';
3120
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Exception;
13+
14+
use Psr\Cache\CacheException as Psr6CacheInterface;
15+
use Psr\SimpleCache\CacheException as SimpleCacheInterface;
16+
17+
class CacheException extends \Exception implements Psr6CacheInterface, SimpleCacheInterface
18+
{
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Exception;
13+
14+
use Psr\Cache\CacheException as Psr6CacheInterface;
15+
16+
class CacheException extends \Exception implements Psr6CacheInterface
17+
{
18+
}

src/Symfony/Component/Cache/Exception/CacheException.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@
1111

1212
namespace Symfony\Component\Cache\Exception;
1313

14-
use Psr\Cache\CacheException as Psr6CacheInterface;
1514
use Psr\SimpleCache\CacheException as SimpleCacheInterface;
1615

1716
if (interface_exists(SimpleCacheInterface::class)) {
18-
class CacheException extends \Exception implements Psr6CacheInterface, SimpleCacheInterface
19-
{
20-
}
17+
require __DIR__.\DIRECTORY_SEPARATOR.'CacheException+psr16.php';
2118
} else {
22-
class CacheException extends \Exception implements Psr6CacheInterface
23-
{
24-
}
19+
require __DIR__.\DIRECTORY_SEPARATOR.'CacheException-psr16.php';
2520
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Exception;
13+
14+
use Psr\Cache\InvalidArgumentException as Psr6CacheInterface;
15+
use Psr\SimpleCache\InvalidArgumentException as SimpleCacheInterface;
16+
17+
class InvalidArgumentException extends \InvalidArgumentException implements Psr6CacheInterface, SimpleCacheInterface
18+
{
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Exception;
13+
14+
use Psr\Cache\InvalidArgumentException as Psr6CacheInterface;
15+
16+
class InvalidArgumentException extends \InvalidArgumentException implements Psr6CacheInterface
17+
{
18+
}

src/Symfony/Component/Cache/Exception/InvalidArgumentException.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@
1111

1212
namespace Symfony\Component\Cache\Exception;
1313

14-
use Psr\Cache\InvalidArgumentException as Psr6CacheInterface;
1514
use Psr\SimpleCache\InvalidArgumentException as SimpleCacheInterface;
1615

1716
if (interface_exists(SimpleCacheInterface::class)) {
18-
class InvalidArgumentException extends \InvalidArgumentException implements Psr6CacheInterface, SimpleCacheInterface
19-
{
20-
}
17+
require __DIR__.\DIRECTORY_SEPARATOR.'InvalidArgumentException+psr16.php';
2118
} else {
22-
class InvalidArgumentException extends \InvalidArgumentException implements Psr6CacheInterface
23-
{
24-
}
19+
require __DIR__.\DIRECTORY_SEPARATOR.'InvalidArgumentException-psr16.php';
2520
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Exception;
13+
14+
use Psr\Cache\CacheException as Psr6CacheInterface;
15+
use Psr\SimpleCache\CacheException as SimpleCacheInterface;
16+
17+
class LogicException extends \LogicException implements Psr6CacheInterface, SimpleCacheInterface
18+
{
19+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Component\Cache\Exception;
13+
14+
use Psr\Cache\CacheException as Psr6CacheInterface;
15+
16+
class LogicException extends \LogicException implements Psr6CacheInterface
17+
{
18+
}

src/Symfony/Component/Cache/Exception/LogicException.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,10 @@
1111

1212
namespace Symfony\Component\Cache\Exception;
1313

14-
use Psr\Cache\CacheException as Psr6CacheInterface;
15-
use Psr\SimpleCache\CacheException as SimpleCacheInterface;
14+
use Psr\SimpleCache\LogicException as SimpleCacheInterface;
1615

1716
if (interface_exists(SimpleCacheInterface::class)) {
18-
class LogicException extends \LogicException implements Psr6CacheInterface, SimpleCacheInterface
19-
{
20-
}
17+
require __DIR__.\DIRECTORY_SEPARATOR.'LogicException-psr16.php';
2118
} else {
22-
class LogicException extends \LogicException implements Psr6CacheInterface
23-
{
24-
}
19+
require __DIR__.\DIRECTORY_SEPARATOR.'LogicException-psr16.php';
2520
}
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
12+
namespace Symfony\Contracts\EventDispatcher;
13+
14+
use Psr\EventDispatcher\StoppableEventInterface;
15+
16+
/**
17+
* Event is the base class for classes containing event data.
18+
*
19+
* This class contains no event data. It is used by events that do not pass
20+
* state information to an event handler when an event is raised.
21+
*
22+
* You can call the method stopPropagation() to abort the execution of
23+
* further listeners in your event listener.
24+
*
25+
* @author Guilherme Blanco <[email protected]>
26+
* @author Jonathan Wage <[email protected]>
27+
* @author Roman Borschel <[email protected]>
28+
* @author Bernhard Schussek <[email protected]>
29+
* @author Nicolas Grekas <[email protected]>
30+
*/
31+
class Event implements StoppableEventInterface
32+
{
33+
private $propagationStopped = false;
34+
35+
/**
36+
* Returns whether further event listeners should be triggered.
37+
*/
38+
public function isPropagationStopped(): bool
39+
{
40+
return $this->propagationStopped;
41+
}
42+
43+
/**
44+
* Stops the propagation of the event to further event listeners.
45+
*
46+
* If multiple event listeners are connected to the same event, no
47+
* further event listener will be triggered once any trigger calls
48+
* stopPropagation().
49+
*/
50+
public function stopPropagation(): void
51+
{
52+
$this->propagationStopped = true;
53+
}
54+
}

0 commit comments

Comments
 (0)