~/

PHP7.2 Object Return Type Declarations

As of PHP 7.2 we can finally return type declarations for the object data type. (I know that reads funny, but it’s a true statement!) Here is an example: class MyClass { public $var = 'Hello World'; } $myclass = new MyClass; function getTestType(MyClass $arg) : object { return $arg; } echo getTestType($myclass)->var; Previous PHP versions would shit their pants over this with a fatal error: Fatal error: Uncaught TypeError: Return value of test() must be an instance of object, instance of MyClass returned in app/index.
Read more →

Bootstrapping Wordpress: Part 1

Web Development eventually involves dealing with a wordpress site (or multiple), and if you’re like me - you have a bunch of private git repos that all lack wp-config.php files. see wpengine&rsquo;s recommended <code>.gitignore</code> file And if you’re also like me, you probably have a custom git command for hard resets and cleans (I call mine <code>git bleach</code> ) - which means you do a lot of rebuilding, and probably waste a lot of time creating your configs over and over again.
Read more →