8000 Avoid broken action URL in text notification mail by mbrodala · Pull Request #41738 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Avoid broken action URL in text notification mail #41738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 67 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
20bf651
[Runtime] allow "|^6.0" deps
nicolas-grekas May 20, 2021
1a0c105
minor #41331 [Runtime] allow "|^6.0" deps (nicolas-grekas)
nicolas-grekas May 20, 2021
5eab165
Merge branch '5.3' into 5.4
derrabus May 20, 2021
0aedd99
Merge branch '5.3' into 5.4
nicolas-grekas May 20, 2021
c5b5115
Merge branch '5.3' into 5.4
nicolas-grekas May 20, 2021
f836f6b
Merge branch '5.3' into 5.4
nicolas-grekas May 20, 2021
cbc7c5d
Merge branch '5.3' into 5.4
derrabus May 20, 2021
c82d8c9
Merge branch '5.3' into 5.4
derrabus May 21, 2021
c339649
feature #41203 [FrameworkBundle] Add autowiring alias for `HttpCache\…
derrabus May 22, 2021
f27e6cc
Merge branch '5.3' into 5.4
derrabus May 22, 2021
14540c1
Merge branch '5.3' into 5.4
nicolas-grekas May 23, 2021
744b901
Merge branch '5.3' into 5.4
nicolas-grekas May 23, 2021
c904089
Merge branch '5.3' into 5.4
derrabus May 23, 2021
6d3e90d
[FrameworkBundle] Deprecate the `AdapterInterface` autowiring alias, …
nicolas-grekas May 12, 2021
e574a24
Merge branch '5.3' into 5.4
nicolas-grekas May 24, 2021
fa7b518
feature #41199 [FrameworkBundle] Deprecate the `AdapterInterface` aut…
derrabus May 24, 2021
9688631
Merge branch '5.3' into 5.4
xabbuh May 25, 2021
27b1654
Merge branch '5.3' into 5.4
xabbuh May 25, 2021
0458384
Fix compatibility with Symfony6
jderusse May 20, 2021
46ca50f
Merge branch '5.3' into 5.4
nicolas-grekas May 26, 2021
b7c9b1e
Merge branch '5.3' into 5.4
nicolas-grekas May 27, 2021
6805929
Merge branch '5.3' into 5.4
nicolas-grekas May 27, 2021
2ba71b0
[travis] test with v6 on deps=high
nicolas-grekas May 27, 2021
cfb1016
bug #41343 [HttpKernel] Fix compatibility with Symfony6 (jderusse)
nicolas-grekas May 27, 2021
b56606e
Provide migration path for TestSessionListener
jderusse May 29, 2021
b7e9194
Fix sessionListener when factory is injected without session
jderusse Jun 1, 2021
7714648
bug #41446 [HttpKernel] Provide migration path for TestSessionListene…
nicolas-grekas Jun 1, 2021
e2d1cb1
bug #41486 [HttpKernel] Fix sessionListener when factory is injected …
nicolas-grekas Jun 1, 2021
f4da7e4
[Yaml] Leverage array_is_list()
nicolas-grekas May 28, 2021
c4404fd
Merge branch '5.3' into 5.4
derrabus Jun 1, 2021
dbeebd1
Merge branch '5.3' into 5.4
derrabus Jun 1, 2021
2fe4442
minor #41431 [Yaml] Leverage array_is_list() (nicolas-grekas)
nicolas-grekas Jun 2, 2021
9ccd0ad
Merge branch '5.3' into 5.4
nicolas-grekas Jun 3, 2021
06b13c3
[FrameworkBundle] Deprecate the public `profiler` service to private
nicolas-grekas Jun 3, 2021
204ae47
Merge branch '5.3' into 5.4
derrabus Jun 5, 2021
1509797
Merge branch '5.3' into 5.4
nicolas-grekas Jun 5, 2021
dae0291
feature #41530 [FrameworkBundle] Deprecate the public `profiler` serv…
nicolas-grekas Jun 6, 2021
1e3c875
Merge branch '5.3' into 5.4
derrabus Jun 6, 2021
37a89f1
Merge branch '5.3' into 5.4
nicolas-grekas Jun 7, 2021
e66c907
Merge branch '5.3' into 5.4
nicolas-grekas Jun 7, 2021
b14fe61
Merge branch '5.3' into 5.4
nicolas-grekas Jun 8, 2021
6eb7f28
Merge branch '5.3' into 5.4
nicolas-grekas Jun 8, 2021
ddfab8d
Merge branch '5.3' into 5.4
derrabus Jun 8, 2021
d1b81fb
Merge branch '5.3' into 5.4
derrabus Jun 9, 2021
0dde2cc
[VarDumper] Add casters for Symfony UUIDs and ULIDs
fancyweb Jun 4, 2021
a6770fd
Merge branch '5.3' into 5.4
chalasr Jun 11, 2021
20de32e
Merge branch '5.3' into 5.4
chalasr Jun 11, 2021
2a3c003
feature #41540 [VarDumper] Add casters for Symfony UUIDs and ULIDs (f…
nicolas-grekas Jun 12, 2021
f12a419
Merge branch '5.3' into 5.4
nicolas-grekas Jun 12, 2021
0486a53
Merge branch '5.3' into 5.4
derrabus Jun 16, 2021
a0728f2
Merge branch '5.3' into 5.4
nicolas-grekas Jun 17, 2021
86a0672
Merge branch '5.3' into 5.4
nicolas-grekas Jun 17, 2021
c71c872
Merge branch '5.3' into 5.4
derrabus Jun 17, 2021
663a736
Avoid broken action URL in text notification mail
mbrodala Jun 18, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[VarDumper] Add casters for Symfony UUIDs and ULIDs
  • Loading branch information
fancyweb committed Jun 11, 2021
commit 0dde2cce14c89121bf9115632bc43b02293e9b66
5 changes: 5 additions & 0 deletions src/Symfony/Component/VarDumper/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

5.4
---

* Add casters for Symfony's UUIDs and ULIDs

5.2.0
-----

Expand Down
28 changes: 28 additions & 0 deletions src/Symfony/Component/VarD 8000 umper/Caster/SymfonyCaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
namespace Symfony\Component\VarDumper\Caster;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Uid\Ulid;
use Symfony\Component\Uid\Uuid;
use Symfony\Component\VarDumper\Cloner\Stub;

/**
Expand Down Expand Up @@ -66,4 +68,30 @@ public static function castHttpClientResponse($response, array $a, Stub $stub, b

return $a;
}

public static function castUuid(Uuid $uuid, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'toBase58'] = $uuid->toBase58();
$a[Caster::PREFIX_VIRTUAL.'toBase32'] = $uuid->toBase32();

// symfony/uid >= 5.3
if (method_exists($uuid, 'getDateTime')) {
$a[Caster::PREFIX_VIRTUAL.'time'] = $uuid->getDateTime()->format('Y-m-d H:i:s.u \U\T\C');
}

return $a;
}

public static function castUlid(Ulid $ulid, array $a, Stub $stub, bool $isNested)
{
$a[Caster::PREFIX_VIRTUAL.'toBase58'] = $ulid->toBase58();
$a[Caster::PREFIX_VIRTUAL.'toRfc4122'] = $ulid->toRfc4122();

// symfony/uid >= 5.3
if (method_exists($ulid, 'getDateTime')) {
$a[Caster::PREFIX_VIRTUAL.'time'] = $ulid->getDateTime()->format('Y-m-d H:i:s.v \U\T\C');
}

return $a;
}
}
2 changes: 2 additions & 0 deletions src/Symfony/Component/VarDumper/Cloner/AbstractCloner.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ abstract class AbstractCloner implements ClonerInterface
'Symfony\Component\HttpClient\Response\CurlResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'],
'Symfony\Component\HttpClient\Response\NativeResponse' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castHttpClientResponse'],
'Symfony\Component\HttpFoundation\Request' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castRequest'],
'Symfony\Component\Uid\Ulid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUlid'],
'Symfony\Component\Uid\Uuid' => ['Symfony\Component\VarDumper\Caster\SymfonyCaster', 'castUuid'],
'Symfony\Component\VarDumper\Exception\ThrowingCasterException' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castThrowingCasterException'],
'Symfony\Component\VarDumper\Caster\TraceStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castTraceStub'],
'Symfony\Component\VarDumper\Caster\FrameStub' => ['Symfony\Component\VarDumper\Caster\ExceptionCaster', 'castFrameStub'],
Expand Down
83 changes: 83 additions & 0 deletions src/Symfony/Component/VarDumper/Tests/Caster/SymfonyCasterTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?php

/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Component\VarDumper\Tests\Caster;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Uid\Ulid;
use Symfony\Component\Uid\UuidV4;
use Symfony\Component\Uid\UuidV6;
use Symfony\Component\VarDumper\Test\VarDumperTestTrait;

final class SymfonyCasterTest extends TestCase
{
use VarDumperTestTrait;

public function testCastUuid()
{
$uuid = new UuidV4('83a9db35-3c8c-4040-b3c1-02eccc00b419');
$expectedDump = <<<EODUMP
Symfony\Component\Uid\UuidV4 {
#uid: "83a9db35-3c8c-4040-b3c1-02eccc00b419"
toBase58: "HFzAAuYvev42cCjwqpnKqz"
toBase32: "43N7DKAF4C810B7G82XK601D0S"
}
EODUMP;
$this->assertDumpEquals($expectedDump, $uuid);

$uuid = new UuidV6('1ebc50e9-8a23-6704-ad6f-59afd5cda7e5');
if (method_exists($uuid, 'getDateTime')) {
$expectedDump = <<<EODUMP
Symfony\Component\Uid\UuidV6 {
#uid: "1ebc50e9-8a23-6704-ad6f-59afd5cda7e5"
toBase58: "4o8c5m6v4L8h5teww36JDa"
toBase32: "0YQH8EK2H3CW2ATVTSNZAWV9Z5"
time: "2021-06-04 08:26:44.591386 UTC"
}
EODUMP;
} else {
$expectedDump = <<<EODUMP
Symfony\Component\Uid\UuidV6 {
#uid: "1ebc50e9-8a23-6704-ad6f-59afd5cda7e5"
toBase58: "4o8c5m6v4L8h5teww36JDa"
toBase32: "0YQH8EK2H3CW2ATVTSNZAWV9Z5"
}
EODUMP;
}

$this->assertDumpEquals($expectedDump, $uuid);
}

public function testCastUlid()
{
$ulid = new Ulid('01F7B252SZQGTSQGYSGACASAW6');
if (method_exists($ulid, 'getDateTime')) {
$expectedDump = <<<EODUMP
Symfony\Component\Uid\Ulid {
#uid: "01F7B252SZQGTSQGYSGACASAW6"
toBase58: "1Ba6pJPFWDwghSKFVvfQ1B"
toRfc4122: "0179d622-8b3f-bc35-9bc3-d98298acab86"
time: "2021-06-04 08:27:38.687 UTC"
}
EODUMP;
} else {
$expectedDump = <<<EODUMP
Symfony\Component\Uid\Ulid {
#uid: "01F7B252SZQGTSQGYSGACASAW6"
toBase58: "1Ba6pJPFWDwghSKFVvfQ1B"
toRfc4122: "0179d622-8b3f-bc35-9bc3-d98298acab86"
}
EODUMP;
}

$this->assertDumpEquals($expectedDump, $ulid);
}
}
1 change: 1 addition & 0 deletions src/Symfony/Component/VarDumper/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"ext-iconv": "*",
"symfony/console": "^4.4|^5.0|^6.0",
"symfony/process": "^4.4|^5.0|^6.0",
"symfony/uid": "^5.1|^6.0",
"twig/twig": "^2.13|^3.0.4"
},
"conflict": {
Expand Down
0