PHP

mobileatom,
@mobileatom@flipboard.com avatar
hashbangcode,
@hashbangcode@fosstodon.org avatar

New! Drawing A Parabolic Curve With Straight Lines In PHP

https://www.hashbangcode.com/article/drawing-parabolic-curve-straight-lines-php

A parabolic curve is a type of curve where every point is an equal distance from a focal point. There a number of different way to generate this sort of curve using maths, but one of the simplest is to use straight lines to create the illusion of the curve.

#php #phpGD2 #hashbangcode

ramsey,
@ramsey@phpc.social avatar

I was looking at this Sass (SCSS) compiler, written in , and I noticed something very odd.

Under “requires (dev)," it requires two packages, sass/sass-spec and thoughtbot/bourbon, both of which appear to be empty packages, containing only a composer.json file, which has no dependencies.

What’s the purpose of these packages? They otherwise appear suspicious, to me, but I can’t see that they're doing anything nefarious right now—they just appear pointless.

https://packagist.org/packages/scssphp/scssphp

asjmcguire,
@asjmcguire@mastodon.scot avatar

@ramsey well sass/sass-spec is supposed to a package that ensures that sass compiles properly. https://github.com/sass/sass-spec and the other one is sass related too https://github.com/thoughtbot/bourbon so neither should be empty.

naderman,
@naderman@phpc.social avatar

@ramsey @seldaek that's a bit of a shortcoming in packagist.org we should probably address. scssphp composer.json actually contains a custom package repository definition which defines thoughtbot/bourbon has something that doesn't exist on packagist.org and because it's only in require-dev which is only loaded from root composer.json, that means that custom definition will always be used, and never the package that's linked to on packagist.org.

cybersmog,
@cybersmog@phpc.social avatar
sarah,
@sarah@phpc.social avatar

Who are my LGBTQ+ #php folks? Have an idea, would like feedback. 🏳️‍⚧️ 🏳️‍🌈

jeffmarkel,
@jeffmarkel@mastochist.social avatar

@sarah do allies count?

sarah,
@sarah@phpc.social avatar

@jeffmarkel Eventually, yes. :)

Cool features of Swiss Knife (tomasvotruba.com)

When using a Swiss knife, we think of a tool with many practical abilities. They're useful for different situations we might experience in the wild. Opening a box of milk? Here is a knife. Cutting wood to start a fire? Here is a chainsaw. Are the letters on the paint bucket too tiny? Try this magnifying class. Now, we apply the...

mobileatom,
@mobileatom@flipboard.com avatar

Cool features of Swiss Knife CLI package manager. #PHP

https://tomasvotruba.com/blog/cool-features-of-swiss-knife?utm_source=flipboard&utm_medium=activitypub

Posted into SYMFONY FOR THE DEVIL @symfony

djumaka,
@djumaka@phpc.social avatar

Guys I need some helping hand. I need some good reading (book/article) on the proper way of writing OOP. I gave a project where we use classes, but they are more used as a package if functions then working like objects. Like a class of only statics, passing around IDs not the real objects of data (this sending SRP down the drain), arrays, generally functional programming with extra steps. I'd fancy even a discussion as I want to slowly explain all that to my teammates
TIA

thomastospace,
@thomastospace@phpc.social avatar

@djumaka One starting point might be @Crell 's talk about Never use Arrays.

That's the first step into making things OOP in my experience.

https://youtu.be/FlPLquNuy8E

Crell,
@Crell@phpc.social avatar

@djumaka I find thinking in types is what is more valuable. Don't think of an object as behavior, but a custom type. A primitive in your domain. Now attach a few contextually relevant utilities to it.

Really I think about OOP very functionally these days. :-)

(What you're describing is procedural, not functional.)

mobileatom,
@mobileatom@flipboard.com avatar

The Comprehensive Guide to Enterprise CMS with TYPO3.

https://typo3.com/blog/comprehensive-guide-to-enterprise-cms-with-typo3?utm_source=flipboard&utm_medium=activitypub

Posted into SYMFONY FOR THE DEVIL @symfony

edgren,

The more I'm thinking about it, the more I consider it.

I want to add a map for my bicycle rides, but I can't find any good PHP maps. The PHP versions of Leaflet on GitHub are no good. They don't work at all. They just gives you errors like "can't load class" or something like that.

So even if I am against it only to challenge myself, I consider using Leaflet in JS for airikr.me/biking.

Or do you have any solution in PHP that works out of the box?

edgren,

@derickr Haha, you mean it's too small/pixelated? 😄

derickr,
@derickr@phpc.social avatar

@edgren I meant the track missing a little at the top. But also that... A little pixelated too.

I might also decided to create my own mapstyle, especially if it's always just a tiny area of a country / city.

Remember I said there are always more things to tweak? 😅

typo3, German
@typo3@typo3.social avatar

Attention Marketers: Is your client’s CMS holding them back? Our comprehensive guide on enterprise CMS with TYPO3 outlines how you can elevate their digital strategy. 📘 Discuss scalability, security, and flexibility—all crucial for business growth. 🚀

Learn more: https://typo3.com/blog/comprehensive-guide-to-enterprise-cms-with-typo3

t3crr, German
@t3crr@nrw.social avatar

Gerade in der Planungsphase, in der wir zwischen Bockwürstchen oder Buffet entscheiden müssen, hilft uns jede Zusage sehr weiter. 🧡

In dieser Woche erreichte uns die Platinum Zusage von schaffrath.de. Herzlichen Dank an diesen verlässlichen Sponsor. 💪

ramsey,
@ramsey@phpc.social avatar

Is there anything like symfony/asset-mapper (and symfony/asset) that folks can recommend using with a non-Symfony app?

I can probably figure out how to use these by themselves, but I'd prefer a general, stand-alone library/tool, rather than attempting to shoehorn a package into a non-Symfony app.

That is, unless someone can point me to a tutorial that shows how someone else has already done this? 😁

ramsey,
@ramsey@phpc.social avatar

@wouterj That’s exactly why I want it. For the generating the import map, versioning the assets, and providing Twig functions to reference the assets.

ramsey,
@ramsey@phpc.social avatar

@wouterj Also, it seems to have some sort of Sass compilation built in, somewhere in the chain. Maybe that’s in a different Symfony component, though.

mobileatom,
@mobileatom@flipboard.com avatar
sirber,
@sirber@fosstodon.org avatar

I'm starting a 22h course on C#.
outside is dying...

Skoop,
@Skoop@phpc.social avatar

@sirber might be a geographic difference. We had a bit of a low point here in The Netherlands, but I'm seeing a lot of PHP work again now

Crell,
@Crell@phpc.social avatar

@maxalmonte14 @sirber @Skoop I miss PHP every day I have to deal with Spring Boot, JPA, Hibernate, and that whole cluster*.

rajab_natshah,
@rajab_natshah@mastodon.social avatar

The PHP project has decided to extend security support for versions from one to two years!!
https://github.com/php/policies/blob/main/release-process.rst
https://www.php.net/supported-versions.php
#PHP

mobileatom,
@mobileatom@flipboard.com avatar
mobileatom,
@mobileatom@flipboard.com avatar
sarah,
@sarah@phpc.social avatar

I strongly prefer composition over inheritance.

If you can compose objects of other objects and use interfaces over concretions, you make it much easier to modify your app in future.

Ultimately the time you take to design your app will be spent now (in design) or later (in maintenance). Since most apps spend most of their life in maintenance, don’t make the mistake of saving time now and spending it later.

#php #oop

afilina,
@afilina@phpc.social avatar

@sarah I don't think I used inheritance anywhere other than PHPUnit's TestCase in the last few years. I wish we could have a way to write tests without extending.

mobileatom,
@mobileatom@flipboard.com avatar
sarah,
@sarah@phpc.social avatar

Looking for new contract opportunities to accelerate development teams and modernize PHP applications.Have a need? Get in touch today: http://sarah-savage.com/contact/#fedihire

Reposts appreciated.

pwaring,
@pwaring@fosstodon.org avatar

Currently working on a rewrite of an old application (PHP 5.6, was probably written in an even earlier version) by building a new one in PHP 8.3 and migrating all the data across.

I don't usually recommend rewrites but occasionally it's more cost-effective than trying to fix really old code.

Even though I work with legacy code every day, the changes in 8.3 (and libraries that require it) make life so much nicer.

(I currently work with versions from 5.4 to 8.3)

pwaring,
@pwaring@fosstodon.org avatar

@Crell Attributes and constructor promotion are the two which have reduced boilerplate or made it clearer or have better integration with my IDE.

I have jumped from 7.4 to 8.3 (most projects I work on are either 7.x or 'latest stable') so haven't experienced every individual point release. I'm mainly interested in 7.4->8.3 than 7.4->8.0 (generally when I bump an existing project I'm fixing issues rather than refactoring).

Crell,
@Crell@phpc.social avatar

@pwaring Got it. Yeah, the trio of attributes, constructor promotion, and named arguments coming all together in 8.0 was earth-shattering. Totally changed the story on what is "easy" or "natural" to do.

PHP just keeps getting better and better.

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