Clean code php
Software engineering principles, from Robert C. Martin's book Clean Code, adapted for PHP. This is not a style guide. It's a guide to producing readable, reusable, and refactorable software in PHP.
Not every principle herein has to be strictly followed, and even fewer will be universally agreed upon. These are guidelines and nothing more, but they are ones codified over many years of collective experience by the authors of Clean Code.
Software engineering principles, from Robert C. Martin's book Clean Code, adapted for PHP. This is not a style guide. It's a guide to producing readable, reusable, and refactorable software in PHP.
Not every principle herein has to be strictly followed, and even fewer will be universally agreed upon. These are guidelines and nothing more, but they are ones codified over many years of collective experience by the authors of Clean Code.
The Problem with Time & Timezones - Computerphile
A web app that works out how many seconds ago something happened. How hard can coding that be? Tom Scott explains how time twists and turns like a twisty-turny thing. It's not to be trifled with!
A web app that works out how many seconds ago something happened. How hard can coding that be? Tom Scott explains how time twists and turns like a twisty-turny thing. It's not to be trifled with!
Event Sourcing: What it is and why it's awesome
At the last PHPDublin meetup I was asked "What do you do?" and as usual the answer boiled down to "I design and build event sourced applications". Which leads to the following question. "What is Event Sourcing?".
That's where this article came from, it is my best shot at explaining Event Sourcing and all the benefits it brings.
At the last PHPDublin meetup I was asked "What do you do?" and as usual the answer boiled down to "I design and build event sourced applications". Which leads to the following question. "What is Event Sourcing?".
That's where this article came from, it is my best shot at explaining Event Sourcing and all the benefits it brings.
Rapid Enterprise App Development with Zend Expressive
If youβve ever done a Zend Framework quick start, youβve probably never worked in Zend Framework. The quick start has historically been anything but quick, and itβs easy to lose interest and move on to the next thing.
If youβve ever done a Zend Framework quick start, youβve probably never worked in Zend Framework. The quick start has historically been anything but quick, and itβs easy to lose interest and move on to the next thing.
Generating an Autoloader for a Legacy PHP Codebase
If youβve inherited a legacy code base, you may find it does not use an autoloader and has an idiosyncratic directory and file hierarchy for its Classes, Interfaces or Traits. Worse yet, it might not use name spaces consistently or at all. So you canβt use a PSR-4βor even PSR-0βautoloader with your code.
If youβve inherited a legacy code base, you may find it does not use an autoloader and has an idiosyncratic directory and file hierarchy for its Classes, Interfaces or Traits. Worse yet, it might not use name spaces consistently or at all. So you canβt use a PSR-4βor even PSR-0βautoloader with your code.
HTTPlug, Guzzle & API's
Guzzle has become the de-facto HTTP-client library for PHP. But recently a number of open source projects have been switching to HTTPlug which boasts itself as an HTTP-client abstraction. We chat about the problems HTTPlug aims to solve, the plans for its future and the reasons behind why some library maintainers have chosen to adopt it or not.
Guzzle has become the de-facto HTTP-client library for PHP. But recently a number of open source projects have been switching to HTTPlug which boasts itself as an HTTP-client abstraction. We chat about the problems HTTPlug aims to solve, the plans for its future and the reasons behind why some library maintainers have chosen to adopt it or not.
Closures, Anonymous Classes and an alternative approach to Test Mocking
I have heard people say that you shouldnβt test abstract classes or traits, only the concrete classes that implement or use them. I donβt follow that approach: unit testing is all about testing in isolation from anything that might affect those tests.
I have heard people say that you shouldnβt test abstract classes or traits, only the concrete classes that implement or use them. I donβt follow that approach: unit testing is all about testing in isolation from anything that might affect those tests.
Testing With PhpSpec
PhpSpec is a testing tool based on the concept of emergent design using specification. You may have heard of Behavior Driven Development (BDD), and PhpSpec is a tool to use at the spec level or SpecBDD. We also mentioned PhpSpec in our recent roundup of Laravel Testing Resources, which includes ways you can incorporate PhpSpec into your Laravel workflow if you are interested in trying out SpecBDD.
PhpSpec is a testing tool based on the concept of emergent design using specification. You may have heard of Behavior Driven Development (BDD), and PhpSpec is a tool to use at the spec level or SpecBDD. We also mentioned PhpSpec in our recent roundup of Laravel Testing Resources, which includes ways you can incorporate PhpSpec into your Laravel workflow if you are interested in trying out SpecBDD.
Symfony Console Beyond the Basics β Helpers and Other Tools
Itβs undeniable how useful console commands can be when developing software. Not too long ago we re-introduced the Symfony Console component.
Itβs undeniable how useful console commands can be when developing software. Not too long ago we re-introduced the Symfony Console component.
Goodbye controllers, hello request handlers
A lot has changed in the PHP landscape over the past years. We started using more design patterns and things like the DRY and SOLID principles. But why are we still using controllers?
A lot has changed in the PHP landscape over the past years. We started using more design patterns and things like the DRY and SOLID principles. But why are we still using controllers?
Using JSON Web Token (JWT) as a PHP Session
Developers frequently use PHP Sessions to persist user data between different requests from the same site. PHP Sessions can be used to detect if the user is logged in or to get/set some id to identify current users. It's definitely a useful technique for web development.
Developers frequently use PHP Sessions to persist user data between different requests from the same site. PHP Sessions can be used to detect if the user is logged in or to get/set some id to identify current users. It's definitely a useful technique for web development.
UML Diagrams in PhpStorm 2017.2
Unified Modelling Language can be used to draw out the relationships between classes, abstract classes, and interfaces, to help you to visualize exactly how your classes interact and are related. PhpStorm has tools that can help you to create these diagrams, and manipulate your code from within the chart.
Unified Modelling Language can be used to draw out the relationships between classes, abstract classes, and interfaces, to help you to visualize exactly how your classes interact and are related. PhpStorm has tools that can help you to create these diagrams, and manipulate your code from within the chart.
10 Common Software Architectural Patterns in a nutshell
Ever wondered how large enterprise scale systems are designed? Before major software development starts, we have to choose a suitable architecture that will provide us with the desired functionality and quality attributes. Hence, we should understand different architectures, before applying them to our design.
Ever wondered how large enterprise scale systems are designed? Before major software development starts, we have to choose a suitable architecture that will provide us with the desired functionality and quality attributes. Hence, we should understand different architectures, before applying them to our design.
Hiding API fields dynamicallyβββLaravel 5.5
I recently saw a question on Laravel Brasil community that turned out to be a lot more interesting than it looks. Imagine you have a UsersResource with the following implementation:
I recently saw a question on Laravel Brasil community that turned out to be a lot more interesting than it looks. Imagine you have a UsersResource with the following implementation:
Advanced Multi-Model Forms in Yii2
Consider a Product model that has a single Parcel model related, which represents a parcel that belongs to the product. In the form you want to enter information for the product and the parcel at the same time, and each one should validate according to the model rules.
Consider a Product model that has a single Parcel model related, which represents a parcel that belongs to the product. In the form you want to enter information for the product and the parcel at the same time, and each one should validate according to the model rules.
Protecting passwords with Argon2 in PHP 7.2
PHP 7.2 will be released later this year (2017). This version contains some interesting additions, including two new security features: support of the Argon2 password hash algorithm, and the ext/sodium extension wrapping the libsodium library.
PHP 7.2 will be released later this year (2017). This version contains some interesting additions, including two new security features: support of the Argon2 password hash algorithm, and the ext/sodium extension wrapping the libsodium library.