The Strangebuzz PHP/Symfony blog.
Articles for the "php" tag.
2024-03-29T02:29:10+01:00
COil
coil@strangebuzz.com
https://www.strangebuzz.com/en/blog/tag/php.xml
https://www.strangebuzz.com/img/strangebuzz_132.jpg?6.4.2
https://www.strangebuzz.com/img/strangebuzz_1024.jpg?6.4.2
© 2024 Strangebuzz
Installing and using php-cs-fixer
https://www.strangebuzz.com/en/blog/installing-and-using-php-cs-fixer
2024-01-15T00:00:00+01:00
2024-01-15T00:00:00+01:00
COil
coil@strangebuzz.com
In this post, we see different methods to install and use php-cs-fixer. We see that it's not as obvious as it seems.
Introducing the MicroSymfony application template
https://www.strangebuzz.com/en/blog/introducing-the-microsymfony-application-template
2023-08-21T00:00:00+02:00
2023-08-21T00:00:00+02:00
COil
coil@strangebuzz.com
In this post, I introduce the MicroSymfony application template, which results from several ideas I already discussed in a previous post: "Initializing your Symfony project with solid foundations".
Using Symfony forms with PHP typed properties
https://www.strangebuzz.com/en/blog/using-symfony-forms-with-php-typed-properties
2023-05-20T00:00:00+02:00
2023-05-20T00:00:00+02:00
COil
coil@strangebuzz.com
In this post, we see how to use Symfony forms with PHP typed properties and non-nullable one. Let's see the problems that can occur and how to handle them.
Using PHP enumerations with your Symfony workflows
https://www.strangebuzz.com/en/blog/using-php-enumerations-with-your-symfony-workflows
2023-04-08T00:00:00+02:00
2023-04-08T00:00:00+02:00
COil
coil@strangebuzz.com
This post shows how to use PHP enumerations with your Symfony workflows. Let's take advantage of this new PHP feature to clean up and improve all the workflow-related code.
Using PHP 8.1 enumerations in a Symfony project
https://www.strangebuzz.com/en/blog/using-php-8-1-enumerations-in-a-symfony-project
2022-09-03T00:00:00+02:00
2022-09-07T00:00:00+02:00
COil
coil@strangebuzz.com
This post shows how to use PHP 8.1 enumerations in a Symfony project. We review the different steps to use this new PHP 8.1 useful feature in different parts of a Symfony application.
Upgrading PHP with the ondrej/php repository on an Ubuntu server
https://www.strangebuzz.com/en/blog/upgrading-php-with-the-ondrej-php-repository-on-an-ubuntu-server
2022-07-25T00:00:00+02:00
2022-07-25T00:00:00+02:00
COil
coil@strangebuzz.com
This post shows how to upgrade PHP with the ondrej/php repository on an Ubuntu server, step by step, to avoid forgetting something.
Initializing your Symfony project with solid foundations
https://www.strangebuzz.com/en/blog/initializing-your-symfony-project-with-solid-foundations
2022-06-11T00:00:00+02:00
2022-06-12T00:00:00+02:00
COil
coil@strangebuzz.com
This post shows how to initialize a Symfony project with solid foundations. I give several bits of advice about this crucial step that determines how your project will evolve in the long run; will it stay maintainable and fun to work with? Or will it become the legacy project everyone tries to avoid?
Simple API mocking with the Symfony HTTP client
https://www.strangebuzz.com/en/blog/simple-api-mocking-with-the-symfony-http-client
2022-02-12T00:00:00+01:00
2022-02-12T00:00:00+01:00
COil
coil@strangebuzz.com
In this post, we see a simple solution to mock API calls with the Symfony HTTP client, declare a scoped HTTP client and test it with or without mock.
Organizing your Symfony project tests
https://www.strangebuzz.com/en/blog/organizing-your-symfony-project-tests
2021-12-22T00:00:00+01:00
2021-12-22T00:00:00+01:00
COil
coil@strangebuzz.com
In this post, we see how to organize your Symfony project tests. We check all the available test types and create consistent and robust test suites.
Creating custom PHPStan rules for your Symfony project
https://www.strangebuzz.com/en/blog/creating-custom-phpstan-rules-for-your-symfony-project
2021-10-28T00:00:00+02:00
2021-10-28T00:00:00+02:00
COil
coil@strangebuzz.com
In this post, we see how to create custom PHPStan rules for a Symfony project. We will check Symfony best practices but also more specific rules.
The PHP exceptions' cheat sheet
https://www.strangebuzz.com/en/blog/the-php-exceptions-cheatsheet
2021-10-02T00:00:00+02:00
2021-10-02T00:00:00+02:00
COil
coil@strangebuzz.com
This post is different from what I use to do. It will be a reference, a "cheat sheet" mentioning all available exceptions with PHP.
End-to-end testing with Symfony and Panther
https://www.strangebuzz.com/en/blog/end-to-end-testing-with-symfony-and-panther
2021-04-04T00:00:00+02:00
2021-04-04T00:00:00+02:00
COil
coil@strangebuzz.com
In this post, we will see how to create an end-to-end test scenario using Symfony, Panther and Vue.js with a concrete example.
Step by step debugging with Xdebug, Symfony and PHPStorm
https://www.strangebuzz.com/en/blog/step-by-step-debugging-with-xdebug-symfony-and-phpstorm
2020-06-21T00:00:00+02:00
2020-10-18T00:00:00+02:00
COil
coil@strangebuzz.com
In this post, we will see how to do step by step debugging with Xdebug, Symfony and PHPStorm. We will do a basic example where we will stop the execution of the Symfony code just before rendering a template to check the data passed to it.
On using the good old Symfony BaseController
https://www.strangebuzz.com/en/blog/on-using-the-good-old-symfony-basecontroller
2019-12-31T00:00:00+01:00
2019-12-31T00:00:00+01:00
COil
coil@strangebuzz.com
In this post, we will see how to use the Symfony AbstractController that was introduced in Symfony 3.3/4.1. We will review what we used to do before and the evolutions that were done from symfony 1 to Symfony 5, especially how services were declared and used. Eventually, we will try to understand why this new "Base controller" was introduced.
The Symfony Request class interactive cheatsheet
https://www.strangebuzz.com/en/blog/the-symfony-request-class-interactive-cheatsheet
2019-01-29T00:00:00+01:00
2020-04-10T00:00:00+02:00
COil
coil@strangebuzz.com
In this post, we will review one of the most used and useful service (in fact it's a value object) provided by Symfony which is the <a target="_blank" href="https://api.symfony.com/master/Symfony/Component/HttpFoundation/Request.html">Request service</a> Is is part of the HttpFoundation component. Symfony is indeed a <a target="_blank" href="https://symfony.com/doc/current/introduction/http_fundamentals.html#requests-and-responses-in-http">"Request/Response" framework</a>. It will be <b>interactive</b>, that means that you will be able to change the URL used in the examples and provide your one so you can test with different parameters. It will, therefore, save you manual <code>dump()</code> calls. 😉