| 3 Oct 2022 |
Pol | ZTS was used when it was PHP was used mostly with Apache. | 14:16:32 |
Pol | Nowadays NTS is mostly used, this is the default now. | 14:17:08 |
| spacesbot - keeps a log of public NixOS channels joined the room. | 14:25:32 |
etu | I see, so I guess we should just switch over to NTS then? Will it affect Apache usage though? | 14:55:24 |
aanderse |
Will it affect Apache usage though?
yes, httpd can't/shouldn't use threaded php with mod_php
| 15:43:15 |
etu | Yeah, we have to... organize that in some nice way that doesn't get cluttered I guess | 15:57:06 |
etu | And gets cached | 15:57:12 |
Pol | ramsey: | 17:42:41 |
Pol | The message you posted on Twitter the other day, about immutability and stuff | 17:42:58 |
Pol | * The message you posted on Twitter the other day, about immutability and PSalm stuff | 17:43:05 |
Pol | Was it related to the class RandomNodeService of ramsey/identifier ? | 17:43:26 |
Pol | I guess this is the reason why you didn't do: | 17:43:36 |
Pol |  Download image.png | 17:43:39 |
ramsey | Yes | 17:45:43 |
Pol | Ah right, so, you can discard my screenshot then :) | 17:46:02 |
ramsey | Well... sort of. It was about using that class within another class that's immutable | 17:46:03 |
Pol | Okay | 17:46:23 |
ramsey | It was about trying to designate the UUID factories as immutable, but I can't do that because I'm using that random service here: https://github.com/ramsey/identifier/blob/cd0fb1c321bf3c3c1fd418a3318f5904b3a8e9c3/src/Uuid/Factory/UuidV4Factory.php#L52 | 17:47:48 |
Pol | Oh... what's the best pattern there? | 17:49:23 |
ramsey | I don't know. It technically mutates the state of the randomizer on the machine, so the class can't be considered immutable | 17:49:53 |
ramsey | So, I removed the @psalm-immutable annotation 🙂 | 17:50:05 |
Pol | Having a look. | 17:50:40 |
Pol | It's weird because no property is being modified. | 17:51:10 |
ramsey | Right, but random_bytes() and random_int() mutate the state of the machine | 17:51:32 |
ramsey | so, the class performs mutating operations | 17:51:48 |
Pol | Yeah but you do not modify the class itself, so psalm shouldn't complain IMHO | 17:52:06 |
Pol | Going to make some experimentations :) | 17:52:17 |
ramsey | Psalm complains because an immutable class shouldn't mutate state anywhere (internally or externally) | 17:52:36 |
Pol | Maybe you should not create the $bytes variable there, just pass the random service to Binary::applyVersionAndVariant | 17:53:58 |
Pol | Something like that? | 17:54:35 |