Amazing PHP
9.29K subscribers
11 photos
84 links
Welcome to the Amazing PHP Channel! Here you can find a lot of interesting articles/news about PHP, frameworks, tools and development.

Support the channel: https://www.paypal.com/donate?hosted_button_id=FAYP5QJH5LVRL
Download Telegram
#news #drupal
Security vulnerability in unmaintained Drupal contrib module puts 120000 sites at risk
http://drupal.sh/vulnerable-drupal-contrib-module-puts-120000-sites-at-risk
s Best Practice Actually Poor Practice? Dependency Injection, Type Hinting, and Unit Tests...
I've recently been in discussion with a colleague who thinks that dependency injection (DI) is over-used and, in cases where the dependency is a concrete class, unnecessary (in the latter case, he advocates simply creating new objects on the fly). I raised the point that dependency injection allows you to pass in a mock object while unit testing, but he dismissed that as irrelevant and not a valid argument as to why dependency injection is useful.
Symfony 4: Monolith vs Micro
Monolith projects versus micro-applications; a never-ending debate. Both ways to develop applications are fine in my book. Symfony supports both. Even if the Symfony Standard Edition is probably more suitable for monolith projects as it depends on the symfony/symfony package.
This Picture Will Change the Way You Learn to Code
Recently several amazing visualizations of the various technologies used by web developers in 2017 surfaced on the Interwebs. One of them (geared towards backend developers) is pictured above.

https://cdn-images-1.medium.com/max/1000/1*wS8k6IlIgSb-7-lPhaNyrQ.png
13 Simple Rules for Good Coding (from my 15 years of experience)
Hi guys, i work as a programmer more than 15 years and was using many different languages, paradigms, frameworks and other shit. And i want to share with you my rules of writing good code.
How You Can Successfully Ship New Code in a Legacy Codebase
The greek philosopher Heraclitus already knew that "change is the only constant" and as software developers we know this to be true for much of software development and business requirements.
Moving from array to class
Ever since I started using PHP, arrays have always been my friend. They are versatile, they have a wide range of functions, and they are easy to use. I kept using them versions after versions, and even with PHP 7.2, I still rely on them a lot. ...
Building flexible PHP projects
The era of full-stack frameworks is behind us. Nowadays, framework vendors are splitting their monolithic repositories into components with the help of Git subtree, allowing you to cherry-pick ones that you need for your project. This means that you can build your application on top of Zend Service Manager, Aura Router, Doctrine ORM, Laravel (Illuminate) Eloquent, Plates, Monolog, Symfony Cache, or any component out there that can be installed via Composer.
ARE TRAITS EVIL?
What do you think about Traits in PHP? Do you think they are evil and should avoid using them? If using them what are some common pitfalls fx where not to use them? Maybe you got some bad or good experience?
Getting Started with RabbitMQ in PHP
RabbitMQ is the message broker. We can use that to schedule background tasks or send events asynchronously. There are good writeups on the benefits it gives to you: Top 10 Uses For A Message Queue, Main features and benefits of message queuing.
Creating your own Domain Event Dispatcher
A couple of weeks ago we looked at implementing Domain Events. Domain Events form a crucial building block in Domain Driven Design by allowing us to effectively decouple our application using the Publish-subscribe pattern.
Matthias Noback - Hexagonal Architecture - Message-Oriented Software Design
Commands, events, queries - three types of messages that travel through your application. Some originate from the web, some from the command-line. Your application sends some of them to a database, or a message queue. What is the ideal infrastructure for an application to support this on-going stream of messages?
https://www.youtube.com/watch?v=K1EJBmwg9EQ
How I generate model factories in light speed!
I was sick and tired building model factories for every table I wanted to test in my laravel applications. So I woke up this morning and decided to try and make a helper command about this. In a Laravel 5.4 application I am currently working on, I created a new command by using the usual artisan make:command
How PHP Executes – from Source Code to Render
This article will skim through these stages and show how we can view the output from each stage to really see what is going on. Note that while some of the extensions used should already be a part of your PHP installation (such as tokenizer and OPcache), others will need to be manually installed and enabled (such as php-ast and VLD).
From Monolith to Microservices
The first step in the rebuild of our web platform is a proper foundation: the infrastructure. And our title has already given away the first decision that we’ve made: we’re going for microservices.
Getting to Know and Love Xdebug
It’s been 15 years since Xdebug first came out. We think this is the perfect opportunity to re-introduce it to the world, and explain how and why it does what it does.
PHP and immutability: difficulties and scalars - part one
Being a weakly typed dynamic language, PHP has not really had the concept of immutability built into it. We’ve seen the venerable define() and CONSTANTS of course, but they’re limited. Whilst PHP does ship with an immutable class as part of it’s standard library, DateTimeImmutable, there is no immediately obvious method to create custom immutable objects.
PHP and immutability: modified copies - part two
There were a few issues to work through, but we got there in the end. Now onto making the immutable class more useful and easier to create modified copies. Note that these are copies and not modifications, in-place, to the original objects.
PHP and immutability: objects and generalisation - part three
This one is going to tackle an issue I have hitherto skirted around and avoided. Objects in immutable data structures.
Message bus to every PHP application
It is a pattern that enables separate applications to work together, but in a decoupled fashion such that applications can be easily added or removed without affecting the others.