Created
January 23, 2018 12:00
-
-
Save giorgiosironi/f421c60cd63c2918e162e27e09d6bb84 to your computer and use it in GitHub Desktop.
When your Value Object is so immutable, you remove a field and a non-deterministic value is readded in its place
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'vendor/autoload.php'; | |
$response = Symfony\Component\HttpFoundation\Response::create('HelloWorld'); | |
$response->headers->remove('Date'); | |
$response->headers->remove('date'); // just to be sure | |
var_dump($response->headers->all()); | |
/* | |
array(2) { | |
["cache-control"]=> | |
array(1) { | |
[0]=> | |
string(17) "no-cache, private" | |
} | |
["date"]=> | |
array(1) { | |
[0]=> | |
string(29) "Tue, 23 Jan 2018 11:53:09 GMT" | |
} | |
} | |
*/ | |
// see https://github.com/symfony/http-foundation/blob/master/ResponseHeaderBag.php#L39-L42 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment