Posts

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

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

For those #php people that are using continuous integration for unit testing, static analysis and the likes, would you consider using a service that you feed test results for nice reports and analysis? (also includes composer.lock analysis and stuff)

ollieread, to random
@ollieread@phpc.social avatar

I ended up going with the standard ::instance() approach 😂

It'll get complicated soon when I allow for containers to be scoped, but, we'll see.

https://gist.github.com/ollieread/58203d66276d863d1df5f40b8a27cae0

ollieread, to random
@ollieread@phpc.social avatar

Hmm, the Mastodon web app doesn't have support for easy account switching 😅

ollieread, to random
@ollieread@phpc.social avatar

I know the convention is for singletons to have an "instance" method, but I quite like the idea of a "get" method.

Though I suppose as a convention it can be an issue, as a class is more likely to have a get method as standard.

bobmagicii,
@bobmagicii@phpc.social avatar

@ollieread think i tend to build everything as a multiton even if its intended to be a singleton.

mostly because if think i wanted a singleton the reality is i wanted a single managed instance for the common use case, not so much a device that can literally only burn itself once. which leads me to mostly writing something like this:

https://gist.github.com/bobmagicii/f3888f0032a2b2932b4571b23aac3204

where Init() comes from my distaste of "instance" as a verb.

ollieread,
@ollieread@phpc.social avatar

@bobmagicii Fair. That's some...interesting formatting there 😂

ollieread, to php
@ollieread@phpc.social avatar

So, I’m building a dependency-injection package, and it’s a lot of fun. I’ve gone a route that I don’t really see many, if any, following. I suspect it may be that a lot of the solutions out there are old, and while they have been updated, they’re still going to inherit certain approaches.

ollieread,
@ollieread@phpc.social avatar

@ramsey I happen to already have an example screenshot for this!

ollieread,
@ollieread@phpc.social avatar

@ramsey There are also a number of others, like the Shared, Provider, Scope, and Factory attributes.

ollieread, to php
@ollieread@phpc.social avatar

I need to remember that Mastodon exists! I’m currently writing a bunch of content to do with PHP and this would be the perfect place to talk about that.

I’m currently trying to decide whether #php #reflection is an interesting enough topic that people may like an in-depth course/series on it. It seems to be something a lot of people are vaguely aware of, but don’t really know the details.

ollieread,
@ollieread@phpc.social avatar

I’ve also been trying to put together some content that’s more beginner friendly, by researching frequently searched queries on Google.

These are the ones I have so far.

ollieread,
@ollieread@phpc.social avatar

In fact, this is my first draft of the article on covariance and contravariance as concepts but also related to .

I've tried to go for simple, without too many details, but I think this contains the fewest number of details I'm capable of writing 😂

https://gist.github.com/ollieread/273cf344503533ee4c497ab4c62929bf

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