@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.

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?

alessandrolai,
@alessandrolai@phpc.social avatar

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

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

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

Another release fresh off the press!!

I've finally tagged 2.0.0 stable of facile-it/doctrine-mysql-come-back (after a month of BETA4), which brings support for @doctrine DBAL v3 (3.6+ to be precise)

This small library is a connection wrapper that reconnects automatically when the infamous "MySQL has gone away" error (or similar ones) pops up. If you ever encountered that, try it out, it's automagic!

https://github.com/facile-it/doctrine-mysql-come-back/releases/tag/2.0.0

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

I just released 2.2.0, which adds support for the Cobertura XML coverage report, leveraging the underlying @phpunit feature.

This was useful for me to feed it to GitLab's test code coverage visualization feature.

https://github.com/facile-it/paraunit/releases/tag/2.2.0

thomasfuchs, to random
@thomasfuchs@hachyderm.io avatar

I spare you the Space Karen screenshot but he wants to remove the โ€œblockโ€ feature from Twitter.

Heโ€™s like an AI model trained to ruin nice things.

alessandrolai,
@alessandrolai@phpc.social avatar

@thomasfuchs I bet that's because he doesn't want people to block HIM.

ramsey, to php
@ramsey@phpc.social avatar

The @phpfig PSRs should also define the names of the packages that include the interfaces, as well as the name used to indicate implementations of the PSR.

i.e., PSR-17 would include psr/http-factory and psr/http-factory-implementation, so I donโ€™t have to go searching for these names every time.

alessandrolai,
@alessandrolai@phpc.social avatar

@lewiscowles1986 @ramsey no they didn't. A couple of them left the "project representative" position inside the @phpfig, but i.e. Symfony is still implementing those. Latest example, PSR-20 and the Clock component: https://symfony.com/doc/current/components/clock.html#usage

ian, to random
@ian@phpc.social avatar

So, back on May 26 or so, the versions of the @getsentry PHP SDK being used in one of my projects started not getting payloads to Sentry, albeit just in an AWS environment. Bumping to Sentry's latest SDK fixed it (from 3.12 to 3.19.1) but I really want to know what broke.

@alessandrolai, any ideas here?

alessandrolai,
@alessandrolai@phpc.social avatar

@ian @getsentry there were some recent issues on the HTTP layer, due to sub dependencies. Maybe you changed something there?

herndlm, (edited ) to php
@herndlm@phpc.social avatar

I think there was a composer plugin or smth that makes sure typical dev dependencies never end up in the require section of the lockfile, right? Which one is it?

Background: A colleague added a composer dev dependency by mistake to the require section in an internal plugin and nobody noticed. When requiring that plugin the dev dependency ended up in the lockfile and vendor of the main app and again nobody noticed. And I'd like to catch that.

alessandrolai,
@alessandrolai@phpc.social avatar

@herndlm you can probably use Composer Unused? But I'm not sure it covers your use case.

Otherwise, what you require is the reverse of Composer Require Checker, so still out of luck...

jrf_nl, to random
@jrf_nl@phpc.social avatar

What the f*ck people ?
Copying code I wrote into your own project and then reporting bugs which don't exist in the original project and expect me to solve your shit ????

Seriously, use Composer like a normal person and don't rip off other people's code....

And yes, they are violating the project license as well.

alessandrolai,
@alessandrolai@phpc.social avatar

@afilina @jrf_nl I have to just hope that's only partially malicious, and it's just uneducated people that do not know how OSS licenses work, and they think that "open" means "I can do what I want with that".

tdpauw, to random
@tdpauw@mastodon.social avatar

In IT more people should do an internship in a factory. Not in the offices, but on the work floor! Just to understand the effects of queuing, batch sizes and inventory.

The number of people that do not understand these effects is abysmal ๐Ÿ™„

alessandrolai,
@alessandrolai@phpc.social avatar

@tdpauw that's one of the reasons that made me love The Unicorn Project! It describes this perfectly, with a constant parallel toward software development

alessandrolai,
@alessandrolai@phpc.social avatar

@tdpauw ouch my mistake, I was thinking of the Phoenix Project, I messed up the titles! But IIRC there's some bit of that there too, since it's a parallel storyline...

ian, to random
@ian@phpc.social avatar

Thanks to @Synchro, @alessandrolai, and @dstockto for helping get my PHP 8.2 compat branch of Joind.in (https://github.com/iansltx/joindin-api/tree/php82) down to 462 @phpstan errors!

I'll stay on top of PRs to this branch as folks throw 'em my way, and do some more cleanup work on my own over the weekend :)

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

Wanna help me get Joind.in's API to zero phpstan errors on PHP 8.2? https://github.com/joindin/joindin-api/pull/944

Got it down to a little under 600 with like three hours of effort, with tests still passing of course.

alessandrolai,
@alessandrolai@phpc.social avatar

@ian I'll give it a go, I have an hour to kill, and squashing PHPStan issues gives me some Marie-Kondo-style satisfaction ๐Ÿ˜†

alessandrolai,
@alessandrolai@phpc.social avatar

@ian @Synchro Crap, too late ๐Ÿ˜… well, this is my small bit of work, hope it's not wasted!

Crell, to random
@Crell@phpc.social avatar

What did we used to call DTOs before the dumb term "data transfer object" was invented? For a simple but explicit data-only or mostly data-only object.

I don't see a need to really distinguish from value objects, personally.

alessandrolai,
@alessandrolai@phpc.social avatar

@Crell in my mind, VO have immutability and the ability to compare as strong requirement, while DTO do not... That's the difference for me.

alessandrolai,
@alessandrolai@phpc.social avatar

@Crell also, invalid VO should not be instantiable, while DTO containing invalid data are a meaningful use case (think submitted form data).

alessandrolai,
@alessandrolai@phpc.social avatar

@Crell first example that comes to mind, to back a Symfony form. Or any other case where I can't fill the object all at once, because I'm fetching data from different sources.

beausimensen, to random
@beausimensen@phpc.social avatar

I want to encode similar objects of the same general type and shape but have different intent.

I need interpret the data in TypeScript. Shape alone wonโ€™t be enough to distinguish between shapes as some shapes will be identical but have different intent.

Iโ€™d settle for using a โ€œdiscriminatorโ€ but it seems like neither JSON Schema nor TypeScript have this concept.

Is this possible with either JSON Schema or TypeScript? Is it possible with some other tools or formats I donโ€™t know about?

alessandrolai,
@alessandrolai@phpc.social avatar

@beausimensen maybe you should use JSON schema? OpenAPI 3.1 adopted it for shaping data.

alessandrolai,
@alessandrolai@phpc.social avatar

@beausimensen oh right! Tagged unions is another way to call it, if you're using Typescript that's definitely the way to go

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

Next week I'll be at @phpday, and I will bring with me not one, but TWO Aida that I'm willing to trade.

I would love a one, but I'm open to any which I do not own already (default blue, Mollie, SiteGround)

Hit me up in DMs if you want to trade!!

kboyd, to random
@kboyd@phpc.social avatar

My filters are getting quite a workout tonight. I must continue to resist clicking on them, for my own health and safety. Well, mostly just blood pressure.

alessandrolai,
@alessandrolai@phpc.social avatar

@kboyd Ahahahah ๐Ÿ˜‚ as an Italian, your filter name gave me a good laugh

ramsey, to random
@ramsey@phpc.social avatar

Problem: I have two DB tables, and Iโ€™m trying to select from the first table for records that do not exist in the second table. Over time, as I process each record, Iโ€™ll write to the 2nd table, and then those records will be excluded on subsequent queries.

Pretty standard stuff. The queries are easy to write, and there are several ways to write them (e.g. left join where is null, where not in subquery, where not exists subquery).

1/2

alessandrolai,
@alessandrolai@phpc.social avatar

@ramsey you have to use a subsequent sequence of field from the start of the indexed fields... I learned it too the hard way ๐Ÿ˜‚

I also recently read this great article that explains all these gotchas for MySQL: https://planetscale.com/blog/why-isnt-mysql-using-my-index

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