Developers like to use booleans as flags. They're a convenient way to indicate something as on/off, true/false, yes/no. But the problem is that booleans are not clear from calling code exactly what they do. For example: Does anyone in the calling scope have any idea what the defining scope is doing? Absolutely not. The flag
discovered livetechhelper.com, while the initiative could be positive explained, the execution is horrible! I found https://livetechhelper.com/repos/jaapio/phpunit
I can help with #phpunit but obviously any income should go to the original maintainers not to me because I created a fork!
Same applies to other projects, should we stop this?! #php#foss?
I found myself needing to write tests for code that throw an exception with domain-specific information. I actually need access to the exception thrown in my test. So, I created a testing utility that will do just that.
@ramsey Yea, that's what I was typically doing too. Then I did some Java work and liked the way JUnit 5 handles this type of thing so I decided to implement a similar pattern in PHP.
@cspray neat. yeah this construct here is one i copy paste a lot, as sometimes there is inspection of some exception properties after the instance of check.
if your system could be packaged up into a good rfc might be something that could be pitched to sebastian for core inclusion.
im always personally leery of adding things to the testing suite, its hard for me to build the trust in addons for something i need to ultra trust.
@sarah Perhaps, but in practice the global function calling the app container has never caused any problems for me. And you definitely could inject the config repository where needed, it's just not conventional Laravel. I prefer sticking with conventions.
Revolutionizing user experience at OTH Regensburg! 🚀 in2code transformed the OTH Regensburg website into a dynamic recruitment portal, boosting engagement and efficiency. Awarded the #TYPO3 Award in 2023 for higher education, this recognition underscores in2code's specialization, elevating the project as a standout in the category.
#PHP foreach() works on arrays and objects. On objects, it skips uninitialized properties, which may be very convenient with readonly properties : otherwise, it is a fatal error!
I know that ship has already sailed but it would have been nice if the spread operator on iterable did follow the semantic of iterator_to_array with the preserve keys argument being true #php#controversialthoughtoftheweek
@nyamsprod It has the same behavior as array_merge, which makes it very consistent 1-to-1 behavior.
I've seen the default iterator to array key behavior bite people more often, especially when doing iterator to array on multiple yield/from generators.
@zimzat I get the reasoning behind but would have been "cool" nice to have the iterator_to_array behaviour when working with iterator it seems more appropriate
Macros are one thing I enjoy using the most in #Laravel. It's a way to extend the functionality of many built-in #Facades by providing custom callbacks for a specific key.
One production example I use macros for fairly often is what I call the "admin alert". Especially in smaller applications I want to get notified whenever an error or an event occurs the admin (mostly that's me) should know about.
"Nul n'est censé ignorer la loi", commençons donc par une piqûre de rappel : Il est illégal d'utiliser les données personnelles de vos utilisateurs ailleurs que sur la prod. Plus précisément, le RGPD1 indique que : Les données à caractère personnel doivent être : traitées