We have a nice assertion library in core now.

Hi all. I want to let everyone know about a composer package we recently brought into core.

We brought this in because we wanted to be able to do type-hint like safety checks in old code. You usually want to call assertions as the first thing in a method. That way below them you know your data is correct and can proceed with cleaner code.

A little gotcha. There is a method called Assert::integer() which is not usually what you want to call. Instead call Assert::integerish() as an alternative that will work with string representations of integers. This is safer for old code and also data that comes from the database.