@alessandrolai@phpc.social
@alessandrolai@phpc.social avatar

alessandrolai

@alessandrolai@phpc.social

Head of Platform @ Facile.it, https://phpc.social/@phpfig secretary, @MilanoPHP coordinator, computer science passionate, retired netgaming nerd

This profile is from a federated server and may be incomplete. Browse more on the original instance.

wyri, to php
@wyri@haxim.us avatar

A random unit test breaks in one of my packages, but only on , both and are fine. And of course, it's about \r and
🤦

alessandrolai,
@alessandrolai@phpc.social avatar

@wyri @kboyd i see it as an actual new line on Tusky, lol! 😁

alda, to php
@alda@topspicy.social avatar

As Chrome/Chromium does not include an Icelandic locale for currency and number formats in its JavaScript API, I'll have to resort to rendering currency in the backend using the NumberFormatter class.

Aren't Intl and NumberFormatter usually included with most hosting packages or do I need to worry about that as well?

alessandrolai,
@alessandrolai@phpc.social avatar

@alda you can cover your bases with the polyfill: https://packagist.org/packages/symfony/polyfill-intl-icu

derrabus, to random
@derrabus@phpc.social avatar

It's done. Symfony 7 won't support Doctrine Annotations anymore. PHP's attributes are the future.

alessandrolai,
@alessandrolai@phpc.social avatar

@Skoop @derrabus aren't attributes the same as annotations in terms of names/classes? I already migrated a couple of projects (thanks to Rector) and it was so identical that the git diff was minimal...

taco, to php

can someone convince me why is good actually

alessandrolai,
@alessandrolai@phpc.social avatar

@matzipan @Crell @taco but the startup time of PHP is more than enviable. I'm currently using it under k8s and I can scale up to dozens of pods in a matter of seconds (using a not-lightweight framework like Symfony), while other projects take minutes to go up (I oversee a Nest.JS one, for example, which takes at least 120s to boot).

alessandrolai,
@alessandrolai@phpc.social avatar

@matzipan @Crell @taco in my example, both are queue consumers, but I've seen the same when providing HTTP APIs, you just have to add 5-8 seconds to both for healtchecks to pass. I also heard of pretty worse situations like Java, where you need upwards of 5 minutes to launch a pod, which requires 5-10 times the amount of memory for a single replica...

theseer, to random
@theseer@phpc.social avatar

I have an question: The _Throws-Mutation effectively removes my exit condition to avoid an endless recursion loop and thus runs into a Timeout.

The Timeout though apparently is considered bad, given it's not considered a "killed" mutation.

So, how do I make infection happy? I don't know how to avoid an endless recursion when infection would mutate my exit condition away ;)

alessandrolai,
@alessandrolai@phpc.social avatar

@theseer can't you enforce the timeout at the test level, setting a size? That should count as a failed test. IIRC I had to do it like that somewhere for the same situation.

alessandrolai,
@alessandrolai@phpc.social avatar

@theseer happy to have been of help 😁 it's just that I stumbled on the same issue before 😬

kboyd, to php
@kboyd@phpc.social avatar

I'm sure a number of folks on this instance have heard of The PHP League (aka The League of Extraordinary Packages) https://thephpleague.com/

But tell me - which packages do you use (or that you've used in the past)? What do you like about them?

#php

alessandrolai,
@alessandrolai@phpc.social avatar

@kboyd FlySystem (over and over), CSV, Commonmark (for the @phpfig website)

nebucatnetzer, to programming

Still a great talk by @vanamerongen about how to use properly. It’s a very down to earth talk and explains things in a way that doesn’t make you feel stupid. Would recommend it everyone who has basic knowledge about git but felt they should be better by now.

https://www.youtube.com/watch?v=_e5oq4JT4_8

alessandrolai,
@alessandrolai@phpc.social avatar

@nebucatnetzer @vanamerongen is the content the same as this one other, more recent recording? I definitely loved this one, and it had an immediate influence on how I do my commits: https://youtu.be/Qf5LYx5l9Qc

alessandrolai,
@alessandrolai@phpc.social avatar

@vanamerongen @nebucatnetzer immediately added to "Watch it later", thank you!

grmpyprogrammer, to random
@grmpyprogrammer@phpc.social avatar

After many years of trying I finally summoned the patience to make a good omelette

alessandrolai,
@alessandrolai@phpc.social avatar

@grmpyprogrammer and you're getting it at breakfast! That's a big step up from other non-Italians 😂

alessandrolai, to random Italian
@alessandrolai@phpc.social avatar

Yesterday @codito PR was merged, adding to @PHPCSFixer CI, making more than 4x faster!

https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/pull/6883

I created Paraunit with a colleague more than 8 years ago for this same need: CPU time is a couple of orders of magnitude cheaper than dev time, and shorter feedback cycles are vital to our job, so having a CI time under 5 minutes is golden!

nunomaduro, to random
@nunomaduro@mastodon.social avatar

It is unlikely that the RFC for "interface default methods" will be accepted, and that's perfectly alright! If a feature does not gain widespread acceptance, it is best to not have it in the language. https://wiki.php.net/rfc/interface-default-methods

alessandrolai,
@alessandrolai@phpc.social avatar

@hugot @nunomaduro with an abstract class you're locked into inheritance, but not with an interface

dandb, to php
@dandb@mas.to avatar

Generics in would make my life so much easier today.

alessandrolai,
@alessandrolai@phpc.social avatar

@ramsey @dandb @wogan absolutely! I use generics in annotationa a lot in pairing with @phpstan, and for closed projects IMHO you get 80-90% of the benefits with it

  • All
  • Subscribed
  • Moderated
  • Favorites
  • provamag3
  • thenastyranch
  • magazineikmin
  • InstantRegret
  • osvaldo12
  • cubers
  • rosin
  • Youngstown
  • slotface
  • Durango
  • everett
  • kavyap
  • khanakhh
  • DreamBathrooms
  • megavids
  • ngwrru68w68
  • Leos
  • modclub
  • cisconetworking
  • love
  • GTA5RPClips
  • ethstaker
  • mdbf
  • anitta
  • normalnudes
  • tester
  • tacticalgear
  • JUstTest
  • All magazines