Skip to content

Commit 716547c

Browse files
committed
Update CHANGELOG for 6.4.13
0 parents  commit 716547c

File tree

142 files changed

+16676
-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.

142 files changed

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

Caster/AmqpCaster.php

Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
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+
/**
50+
* @return array
51+
*/
52+
public static function castConnection(\AMQPConnection $c, array $a, Stub $stub, bool $isNested)
53+
{
54+
$prefix = Caster::PREFIX_VIRTUAL;
55+
56+
$a += [
57+
$prefix.'is_connected' => $c->isConnected(),
58+
];
59+
60+
// Recent version of the extension already expose private properties
61+
if (isset($a["\x00AMQPConnection\x00login"])) {
62+
return $a;
63+
}
64+
65+
// BC layer in the amqp lib
66+
if (method_exists($c, 'getReadTimeout')) {
67+
$timeout = $c->getReadTimeout();
68+
} else {
69+
$timeout = $c->getTimeout();
70+
}
71+
72+
$a += [
73+
$prefix.'is_connected' => $c->isConnected(),
74+
$prefix.'login' => $c->getLogin(),
75+
$prefix.'password' => $c->getPassword(),
76+
$prefix.'host' => $c->getHost(),
77+
$prefix.'vhost' => $c->getVhost(),
78+
$prefix.'port' => $c->getPort(),
79+
$prefix.'read_timeout' => $timeout,
80+
];
81+
82+
return $a;
83+
}
84+
85+
/**
86+
* @return array
87+
*/
88+
public static function castChannel(\AMQPChannel $c, array $a, Stub $stub, bool $isNested)
89+
{
90+
$prefix = Caster::PREFIX_VIRTUAL;
91+
92+
$a += [
93+
$prefix.'is_connected' => $c->isConnected(),
94+
$prefix.'channel_id' => $c->getChannelId(),
95+
];
96+
97+
// Recent version of the extension already expose private properties
98+
if (isset($a["\x00AMQPChannel\x00connection"])) {
99+
return $a;
100+
}
101+
102+
$a += [
103+
$prefix.'connection' => $c->getConnection(),
104+
$prefix.'prefetch_size' => $c->getPrefetchSize(),
105+
$prefix.'prefetch_count' => $c->getPrefetchCount(),
106+
];
107+
108+
return $a;
109+
}
110+
111+
/**
112+
* @return array
113+
*/
114+
public static function castQueue(\AMQPQueue $c, array $a, Stub $stub, bool $isNested)
115+
{
116+
$prefix = Caster::PREFIX_VIRTUAL;
117+
118+
$a += [
119+
$prefix.'flags' => self::extractFlags($c->getFlags()),
120+
];
121+
122+
// Recent version of the extension already expose private properties
123+
if (isset($a["\x00AMQPQueue\x00name"])) {
124+
return $a;
125+
}
126+
127+
$a += [
128+
$prefix.'connection' => $c->getConnection(),
129+
$prefix.'channel' => $c->getChannel(),
130+
$prefix.'name' => $c->getName(),
131+
$prefix.'arguments' => $c->getArguments(),
132+
];
133+
134+
return $a;
135+
}
136+
137+
/**
138+
* @return array
139+
*/
140+
public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, bool $isNested)
141+
{
142+
$prefix = Caster::PREFIX_VIRTUAL;
143+
144+
$a += [
145+
$prefix.'flags' => self::extractFlags($c->getFlags()),
146+
];
147+
148+
$type = isset(self::EXCHANGE_TYPES[$c->getType()]) ? new ConstStub(self::EXCHANGE_TYPES[$c->getType()], $c->getType()) : $c->getType();
149+
150+
// Recent version of the extension already expose private properties
151+
if (isset($a["\x00AMQPExchange\x00name"])) {
152+
$a["\x00AMQPExchange\x00type"] = $type;
153+
154+
return $a;
155+
}
156+
157+
$a += [
158+
$prefix.'connection' => $c->getConnection(),
159+
$prefix.'channel' => $c->getChannel(),
160+
$prefix.'name' => $c->getName(),
161+
$prefix.'type' => $type,
162+
$prefix.'arguments' => $c->getArguments(),
163+
];
164+
165+
return $a;
166+
}
167+
168+
/**
169+
* @return array
170+
*/
171+
public static function castEnvelope(\AMQPEnvelope $c, array $a, Stub $stub, bool $isNested, int $filter = 0)
172+
{
173+
$prefix = Caster::PREFIX_VIRTUAL;
174+
175+
$deliveryMode = new ConstStub($c->getDeliveryMode().(2 === $c->getDeliveryMode() ? ' (persistent)' : ' (non-persistent)'), $c->getDeliveryMode());
176+
177+
// Recent version of the extension already expose private properties
178+
if (isset($a["\x00AMQPEnvelope\x00body"])) {
179+
$a["\0AMQPEnvelope\0delivery_mode"] = $deliveryMode;
180+
181+
return $a;
182+
}
183+
184+
if (!($filter & Caster::EXCLUDE_VERBOSE)) {
185+
$a += [$prefix.'body' => $c->getBody()];
186+
}
187+
188+
$a += [
189+
$prefix.'delivery_tag' => $c->getDeliveryTag(),
190+
$prefix.'is_redelivery' => $c->isRedelivery(),
191+
$prefix.'exchange_name' => $c->getExchangeName(),
192+
$prefix.'routing_key' => $c->getRoutingKey(),
193+
$prefix.'content_type' => $c->getContentType(),
194+
$prefix.'content_encoding' => $c->getContentEncoding(),
195+
$prefix.'headers' => $c->getHeaders(),
196+
$prefix.'delivery_mode' => $deliveryMode,
197+
$prefix.'priority' => $c->getPriority(),
198+
$prefix.'correlation_id' => $c->getCorrelationId(),
199+
$prefix.'reply_to' => $c->getReplyTo(),
200+
$prefix.'expiration' => $c->getExpiration(),
201+
$prefix.'message_id' => $c->getMessageId(),
202+
$prefix.'timestamp' => $c->getTimeStamp(),
203+
$prefix.'type' => $c->getType(),
204+
$prefix.'user_id' => $c->getUserId(),
205+
$prefix.'app_id' => $c->getAppId(),
206+
];
207+
208+
return $a;
209+
}
210+
211+
private static function extractFlags(int $flags): ConstStub
212+
{
213+
$flagsArray = [];
214+
215+
foreach (self::FLAGS as $value => $name) {
216+
if ($flags & $value) {
217+
$flagsArray[] = $name;
218+
}
219+
}
220+
221+
if (!$flagsArray) {
222+
$flagsArray = ['AMQP_NOPARAM'];
223+
}
224+
225+
return new ConstStub(implode('|', $flagsArray), $flags);
226+
}
227+
}

0 commit comments

Comments
 (0)