@stof@phpc.social avatar

stof

@stof@phpc.social

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.

ocramius, to random
@ocramius@mastodon.social avatar

@wyri is your OpenAPI client generator already in usable state?

Seen no releases under https://github.com/php-api-clients/openapi-client-generator, and I just received a "what the fresh hell is this" OpenAPI schema to process xD

stof,
@stof@phpc.social avatar

@ocramius Have you checked jane-php for that ? https://jane.readthedocs.io/en/latest/ @wyri

Crell, to random
@Crell@phpc.social avatar

If browsers adopted native Markdown support in some fashion, that would do more to standardize the many Markdowns than anything else in the world.

It would also render about 50 OSS projects redundant.

stof,
@stof@phpc.social avatar

@Crell not a web component for now though (there is an old open PR on it to port it)

Crell, to random
@Crell@phpc.social avatar

I understand just fine and like it the best of any VCS I've used. Am I weird?

If people are having trouble learning it, it sounds like the problem is the training materials. What training materials did you use that were inadequate?

stof,
@stof@phpc.social avatar

@Crell Either you're not weird or I'm weird as well...

Crell, to php
@Crell@phpc.social avatar

9 says to stop using assertObjectHasAttribute() in favor of assertObjectHasProperty(). But the latter doesn't exist in PHPUnit 9, only in PHPUnit 10.

Am I missing something obvious? Because that's not how deprecation warnings are supposed to work...

stof,
@stof@phpc.social avatar

@sebastian havign a deprecation warning telling to use a method that does not exist is a bad experience though. /cc @Crell @jrf_nl

tomw, to php
@tomw@mastodon.social avatar

Is Composer just completely stuffed in PHP8 or am I doing something wrong?

(Composer's website seems to list 7.2 as the most recent supported version.)

stof,
@stof@phpc.social avatar

@tomw composer lists 7.2 as the minimum supported version of Composer 2.3+, not as the maximum version.

ramsey, to php
@ramsey@phpc.social avatar

If you voted against the Interface Default Methods RFC for , please take a moment to read some of the most recent mailing list replies, starting with @Crell’s here: https://externals.io/message/120725#120798

I agree this feature goes against a lot of what I’ve learned as “best practices,” but I did a lot of introspection on this and decided that this feature is good for the future of the PHP language. It unlocks a lot of potential.

stof,
@stof@phpc.social avatar

@Skoop Interfaces are already able to define abstract methods (that's all they can define for now) /cc @ramsey

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