PHP

Crell,
@Crell@phpc.social avatar

Only use inheritance when you want both hierarchical code reuse and subtype polymorphism.

https://youtu.be/C3B5IIlt4-0

On a similar vein, my article from a decade ago:

https://www.garfieldtech.com/blog/beyond-abstract

jclermont,
@jclermont@phpc.social avatar

Fresh off php tek last week, I'm reminded that conferences are so much more than just the talks. https://masteringlaravel.io/daily/2024-05-01-conferences-are-more-than-just-talks

cspray,
@cspray@phpc.social avatar

I have found myself, for the first time, having to write what I consider worse code to satisfy Psalm static analysis. Here's a watered-down example showing what I consider odd behavior.

https://psalm.dev/r/5862a290e2

I'm not certain why the 2nd call to doSomething() is valid but the 1st call is not.

sidawson,
@sidawson@mastodon.nz avatar

@cspray Oh, and to your specific example, if phpstan is anything to go by, it seems php stores non associative arrays internally AS associative, it’s just that the keys are indexes (0, 1, 2…) so that’s the “expects array <int, string >, was provided array<string >” malarkey.

In phpstan you can go either array<int, string> (or array<array-key, string>), or, more simply string[] - but the latter form avoids those sorts of complaints. Might be worth having a looksee if psalm is similar.

alessandrolai,
@alessandrolai@phpc.social avatar

@sidawson @cspray that's not the issue here. The same snippet should trigger PHPStan errors too, because it was the starting definition too strict, since it requires "list".

List is an array with only consecutive integer keys. If you don't re-index (and the spread operator does) you don't have a (guaranteed) list anymore.

Crell,
@Crell@phpc.social avatar

ICYMI, I spoke with Brent Roose about the new property hooks feature coming to 8.4, the RFC process, and how we can make it better.

https://www.youtube.com/live/ULUrhIrjyAg

brotkrueml, German
@brotkrueml@phpc.social avatar

Rhein-Ruhr vom 8.-10. November 2024 in Kamp-Lintfort

✅ Ticket
✅ Unterkunft

Ich werde sicherlich wieder die eine oder andere Session im Gepäck haben. Wir sehen uns.

https://www.typo3camp-rheinruhr.de

paragon,
@paragon@phpc.social avatar
rob,
@rob@akrabat.com avatar

I've just cut a release of SlimPHP's Twig-View component to allow for either psr/http-message 1.1 or 2.0.

This minor change that makes Twig-View easier to use with other package that use php/http-message and need the later version.

https://github.com/slimphp/Twig-View/releases/tag/3.4.0

mhuber84, German
@mhuber84@troet.cafe avatar

Es gibt noch 10 günstige EarlyBird-Tickets für das . Also jetzt nur noch 9, weil ein Supporter-Ticket hab ich mir gerade geschnappt. :mastojoy: https://www.eventbrite.de/e/typo3-camp-rheinruhr-2024-tickets-884803058767?aff=oddtdtcreator

sarah,
@sarah@phpc.social avatar

Working on a new idea for a talk. It’s called DRM - developer resource management - and it’s a framework for helping projects succeed, developers thrive, and companies avoid embarrassing incidents of security and downtime.

What user groups would like a speaker?

thepanz,
@thepanz@phpc.social avatar

@sarah oh, I see! I will check with the other organisers, but will keep you up to date.

The php community topic is also interesting, could have @michelle join from our remote-office 😉

Let's see, I will check the feasibility in the next days

lotharthesavior,
@lotharthesavior@phpc.social avatar

@sarah I would love to see an article about that at least! very interesting subject

ntha,
@ntha@mastodon.social avatar

Modern React.js with Vite is really nice, with out of the box TypeScript support and all, but by far my favourite text stack is most likely with . It's the simplicity that gets me.

ntha,
@ntha@mastodon.social avatar

@maxalmonte14 Yeah! And HTMx is really powerful with its X-Trigger headers (https://htmx.org/headers/hx-trigger/) that can do events and so forth if you need a little more oomph, and then there's plenty extensions as well to make, for example, dependent things trigger (https://htmx.org/extensions/path-deps/).

I even made a block based WYSIWYG editor entirely with PHP + HTMx just to prove that you can do some very interactive things usually thought to be only possible in SPA's.

grmpyprogrammer,
@grmpyprogrammer@phpc.social avatar

@ntha @maxalmonte14 I made a super-old CakePHP app more dynamic with htmx. Old grumpy devs can learn new tricks

Crell,
@Crell@phpc.social avatar

I'm about to go live with Brent Roose of for his podcast, talking about the new Property Hooks RFC, the RFC process, improving PHP, and all that stuff.

Watch live here:

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

typo3, German
@typo3@typo3.social avatar

Heads up!
All our certifications are now based on v12.
Don't worry, if you have vouchers for v11, they're still valid.

If you've been planning to get certified, now's the time: https://typo3.com/services/certifications

ProvenPudding,
@ProvenPudding@fosstodon.org avatar

@typo3 Kudos for the positive and helpful info for people with v11 vouchers here. ❤️

f_lombardo, Italian
@f_lombardo@phpc.social avatar

I'd like to become more involved in Open Source. Any suggestions for an interesting Open Source project that needs some help?
(And sorry, no, I don't want to write docs :-)

f_lombardo,
@f_lombardo@phpc.social avatar

@heiglandreas Oh, I didn't think of that, but it could be a good idea, thanks

herndlm,
@herndlm@phpc.social avatar

@f_lombardo

@phpstan has many open issues, but the learning curve is steep, I have to admit. Sometimes there are very simple things to adapt, like function signatures, sometimes a "small" bug turns out to need a huge refactor.

composer might be interesting too. I think they always appreciate when new tests are added (not all commands are tested), but if that's too boring - there are also various edge case bugs and such.

Xitnelat, German
@Xitnelat@wue.social avatar

Hat jemand eine Idee, wie man das aktive PageTS zweier Seiten (bzw. Instanzen) sinnvoll vergleichen kann? 🤔

ntha,
@ntha@mastodon.social avatar

Now if only we could get the pipeline operator into , I could die happy. Meanwhile however @Crell 's fp library will fit the bill nicely: https://github.com/Crell/fp

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