php PHP : The fall of `array` array is a very common type in PHP but is often overused. I'll try to explain why you don't (almost) need to type hint array anymore ! Table of Contents 1. The problems 2. First steps 3. Using Countable 4. Using ArrayAccess 5. Using Traversable 5.1. The hard way (implementing
php PHP : nested use of array_* is a disguised array_reduce I feel like in javascript you see a lot of [...].reduce() but not so much in PHP. It may be a shame not to use it because it can help you write more readable code and with less iterations. array_reduce is all other array_* ... Any array_* function can be
symfony Symfony : why I stopped using the AbstractController A typical Controller in Symfony may look like this : use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; class HelloController extends AbstractController { #[Route( path: '/hello/{name}', name: 'app_hello', requirements: ['name' => '[a-zA-Z-]+'], methods: ['GET'] )] public function index(string $name = 'Adrien'): Response { $form = $this->createForm(SomeFormType::class); return $this->render(
docker Seamless usage of docker in any apps One of the barriers to using docker these days for some developers is the burden to interact with it daily instead of using the usual tools directly. Let's see how we can ease things. Table of Contents 1. What's this about ? 2. How does it works ? 3. How to use
docker compose Docker Compose - a few tips #1 When following tutorials or hello-world, you will always end up with simple knowledge on how to do the basic stuff with a strict minimum (fewer files as possible, fewer lines of code, ...). The drawbacks are it does not teach us the best way to do things. How to keep things