<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>EndelWar's Blog</title><link>https://endelwar.it/</link><description>Recent content on EndelWar's Blog</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><copyright>Manuel Dalla Lana</copyright><lastBuildDate>Fri, 14 Jul 2023 17:11:14 +0200</lastBuildDate><atom:link href="https://endelwar.it/index.xml" rel="self" type="application/rss+xml"/><item><title>Understanding Nullable Indicator and Null Behavior in PHP 8.1</title><link>https://endelwar.it/2023/07/understanding-nullable-indicator-and-null-behavior-in-php-8.1/</link><pubDate>Fri, 14 Jul 2023 17:11:14 +0200</pubDate><guid>https://endelwar.it/2023/07/understanding-nullable-indicator-and-null-behavior-in-php-8.1/</guid><description>In PHP, as in many other programming languages, null is a special type that represents the absence of a value or a reference to a non-existent value. However, the way null interacts with other types in PHP can be a source of confusion, especially when it comes to typing.
Nullable Types and the ? Operator Starting from PHP 7.1, PHP supports nullable types using the ? operator which can be placed in front of a type name.</description></item><item><title>Generating PDF on PHP with WeasyPrint, with batteries included</title><link>https://endelwar.it/2021/07/generating-pdf-on-php-with-weasyprint-with-batteries-included/</link><pubDate>Mon, 19 Jul 2021 16:29:21 +0200</pubDate><guid>https://endelwar.it/2021/07/generating-pdf-on-php-with-weasyprint-with-batteries-included/</guid><description>Everyone loves PDF: CEOs, CFOs, marketing people, even the postman and the milkman, everyone except developers that need to convert HTML pages to PDF.
Fortunately, there are quite a few libraries that help the poor PHP developer in his task, some are native implementations, others are a wrapper for a CLI application.
One of these is Snappy , a popular (22M+ downloads) library that wraps wkhtmltopdf. wkhtmltopdf is good, until you encounter that HTML code that renders awfully or you hit one of wkhtmltopdf&amp;rsquo;s missing features, that&amp;rsquo;s what happened to me.</description></item><item><title>Manage PHP Symlink deploy with Caddy 2.2</title><link>https://endelwar.it/2020/09/manage-php-symlink-deploy-with-caddy-2.2/</link><pubDate>Tue, 15 Sep 2020 11:21:40 +0200</pubDate><guid>https://endelwar.it/2020/09/manage-php-symlink-deploy-with-caddy-2.2/</guid><description>I use Deployer as the deployment tool for websites and web apps that I develop: it&amp;rsquo;s a fine piece of software that permits releasing software very quickly, and the whole process becomes a no-brainer.
Deployer uses the following directory structure to organize your code:
. ├── current -&amp;gt; releases/91 ├── releases │ ├── 87 │ ├── 88 │ ├── 89 │ ├── 90 │ └── 91 └── shared ├── config ├── private ├── public └── var The last 5 (quantity is configurable) releases are in releases directory, and the last one is symlinked to current, which, probably, contains public directory that is the root directory for your web server.</description></item><item><title>Filter users by role in Symfony 5</title><link>https://endelwar.it/2020/08/filter-users-by-role-in-symfony-5/</link><pubDate>Mon, 17 Aug 2020 23:06:21 +0200</pubDate><guid>https://endelwar.it/2020/08/filter-users-by-role-in-symfony-5/</guid><description>Ever needed to retrieve a list of users from a Doctrine repository having a single role? Like, get all users with ROLE_ADMIN or ROLE_USER?
If you go the &amp;ldquo;easy way&amp;rdquo; filtering with LIKE you can expect some surprises: what will this function returns when $role = 'ADMIN' and you both have roles named ROLE_ADMIN and ROLE_SUPER_ADMIN ?
&amp;lt;?php public function findByRoleWrongWay(string $role) { return $this-&amp;gt;createQueryBuilder(&amp;#39;u&amp;#39;) -&amp;gt;andWhere(&amp;#39;u.roles LIKE :role&amp;#39;) -&amp;gt;setParameter(&amp;#39;role&amp;#39;, &amp;#39;ROLE_%&amp;#34;&amp;#39; .</description></item><item><title>Hello World.</title><link>https://endelwar.it/2020/08/hello-world./</link><pubDate>Thu, 13 Aug 2020 18:12:36 +0200</pubDate><guid>https://endelwar.it/2020/08/hello-world./</guid><description>I decided to (re)start writing: I&amp;rsquo;ve never been a great creator of contents, as my lyceum&amp;rsquo;s professors maybe remember, and I want to change this.
So here is my blog, it will contain notes about what I found useful for me and my job as a web developer, or something worth sharing with the developer&amp;rsquo;s community.
My first blog (started in 2007 and abandoned in 2012) was in Italian, I want to write more in English, this way I can reach more people that could give me feedback on what I&amp;rsquo;m doing.</description></item><item><title>Contact</title><link>https://endelwar.it/contact/</link><pubDate>Fri, 03 Apr 2015 02:13:50 +0000</pubDate><guid>https://endelwar.it/contact/</guid><description>Contact Hi, I&amp;rsquo;m glad you want to reach me!
You can write me at manuel@dallalana.it .</description></item></channel></rss>