Skip to content

Commit 881f9cf

Browse files
committed
Bump Symfony version to 7.1.7
0 parents  commit 881f9cf

File tree

143 files changed

+16681
-0
lines changed

Some content is hidden

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

143 files changed

+16681
-0
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/Tests export-ignore
2+
/phpunit.xml.dist export-ignore
3+
/.git* export-ignore

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Please do not submit any Pull Requests here. They will be closed.
2+
---
3+
4+
Please submit your PR here instead:
5+
https://github.com/symfony/symfony
6+
7+
This repository is what we call a "subtree split": a read-only subset of that main repository.
8+
We're looking forward to your PR there!
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Close Pull Request
2+
3+
on:
4+
pull_request_target:
5+
types: [opened]
6+
7+
jobs:
8+
run:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: superbrothers/close-pull-request@v3
12+
with:
13+
comment: |
14+
Thanks for your Pull Request! We love contributions.
15+
16+
However, you should instead open your PR on the main repository:
17+
https://github.com/symfony/symfony
18+
19+
This repository is what we call a "subtree split": a read-only subset of that main repository.
20+
We're looking forward to your PR there!

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
composer.lock
2+
phpunit.xml
3+
vendor/

CHANGELOG.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
CHANGELOG
2+
=========
3+
4+
7.1
5+
---
6+
7+
* Add support for new DOM extension classes in `DOMCaster`
8+
9+
7.0
10+
---
11+
12+
* Add argument `$label` to `VarDumper::dump()`
13+
* Require explicit argument when calling `VarDumper::setHandler()`
14+
* Remove display of backtrace in `Twig_Template`, only `Twig\Template` is supported
15+
16+
6.4
17+
---
18+
19+
* Dump uninitialized properties
20+
21+
6.3
22+
---
23+
24+
* Add caster for `WeakMap`
25+
* Add support of named arguments to `dd()` and `dump()` to display the argument name
26+
* Add support for `Relay\Relay`
27+
* Add display of invisible characters
28+
29+
6.2
30+
---
31+
32+
* Add support for `FFI\CData` and `FFI\CType`
33+
* Deprecate calling `VarDumper::setHandler()` without arguments
34+
35+
5.4
36+
---
37+
38+
* Add ability to style integer and double values independently
39+
* Add casters for Symfony's UUIDs and ULIDs
40+
* Add support for `Fiber`
41+
42+
5.2.0
43+
-----
44+
45+
* added support for PHPUnit `--colors` option
46+
* added `VAR_DUMPER_FORMAT=server` env var value support
47+
* prevent replacing the handler when the `VAR_DUMPER_FORMAT` env var is set
48+
49+
5.1.0
50+
-----
51+
52+
* added `RdKafka` support
53+
54+
4.4.0
55+
-----
56+
57+
* added `VarDumperTestTrait::setUpVarDumper()` and `VarDumperTestTrait::tearDownVarDumper()`
58+
to configure casters & flags to use in tests
59+
* added `ImagineCaster` and infrastructure to dump images
60+
* added the stamps of a message after it is dispatched in `TraceableMessageBus` and `MessengerDataCollector` collected data
61+
* added `UuidCaster`
62+
* made all casters final
63+
* added support for the `NO_COLOR` env var (https://no-color.org/)
64+
65+
4.3.0
66+
-----
67+
68+
* added `DsCaster` to support dumping the contents of data structures from the Ds extension
69+
70+
4.2.0
71+
-----
72+
73+
* support selecting the format to use by setting the environment variable `VAR_DUMPER_FORMAT` to `html` or `cli`
74+
75+
4.1.0
76+
-----
77+
78+
* added a `ServerDumper` to send serialized Data clones to a server
79+
* added a `ServerDumpCommand` and `DumpServer` to run a server collecting
80+
and displaying dumps on a single place with multiple formats support
81+
* added `CliDescriptor` and `HtmlDescriptor` descriptors for `server:dump` CLI and HTML formats support
82+
83+
4.0.0
84+
-----
85+
86+
* support for passing `\ReflectionClass` instances to the `Caster::castObject()`
87+
method has been dropped, pass class names as strings instead
88+
* the `Data::getRawData()` method has been removed
89+
* the `VarDumperTestTrait::assertDumpEquals()` method expects a 3rd `$filter = 0`
90+
argument and moves `$message = ''` argument at 4th position.
91+
* the `VarDumperTestTrait::assertDumpMatchesFormat()` method expects a 3rd `$filter = 0`
92+
argument and moves `$message = ''` argument at 4th position.
93+
94+
3.4.0
95+
-----
96+
97+
* added `AbstractCloner::setMinDepth()` function to ensure minimum tree depth
98+
* deprecated `MongoCaster`
99+
100+
2.7.0
101+
-----
102+
103+
* deprecated `Cloner\Data::getLimitedClone()`. Use `withMaxDepth`, `withMaxItemsPerDepth` or `withRefHandles` instead.

Caster/AmqpCaster.php

Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
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\VarDumper\Caster;
13+
14+
use Symfony\Component\VarDumper\Cloner\Stub;
15+
16+
/**
17+
* Casts Amqp related classes to array representation.
18+
*
19+
* @author Grégoire Pineau <[email protected]>
20+
*
21+
* @final
22+
*/
23+
class AmqpCaster
24+
{
25+
private const FLAGS = [
26+
\AMQP_DURABLE => 'AMQP_DURABLE',
27+
\AMQP_PASSIVE => 'AMQP_PASSIVE',
28+
\AMQP_EXCLUSIVE => 'AMQP_EXCLUSIVE',
29+
\AMQP_AUTODELETE => 'AMQP_AUTODELETE',
30+
\AMQP_INTERNAL => 'AMQP_INTERNAL',
31+
\AMQP_NOLOCAL => 'AMQP_NOLOCAL',
32+
\AMQP_AUTOACK => 'AMQP_AUTOACK',
33+
\AMQP_IFEMPTY => 'AMQP_IFEMPTY',
34+
\AMQP_IFUNUSED => 'AMQP_IFUNUSED',
35+
\AMQP_MANDATORY => 'AMQP_MANDATORY',
36+
\AMQP_IMMEDIATE => 'AMQP_IMMEDIATE',
37+
\AMQP_MULTIPLE => 'AMQP_MULTIPLE',
38+
\AMQP_NOWAIT => 'AMQP_NOWAIT',
39+
\AMQP_REQUEUE => 'AMQP_REQUEUE',
40+
];
41+
42+
private const EXCHANGE_TYPES = [
43+
\AMQP_EX_TYPE_DIRECT => 'AMQP_EX_TYPE_DIRECT',
44+
\AMQP_EX_TYPE_FANOUT => 'AMQP_EX_TYPE_FANOUT',
45+
\AMQP_EX_TYPE_TOPIC => 'AMQP_EX_TYPE_TOPIC',
46+
\AMQP_EX_TYPE_HEADERS => 'AMQP_EX_TYPE_HEADERS',
47+
];
48+
49+
public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, bool $isNested): array
50+
{
51+
$prefix = Caster::PREFIX_VIRTUAL;
52+
53+
$a += [
54+
$prefix.'is_connected' => $c->isConnected(),
55+
];
56+
57+
// Recent version of the extension already expose private properties
58+
if (isset($a["\x00AMQPConnection\x00login"])) {
59+
return $a;
60+
}
61+
62+
// BC layer in the amqp lib
63+
if (method_exists($c, 'getReadTimeout')) {
64+
$timeout = $c->getReadTimeout();
65+
} else {
66+
$timeout = $c->getTimeout();
67+
}
68+
69+
$a += [
70+
$prefix.'is_connected' => $c->isConnected(),
71+
$prefix.'login' => $c->getLogin(),
72+
$prefix.'password' => $c->getPassword(),
73+
$prefix.'host' => $c->getHost(),
74+
$prefix.'vhost' => $c->getVhost(),
75+
$prefix.'port' => $c->getPort(),
76+
$prefix.'read_timeout' => $timeout,
77+
];
78+
79+
return $a;
80+
}
81+
82+
public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $isNested): array
83+
{
84+
$prefix = Caster::PREFIX_VIRTUAL;
85+
86+
$a += [
87+
$prefix.'is_connected' => $c->isConnected(),
88+
$prefix.'channel_id' => $c->getChannelId(),
89+
];
90+
91+
// Recent version of the extension already expose private properties
92+
if (isset($a["\x00AMQPChannel\x00connection"])) {
93+
return $a;
94+
}
95+
96+
$a += [
97+
$prefix.'connection' => $c->getConnection(),
98+
$prefix.'prefetch_size' => $c->getPrefetchSize(),
99+
$prefix.'prefetch_count' => $c->getPrefetchCount(),
100+
];
101+
102+
return $a;
103+
}
104+
105+
public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNested): array
106+
{
107+
$prefix = Caster::PREFIX_VIRTUAL;
108+
109+
$a += [
110+
$prefix.'flags' => self::extractFlags($c->getFlags()),
111+
];
112+
113+
// Recent version of the extension already expose private properties
114+
if (isset($a["\x00AMQPQueue\x00name"])) {
115+
return $a;
116+
}
117+
118+
$a += [
119+
$prefix.'connection' => $c->getConnection(),
120+
$prefix.'channel' => $c->getChannel(),
121+
$prefix.'name' => $c->getName(),
122+
$prefix.'arguments' => $c->getArguments(),
123+
];
124+
125+
return $a;
126+
}
127+
128+
public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool $isNested): array
129+
{
130+
$prefix = Caster::PREFIX_VIRTUAL;
131+
132+
$a += [
133+
$prefix.'flags' => self::extractFlags($c->getFlags()),
134+
];
135+
136+
$type = isset(self::EXCHANGE_TYPES[$c->getType()]) ? new ConstStub(self::EXCHANGE_TYPES[$c->getType()], $c->getType()) : $c->getType();
137+
138+
// Recent version of the extension already expose private properties
139+
if (isset($a["\x00AMQPExchange\x00name"])) {
140+
$a["\x00AMQPExchange\x00type"] = $type;
141+
142+
return $a;
143+
}
144+
145+
$a += [
146+
$prefix.'connection' => $c->getConnection(),
147+
$prefix.'channel' => $c->getChannel(),
148+
$prefix.'name' => $c->getName(),
149+
$prefix.'type' => $type,
150+
$prefix.'arguments' => $c->getArguments(),
151+
];
152+
153+
return $a;
154+
}
155+
156+
public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, bool $isNested, int $filter = 0): array
157+
{
158+
$prefix = Caster::PREFIX_VIRTUAL;
159+
160+
$deliveryMode = new ConstStub($c->getDeliveryMode().(2 === $c->getDeliveryMode() ? ' (persistent)' : ' (non-persistent)'), $c->getDeliveryMode());
161+
162+
// Recent version of the extension already expose private properties
163+
if (isset($a["\x00AMQPEnvelope\x00body"])) {
164+
$a["\0AMQPEnvelope\0delivery_mode"] = $deliveryMode;
165+
166+
return $a;
167+
}
168+
169+
if (!($filter & Caster::EXCLUDE_VERBOSE)) {
170+
$a += [$prefix.'body' => $c->getBody()];
171+
}
172+
173+
$a += [
174+
$prefix.'delivery_tag' => $c->getDeliveryTag(),
175+
$prefix.'is_redelivery' => $c->isRedelivery(),
176+
$prefix.'exchange_name' => $c->getExchangeName(),
177+
$prefix.'routing_key' => $c->getRoutingKey(),
178+
$prefix.'content_type' => $c->getContentType(),
179+
$prefix.'content_encoding' => $c->getContentEncoding(),
180+
$prefix.'headers' => $c->getHeaders(),
181+
$prefix.'delivery_mode' => $deliveryMode,
182+
$prefix.'priority' => $c->getPriority(),
183+
$prefix.'correlation_id' => $c->getCorrelationId(),
184+
$prefix.'reply_to' => $c->getReplyTo(),
185+
$prefix.'expiration' => $c->getExpiration(),
186+
$prefix.'message_id' => $c->getMessageId(),
187+
$prefix.'timestamp' => $c->getTimeStamp(),
188+
$prefix.'type' => $c->getType(),
189+
$prefix.'user_id' => $c->getUserId(),
190+
$prefix.'app_id' => $c->getAppId(),
191+
];
192+
193+
return $a;
194+
}
195+
196+
private static function extractFlags(int $flags): ConstStub
197+
{
198+
$flagsArray = [];
199+
200+
foreach (self::FLAGS as $value => $name) {
201+
if ($flags & $value) {
202+
$flagsArray[] = $name;
203+
}
204+
}
205+
206+
if (!$flagsArray) {
207+
$flagsArray = ['AMQP_NOPARAM'];
208+
}
209+
210+
return new ConstStub(implode('|', $flagsArray), $flags);
211+
}
212+
}

0 commit comments

Comments
 (0)