« first day (4270 days earlier)      last day (663 days later) » 

Wes
1:14 AM
enum DontChange{ case get; }

singleton scalar object that you can use as default argument in parameters in order to make them skippable

public function updateEntity(..., string|null|DontChange $param = DontChange::get, ...){

}
goodbye DTO clutter, i guess
(yes i know you can do that with null, but sometimes null has a special meaning, so you need multiple "empty" types)
 
It's a null rod.
 
Wes
in that case if DontChange is passed, it means don't update the respective DB column
if null is passed, it means set it to exactly null
i bet crell now regrets inventing enums
 
Wes
how'd you think of that
 
1:31 AM
tbh, reminds me of a joke I made before:
Sep 26, 2017 at 19:02, by Danack
Me, when i'm writing classes like NullLogger. https://t.co/2Gn715XkNN
 
Wes
1:49 AM
:P
 
Wes
2:14 AM
<?php

function bar(
    int $foo = 123,
    float $bar
){}


bar(bar: 666.);
Deprecated: Optional parameter $foo declared before required parameter $bar is implicitly treated as a required parameter in /in/WuPkb on line 3

why tho?
 
JRL
@Wes because you can't call it with something like bar(default, 1.5);
I would assume
 
Wes
hm
not that it matters that much, i was just curious as to why that is not considered valid
so, you are saying it's for backwards compatibility?
 
 
11 hours later…
1:09 PM
Morgens o/
 
o7
 
1:20 PM
Heya Mr Aykroyd :)
 
@PeeHaa if you're going to be like that, I shall inflict on you some 'propa' Bristol music:
 
2:15 PM
:D
 
2:55 PM
morns
 
 
4 hours later…
7:15 PM
Sonday
 
JRL
7:35 PM
Both DNF Types an Go Kudo's RNG Extension look like they will pass :)
that's great news
 

« first day (4270 days earlier)      last day (663 days later) »