dave.engineer
Back to home

Archive

Posts tagged “php”

11 entries tagged “php”.

Browse by tag

View all tags →
Blog Post

HTTP messaging PSR-7 update

This is a quick update to my original blog post criticizing mutability in PSR-7. The original blog post got a fair few tweets and traction on Reddit. More importantly, Matthew Weier O'Phinney, the lead author of PSR-7, r…

Read more
Blog Post

Thoughts on PSR-7

PSR-7 contains interfaces for HTTP messages. These are like Symfony Kernel's Request and Response interfaces. Having these new interfaces would be great for the PHP community but there's a couple of issues with their cur…

Read more
Blog Post

Traits with interfaces

In PHP, Traits can't implement interfaces. They can, however, include abstract methods. These methods then need to be implemented by the concrete class that implements the trait. This allows a trait to provide some boile…

Read more
Blog Post

Should I use global variables?

Someone posted a question about using global variables on r/php, which I answered. Copied here for posterity. Using global state is technical debt. This means you're trading off short term wins (mostly writing less boile…

Read more
Blog Post

Notes on designing through mocking

My notes on Everzet's talk "Design how your objects talk through mocking" at PHPNW14 Everzet's Original slide deck Code sample here are using Prophecy to create test doubles Different test doubles: Mocks, stubs…

Read more
Blog Post

Generators in PHP 5.5 (with PDO)

As the first alpha of PHP 5.5 has been released, now is a great time to play with its new features. The first new feature is generators. Generators are like very simple iterators. PDO’s PDOStatement class implements Trav…

Read more
Blog Post

PHP coding standards and style guides

The PHP Framework Interoperability Group (PHP-FIG) are a group representing most of the big names in the PHP world such as Zend and Symfony. The group has formed to encourage PHP frameworks to be more interoperable. They…

Read more
Blog Post

Better Dependency Injection in Laravel

We all love using Dependency Injection but often Laravel’s facades and IoC container are used more like a static service locator, which (despite being testable) can easily lead to violations of the Dependency Inversion P…

Read more