Posts

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

Schrank, to random German
@Schrank@phpc.social avatar

@packagist Awesome! composer req phpunit now adds phpunit to require-dev as default, without asking - I LIKE!

heiglandreas,
@heiglandreas@phpc.social avatar

@Schrank @packagist Adding DEV-dependencies via composer is probably the most misused use of a dependency manager...

I mean... those development tools are not really dependencies of your project...

But 🤷

heiglandreas,
@heiglandreas@phpc.social avatar

@pierstoval

Tests are a necessary part of the Deployment-chain. As hopefuly are all the other tools that run checks.

But tests are not a necessary part of the production code. Hopefully....

/cc @Hariboas @shochdoerfer @gmazzap @naderman @Schrank

Schrank, to php German
@Schrank@phpc.social avatar

Hey #php people! Is there a way to implement an abstract constant? I have an abstract class which implements some stuff for my value objects and a constant IDENTIFIER I would like to enforce to be overwritten by the child classes.

It looks like there was a way in the past by using circular references: https://itecnote.com/tecnote/php-abstract-constants-in-php-force-a-child-class-to-define-a-constant/ but this doesn't work anymore.

Girgias,
@Girgias@phpc.social avatar

@Schrank Have the constant in the abstract parent class be defined as follows:

const CONST_NAME = self::CONST_NAME;  

And if the child class tries to use it without redefining it, you get an Error at runtime.

https://3v4l.org/TURXT

pierstoval,
@pierstoval@mastodon.social avatar

@Schrank @shochdoerfer @heiglandreas static abstract method is definitely the way to go 👍 with enum, even better ! 🎉

Schrank, to random
@Schrank@phpc.social avatar

Can I tell which type a call has?

$country->getIso() is string|null, but I'm sure it is string - or at least I'm fine ignoring the unexpected case 🙈
Or do I neet to put it in a var to add a /**@var to it?

muhdiekuh,
@muhdiekuh@ruhr.social avatar

@Schrank I think the best would be to use an assert library (such as beberlei/assert or webmozart/assert) and the corresponding phpstan-plugin.

That way you write:

$iso = $country->getIso();  
Assert::notNull($iso);  

and after this code, phpstan should consider $iso not-null.
The upside of this is: if $iso turns out to be null, the assertion will throw an exception and end your code. AKA: This way you don't lie to yourself :)

mitelg,
@mitelg@phpc.social avatar

@Schrank in Shopware we also use \assert() in some cases. better than var annotations

Schrank, to random German
@Schrank@phpc.social avatar

Do you know any comic artists on mastodon? English/german! After seeing @ralphruthe I feel I don’t follow enough artists with fun and serious comic (strips) and/or single panel.

(Trying to find words in English for multi image cokics snd dingle image comics…)

jonashrem,

@Schrank @ralphruthe

@Laburrini

jonashrem,
Schrank, to boulder German
@Schrank@phpc.social avatar

First time I was alone in a hall. Very different, more breaks as with two … maybe the same as with four people.
Hands hurt, but soul is happy.
And lovely people who gave me tips, third time I got the top 🥰
But not like this: 😂😂

GIF by Boulder Hall

Schrank,
@Schrank@phpc.social avatar

@kortwotze Bitte! Ich zeige dir gerne den Südbloc oder schaue mir andere Hallen in Berlin mit dir an 🙃

kortwotze,

@Schrank Gerne! Da ich gestern eh beschlossen habe, mal öfters eine Kamera mit auf meine Ausflüge (Bouldern, Kayak) mitzunehmen, dann gibts schonmal einen Sneak-Peak vom Oldenbloc 😉

Schrank, to random German
@Schrank@phpc.social avatar

Wow, waking up at 6:25 german time looks like @lisamelton is still awake, NOW I understand what all the people talk about boost spamming 😂😂

lisamelton,
@lisamelton@mastodon.social avatar

@Schrank LOL! Lucky for you I won't be awake for much longer. 😂 And thanks for following! 💖

pixelpusher220,

@Schrank @lisamelton

It's been coined as , and you kind sir, have been !

Schrank, to random German
@Schrank@phpc.social avatar

People answering support emails. Do you like it, if a customer replies to the last email with a "thank you" or are you annoyed, the damn ticket got open again? 😅

jrf_nl,
@jrf_nl@phpc.social avatar

@Schrank I believe people don't say "thank you" enough, nor compliment other enough, so I won't be stopping anytime soon. Everyone needs to feel seen.

jonashrem,

@Schrank yes, that's actually helpfully. So I know the issue has been solved and topic is closed. When I get no reply I get no feedback is my answer had actually solved the issue or was helpful at all.

Seven of the state was clear before, I personally would never be annoyed by a "thank you" mail.

Schrank, to random German
@Schrank@phpc.social avatar

How to reproduce "Unsupported operand types: string * int" ... because this doesn't work 🤔

((string)$rate) * ((int)$price)

theiNaD,

@Schrank @mohs hmmm https://3v4l.org/eHnV0 it must be a string which is not starting with a number as it seems. Even in non strict mode.

Schrank,
@Schrank@phpc.social avatar

@theiNaD @mohs Yep. :D

Schrank, to random German
@Schrank@phpc.social avatar

Anyone has experience with Elastic/Opensearch? Is there an "easy thing" I can do, so I can search for SKUs in our index which contain a dot (.)? Like "123.456"

Schrank,
@Schrank@phpc.social avatar

@alex unfortunately it was not elastic. has a tokenizer, splitting at . , then removing everything smaller then $minLength(=2)
Which makes a sku like 12.345 => 345 and that is pretty broken in our case 🤪

Schrank,
@Schrank@phpc.social avatar

@alex talking about the search term! Then the splitted parts are added as match queries. Not totally stupid, just for us 😂

Schrank, to php German
@Schrank@phpc.social avatar

You are used to and want to in ?
Do this:

puts object.inspect
raise "Stop the program here"

https://winkelwagen.de/2024/04/23/ruby-as-a-php-developer/

kleinmann,

@Schrank You can also use https://github.com/pry/pry and start an interactive debugging/REPL session with binding.pry, if you prefer that 🙂

ahx,

@Schrank I mostly use binding.irb to debug. You don’t even need pry for that these days.

Schrank, to php
@Schrank@phpc.social avatar

Preparing a talk „from url in browser to first byte“ in context of #php.
What little, not obvious things, do you think are a good addition?

Like: a correct time is important for proper encryption

heiglandreas,
@heiglandreas@phpc.social avatar

@Schrank And if it's only to say "These also exist but we do not care about them unless you have another 5 hours to spare!"

Schrank,
@Schrank@phpc.social avatar

@heiglandreas @derickr yea, it is hard to find a line. But depending on audience and time slot, it case be totally different. I even have BGP on the list, but don’t know what to do with it yet 😂

Schrank, to random German
@Schrank@phpc.social avatar

Ich habe bisher keine guten Argumente/Statistiken zu "Fahrprüfung ab 70" gelesen. Das Statis sagt, sie nehmen häufiger die Vorfahrt, fahren dabei aber langsamer - verletzen sie mehr Radfahrer? Das steht da leider nicht.
Sie werden häufiger selbst schwerer verletzt oder getötet - ja mei, das ist eigenes Risiko und sollte man den Menschen überlassen.
Sie fahren langsamer, mit mehr Abstand.
Gemessen an der Bevölkerung bauen sie weniger Unfälle - ist das die richtige Größe zum Vergleichen?

Uff.

jonashrem,

@Schrank @unixwitch ja, ich hätte jetzt auch kein Problem alle paar Jahre eine kurze Überprüfung mit zu machen. Ansonsten wäre es natürlich auch für, wenn man den ÖPNV soweit ausbaut dass niemand dieser Leute auf das Auto angewiesen ist.

Flyingmana,
@Flyingmana@phpc.social avatar

@Schrank du weißt halt nicht wie hoch die reale Unfallrate ist, weil du nicht weißt wie viele in dem Alter überhaupt noch fahren. Viele verzichten ja tatsächlich von alleine aufs fahren, weil sie sich nicht mehr tauglich fühlen, geben aber deswegen nicht den Führerschein ab, weil könnte man ja doch mal brauchen.

Und die anderen fahren weiter, weil sie es nicht wahr haben wollen, dass sie nicht mehr fit genug sind.

Und die eigentliche Frage, wie viele Unfälle waren die folge von untauglichkeit?

Schrank, to random
@Schrank@phpc.social avatar

@heiglandreas Hey! Are you into https://www.php.net/manual/de/function.hrtime.php? I thought maybe you have an idea - but please be careful, the rabbit hole is deep.
We tried to understand https://github.com/sebastianbergmann/phpunit/issues/5652 but didn't come up with a way to reproduce or understand. Our current working hypothesis is, that hardware is switching CPUs or something like that and therefore the hrtime call isn't monotonic and might end up in negative durations :D

Schrank,
@Schrank@phpc.social avatar

@heiglandreas I think you'll like it - and need vacation time if you start 🙈

heiglandreas,
@heiglandreas@phpc.social avatar

@Schrank 🤪

Schrank, to random
@Schrank@phpc.social avatar

If you wonder why your F*CKING EVENT LISTENER IN THIS UNHOLY LANGUAGE (javascript) DOESN’T WORK: Don’t listen on submit on a button, but the form…

bobmagicii,
@bobmagicii@phpc.social avatar

@Schrank yeah but you opened with all caps and a swear and degradation of something that was clearly your fault so a tiny hashtag at the end wasn't very convincing.

Schrank,
@Schrank@phpc.social avatar

@bobmagicii ah, no, the hashtag was the essence of the feeling, although I have hard times with JS, mostly because I don’t do it to often 😋

Schrank, to random German
@Schrank@phpc.social avatar

Band gesucht. Ich habe vor 15 Jahren elektronische Musik gehört. Das Outro von @lnp erinnert mich daran. Kann mir jemand sagen, wonach ich suchen muss um da was zu finden?

jensscholz,
@jensscholz@mastodon.social avatar

@Schrank @lnp
Eventuell das bzw etwas aus dem Album? Das ist sehr ähnlich instrumentiert.
https://www.youtube.com/watch?v=PsdlLzXwwBc&list=PLVm1eyys_ngY7fgdDOKQBJsj4DyT-woje

Schrank,
@Schrank@phpc.social avatar

@jensscholz @lnp Guten morgen, leider viel zu hektisch für das was ich suche, aber genau das richtige am morgen 😍🥰

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