Replies

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

Crell, to php
@Crell@phpc.social avatar

Uh oh. Andy Snell found a loophole in Enums. @ilutov should we care? :-)

stof,
@stof@phpc.social avatar

@Crell @ilutov Nothing forbids a method to call a static method of another class that would hold that static counter anyway. So I don't see a way to close such loophole entirely anyway.

ocramius, to random
@ocramius@mastodon.social avatar

I expect software projects to have a test/ dir that is BIGGER than the source code.

If it's not: something is likely wrong...

stof,
@stof@phpc.social avatar

@derickr @ocramius I would count them only if the testsuite actually uses them, not if they are added there only to increase the size of the folder 😁

sebastian, (edited ) to random
@sebastian@phpc.social avatar

This Friday, February 16, 2024, from 10:00 to 12:00 (Europe/Berlin), I will explain the motivation behind the most important changes in 11 and demonstrate them with live coding. We will cover new features as well as migrating from PHPUnit 10 to PHPUnit 11.

This online event is part of thePHP.cc's education flatrate, but is free and open to all.

Would you like to attend? Just send me an e-mail with the subject "PHPUnit 11 Live Demonstration" to sebastian@thephp.cc.

See you on Friday?

stof,
@stof@phpc.social avatar

@sebastian will this be recorded to be able to view it later if we are not available at that time ?

stof,
@stof@phpc.social avatar

@sebastian too bad. If the announced times are in the CET timezone, I'll be in a meeting so unable to follow it live. Will there be a blog post describing those motivation in the future ?

wouterj, to Symfony
@wouterj@phpc.social avatar

Played a bit with statistics this week: The average age of PHP code lines in

75% of the lines are edited within the past 4 years. That's pretty amazing for a codebase that is 15 years old!

Also interesting to see some components that were more or less feature complete from the start (Mime, RateLimiter, etc.) and needed very few changes after their release.

stof,
@stof@phpc.social avatar

@wouterj regarding the ratio of lines edited recently, I suspect that it is also related to the effort of modernizing types (and coding standards) that has been done in the last 2 years. I would be curious to see that percentage when taking the 5.0.0 codebase as input of the analysis instead.

chris, to php
@chris@rtsn.dev avatar

Do I know anyone in the world who can give insight into why Symfony moved away from bundles?

stof,
@stof@phpc.social avatar

@chris We moved away from bundles for projects because it simplified things as those bundles were often not reusable anyway (nor decoupled when having multiple ones). But bundles still exist in Symfony and are the way to share things (project-level code can customize the kernel directly, but that's not composable without bundles)

Skoop, to random
@Skoop@phpc.social avatar

Seeing all the accepted speakers for @phptek... wow, that promises to be a great conference!

No email here yet, so I'm suspecting a rejection will follow soon-ish

stof,
@stof@phpc.social avatar

@Skoop @phptek A post done yesterday said they made a first round of accepted talks. Maybe they are not done with the selection yet.

bagder, to random
@bagder@mastodon.social avatar

PHP sources with CURLOPT_SSL_VERIFYPEER set to false (disables certificate verification, most typically wrongly): 102K hits on GitHub right now... 😱

stof,
@stof@phpc.social avatar

@bagder I think this came a lot at a time where PHP on Windows was not able to use the CA store automatically, forcing either to disable verification or to provide the trusted CA certificates in the app. And then, this was kept around even after PHP 5.6 fixed this.

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

I'm noodling with a data storage layer library in . specific. There's 2 options:

  1. Auto-generate SQL tables/views/queries off of PHP data types (with attributes)
  2. Auto-generate PHP classes off of SQL tables/views/queries.

Which would you prefer? The goal is fully typed interaction in PHP space, but I'm not sure which side should be canonical.

Which would you rather work with, and why? Assuming a "good" DX in either case.

Answer why in replies, boost for reach, etc.

stof,
@stof@phpc.social avatar

@Crell My issue with this SQL file defining the DB structure is that this is now what you would run in your DB as you cannot recreate it from scratch: you need to migrate it from a previous version. So I'd rather make PHP canonical and generate the SQL side (but generating incremental migrations for SQL, not a file starting from scratch) @kboyd

stof,
@stof@phpc.social avatar

@Crell Your previous comment seemed to say that you wanted one .sql file that gets imported to the DB. But this cannot be imported to the prod DB as it cannot both describe your whole setup and apply only a diff (unless it does crazy introspection inline but this is not something I want to write then) @kboyd

stof,
@stof@phpc.social avatar

@Crell @kboyd To create the prod DB (and then actually also using it for other envs including local so that it tests it), I'd rather have something like doctrine/migrations which defines incremental steps to be applied one after the other (and some places remembering which steps have already been applied)

stof,
@stof@phpc.social avatar

@Crell @kboyd But then, if those migrations are the canonical source for the structure of the DB and generated PHP code, it becomes hard to see at a glance how the current structure looks like

dseguy, to php French
@dseguy@phpc.social avatar

yield keyword allows anything as key, and that is transmitted to the calling foreach() command. So, you can have arrays or closures as keys, or worse.

Just a weird use case for tonight.

https://3v4l.org/o8jBb

stof,
@stof@phpc.social avatar

@dseguy Iterators have had this possibility since the beginning. It is not a special feature of generators.

ramsey, to random
@ramsey@phpc.social avatar

What’s going on with the version numbers on this package? https://packagist.org/packages/mobiledetect/mobiledetectlib

stof,
@stof@phpc.social avatar

@ramsey See https://github.com/serbanghita/Mobile-Detect#before-you-install Naming the version 3.74 because it bumps the min PHP version to 7.4 was a weird choice

b0rk, to random
@b0rk@jvns.ca avatar
stof,
@stof@phpc.social avatar

@b0rk to squash commits, I generally prefer doing git rebase main --keep-base instead of counting how many commits I need to go back with ^. It is a lot easier.

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