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.
I was looking at this Sass (SCSS) compiler, written in #PHP, 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.
@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.
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...
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 #php#oop#programming
TIA
@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.)
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?
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. 🚀
Is there anything like symfony/asset-mapper (and symfony/asset) that folks can recommend using with a non-Symfony #PHP 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 #Symfony 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? 😁
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.
@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.
Looking for new contract opportunities to accelerate #php development teams and modernize PHP applications.Have a need? Get in touch today: http://sarah-savage.com/contact/#fedihire
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.
@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).
@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.