REST Security Cheat Sheet
REST (or REpresentational State Transfer) is an architectural style first described in Roy Fielding's Ph.D. dissertation on Architectural Styles and the Design of Network-based Software Architectures.
It evolved as Fielding wrote the HTTP/1.1 and URI specs and has been proven to be well-suited for developing distributed hypermedia applications. While REST is more widely applicable, it is most commonly used within the context of communicating with services via HTTP.
REST (or REpresentational State Transfer) is an architectural style first described in Roy Fielding's Ph.D. dissertation on Architectural Styles and the Design of Network-based Software Architectures.
It evolved as Fielding wrote the HTTP/1.1 and URI specs and has been proven to be well-suited for developing distributed hypermedia applications. While REST is more widely applicable, it is most commonly used within the context of communicating with services via HTTP.
The value of the void typehint in PHP
When the void typehint was introduced in PHP 7.1. There was some debate about it. Some people wondered if it is beneficial to type nothing? I was one of them. Meanwhile, I changed my opinion on it. In this short post, I'd like to give you a small example where I think void shines.
When the void typehint was introduced in PHP 7.1. There was some debate about it. Some people wondered if it is beneficial to type nothing? I was one of them. Meanwhile, I changed my opinion on it. In this short post, I'd like to give you a small example where I think void shines.
How to write easily describable code
When code is not describable using words, most people have to do some mental mapping to turn it in to words. This wastes mental energy, and you run the risk of getting the mapping wrong. Different people will map to different words, which leads to confusion when discussing the code.
When code is not describable using words, most people have to do some mental mapping to turn it in to words. This wastes mental energy, and you run the risk of getting the mapping wrong. Different people will map to different words, which leads to confusion when discussing the code.
ββMy favourite Git commit
I like Git commit messages. Used well, I think theyβre one of the most powerful tools available to document a codebase over its lifetime. Iβd like to illustrate that by showing you my favourite ever Git commit.
I like Git commit messages. Used well, I think theyβre one of the most powerful tools available to document a codebase over its lifetime. Iβd like to illustrate that by showing you my favourite ever Git commit.
Dividing responsibilities - Part 1
We've looked at how objects can be used to retrieve information or perform tasks. The methods for retrieving information are called query methods, the ones that perform tasks are command methods. Service objects may combine both of these responsibilities. For instance, a repository (like the one in Listing 1) could perform the task of saving an entity to the database, and at the same time, it would also be capable of retrieving an entity from the database.
We've looked at how objects can be used to retrieve information or perform tasks. The methods for retrieving information are called query methods, the ones that perform tasks are command methods. Service objects may combine both of these responsibilities. For instance, a repository (like the one in Listing 1) could perform the task of saving an entity to the database, and at the same time, it would also be capable of retrieving an entity from the database.
Dividing responsibilities - Part 2
Instead of creating a StockReport model from PurchaseOrderForStock objects, we could go directly to the source of the data, that is, the database where the application stores its purchase orders. If this is a relational database, there might be a table called purchaseorders, with columns for purchaseorderid, productid, orderedquantity, and wasreceived. If that's the case, then StockReportRepository wouldn't have to load any other object before it could build a StockReport object; it could make a single SQL query and use it to create the StockReport, as shown in Listing 11).
Instead of creating a StockReport model from PurchaseOrderForStock objects, we could go directly to the source of the data, that is, the database where the application stores its purchase orders. If this is a relational database, there might be a table called purchaseorders, with columns for purchaseorderid, productid, orderedquantity, and wasreceived. If that's the case, then StockReportRepository wouldn't have to load any other object before it could build a StockReport object; it could make a single SQL query and use it to create the StockReport, as shown in Listing 11).
ββDocumenting Software Architecture
We learn how to code and we build some cool applications, and then we learn about architecture and how to make the application maintainable for several yearsβ¦
However when we need to explain to someone else (new developer, product owner, investor, β¦) how the application works, we need something moreβ¦ we need documentation.
We learn how to code and we build some cool applications, and then we learn about architecture and how to make the application maintainable for several yearsβ¦
However when we need to explain to someone else (new developer, product owner, investor, β¦) how the application works, we need something moreβ¦ we need documentation.
Yii2 Application Optimization
When projects are behind schedule, programmers may be tempted to implement solutions that are not the most optimal. This can result in clients having to deal with a variety of application issues, such as speed. In our applications, we often use Yii2 framework and through our experience we have learned how to make our applications faster by using optimal solutions
When projects are behind schedule, programmers may be tempted to implement solutions that are not the most optimal. This can result in clients having to deal with a variety of application issues, such as speed. In our applications, we often use Yii2 framework and through our experience we have learned how to make our applications faster by using optimal solutions
PHP 7.4 release is here
The PHP development team announces the immediate availability of PHP 7.4.0. This release marks the fourth feature update to the PHP 7 series.
PHP 7.4.0 comes with numerous improvements and new features such as:
The PHP development team announces the immediate availability of PHP 7.4.0. This release marks the fourth feature update to the PHP 7 series.
PHP 7.4.0 comes with numerous improvements and new features such as:
Four Key Considerations When Running PHP Applications On Multiple Servers
Building and deploying PHP applications on one server is a, relatively, straightforward process. However, what about deploying a PHP application across multiple servers? In this article, I'm going to discuss four key considerations to bear in mind when deploying PHP applications when doing so.
Building and deploying PHP applications on one server is a, relatively, straightforward process. However, what about deploying a PHP application across multiple servers? In this article, I'm going to discuss four key considerations to bear in mind when deploying PHP applications when doing so.
Null Hell and How to Get Out of It
When used without a second thought, nulls can make your life miserable and you possibly don't even realize that they're the ones that cause you so much pain. Let me explain.
When used without a second thought, nulls can make your life miserable and you possibly don't even realize that they're the ones that cause you so much pain. Let me explain.
ββHow to Make Your Code Reusable
Reusable code, as a one-stop solution to fix all software problems, is a dangerous myth. Let me explain why.
Letβs say you are writing a software library. You have a great idea bubbling in your head that can create a broadly reusable generic solution. You maniacally code APIs which cover all functionalities and cater to all scenarios. Every possible new scenario, you add it to your API. Your code grows disproportionately. But it is generic in the true sense and everybody starts using it. You are happy.
Reusable code, as a one-stop solution to fix all software problems, is a dangerous myth. Let me explain why.
Letβs say you are writing a software library. You have a great idea bubbling in your head that can create a broadly reusable generic solution. You maniacally code APIs which cover all functionalities and cater to all scenarios. Every possible new scenario, you add it to your API. Your code grows disproportionately. But it is generic in the true sense and everybody starts using it. You are happy.
May your every morning be filled with joy & happiness. Wish you a very Happy New Year! May God's grace shine on you and your family. Wishing you all good health and great success.
Getting started with GitHub Actions and Laravel
When GitHub released its new product: GitHub Actions a whole new world opened for developers. Let's dive right in and see what it brings for the Laravel community.
When GitHub released its new product: GitHub Actions a whole new world opened for developers. Let's dive right in and see what it brings for the Laravel community.
ββGo vs PHP syntax comparison
Go is a statically typed and compiled language designed by Google. It is somewhat similar to C. However, it is packed with more goodies such as garbage collection, memory safety, structural typing and concurrency. Its concurrency mechanisms make it possible to get the most out of the multicore and network machines.
Go is a statically typed and compiled language designed by Google. It is somewhat similar to C. However, it is packed with more goodies such as garbage collection, memory safety, structural typing and concurrency. Its concurrency mechanisms make it possible to get the most out of the multicore and network machines.
ββHow to build a Laravel REST API with Test-Driven Development
Today weβll be going on a Laravel journey driven by tests. Weβll create a Laravel REST API complete with authentication and CRUD functionality without opening Postman or a browser.
Today weβll be going on a Laravel journey driven by tests. Weβll create a Laravel REST API complete with authentication and CRUD functionality without opening Postman or a browser.
Amazing PHP pinned Β«Backorder expiring domain names Find a cool domain, backorder it and own it.Β»
New in PHP 8
PHP 8, the new major PHP version, is expected to be released by the end of 2020. It's in very active development right now, so things are likely to change a lot in the upcoming months.
PHP 8, the new major PHP version, is expected to be released by the end of 2020. It's in very active development right now, so things are likely to change a lot in the upcoming months.
How fast is PHP-8 going to be?
PHP-8 is going to be released at the end of this year, and one of its most exciting features is JIT compilation. Letβs see how it improves the speed of a PHP script.
PHP-8 is going to be released at the end of this year, and one of its most exciting features is JIT compilation. Letβs see how it improves the speed of a PHP script.
Clean Code and Object Calisthenics Rules I try to Follow
I do a lot of Code Reviews, and without proper automation of most of the low level items that you are usually βremarkingβ to colleagues it is a frustrating experience for everyone involved and takes more time that needed.
I do a lot of Code Reviews, and without proper automation of most of the low level items that you are usually βremarkingβ to colleagues it is a frustrating experience for everyone involved and takes more time that needed.