Discover and read the best of Twitter Threads about #Symfony

Most recents (12)

In recent days I saw several examples of "actions" in #Laravel, but one especially got my attention and I wanted to clarify it - so we had little discussion with @wendell_adriel and I would like to share my opinion about this particular approach 🙂

🧵👇

Before we start, one important preface: I'm big fan of explicitness and testability, so I'm using dependency injection everywhere (where's applicable). Examples in this thread will use it too by default, along with #PHP 8.0+ syntaxes.
What caught my attention was instantiating action inside controller's method 🤔 That looked suspicious, because I'm used to different nomenclature.

My assumption after looking at the example was that `CreateUserAction` is more like a #CQRS command rather than action.
Read 22 tweets
As a Laravel Dev who consistently uses Macs, here's a 🧵 of little tips I have for you when using the command line

#macos #laravel #symfony #phpc
1. If you need to find a command you previously used CTRL + R will let you search for old commands in your ~/.zsh_history file.
2. To move quickly left and right on the CLI, hold the ALT key with the arrow keys and it will force the cursor left and right to the next white space in the command.
Read 8 tweets
There were many discussions if #Laravel's facades implement GoF's Facade Pattern, but I think it does not matter at this point - the team won't change naming convention anyway. Naming is not a problem, I see other issues with facades - a #PHP thread 🧵
1) They're basically magic 🪄 Some may see it as advantage, but I consider it as drawback. You don't execute exact code you're calling, but your call is proxied to some underlying service. It strictly couples your code with the framework, which handles it.
Facades' API has to be added as comments in PHPDoc (with `@Method`) which is error prone because it's easy to forget to update facade's phpdoc when underlying service (accessor) is changed. But even if autocompletion in IDE works, you just can't simply navigate to method's code.
Read 18 tweets
0⃣Clean Code Series: Functions 📒💻

A guide to producing readable, reusable, and refactorable software in #php (#laravel #symfony #magento) #javascript #python, etc.

(References)
- Robert C. Martin's book "Clean Code"
- github .com/jupeter/clean-code-php

Mega Thread (14) 🧵👇 Image
1⃣ Clean Code Series: Functions📒🧑‍💻

☑️ Use default arguments instead of short-circuiting or conditionals Image
2⃣ Clean Code Series: Functions📒🧑‍💻

☑️ Function arguments (2 or fewer ideally)

🔹Zero arguments are the ideal case. One or two arguments are ok, and three should be avoided. Anything more than that should be consolidated. Image
Read 16 tweets
0⃣Clean Code Series: Comparision 📒💻

A guide to producing readable, reusable, and refactorable software in #php (#laravel #symfony) #javascript #python, etc.

- Software engineering principles, from Robert C. Martin's book "Clean Code"

🔽 github.com/jupeter/clean-…

Thread 🧵👇 Image
1⃣Clean Code Series: Comparision 📒💻

☑️ Use identical comparison Image
2⃣Clean Code Series: Comparision 📒💻

☑️ Null coalescing operator Image
Read 5 tweets
The fundamental problem of #web #development:

Turning trees into tables and back

(Thread 1/6)
It may seem simple as you may have some data in tables (hello, MySQL) and you want them on a web page (hi, <table>). But you start joining data from other tables and you end up displaying a tree in a table. How? You never know how to do it until you try to use that. UX!

(2/6)
But if you have tree-data, tree-database (hello, Mongo), and tree components on website, you still need tables to present the data of similar structure. It's all 2D and are brains are trained to get information presented as combination of 2 axes. Hello, tables!

(3/6)
Read 7 tweets
Journée #Josy sur le #DNS indico.mathrice.fr/event/286/

Premier à parler, @remasse (@AFNIC ) qui va exposer les grands principes.
Résolution #DNS (« ça doit marcher 100 % du temps ») puis cycle de vie du nom de domaine (pensez au renouvellement) pour lequel, dans un .fr, on doit passer par un BE (Bureau d'Enregistrement).

#JoSy
L'évolution du .fr : très petit jusqu'en 2004 car enregistrement très restrictif (« nous avions fini par prendre un .com »)

Depuis les réformes de 2004 et 2006, .fr décolle. Bientôt 4 millions de noms.
Read 32 tweets
I've been working on a little side project: ToFeed

Pitch: Gather links from your Twitter timeline into an RSS feed! ToFeed watches your Twitter timeline for interesting links and give you back an RSS feed.
tofeed.net/r/tw_01
It's something I made for myself, I'm using it since a year, and it's really nice to skip all the Twitter ranting but not missing out on the significant news.
So I decided to remake it from scratch with a premium model (so it can pay for itself). I also used it as an excuse to revise my skills in #webdevelopment #php and #symfony.
Read 5 tweets
#php #symfony build pipeline:
- composer validate+normalize
- php-cs-fixer (code style)
- phpstan (static analysis)
- phpunit + pcov (tests + coverage)
- bin/console lint:* (lint cfg and container)
- bin/console security:check
- infection (mutation tests)
something is missing?
Yes, I still use this:
phpat - github.com/carlosas/phpat
Such an integration pipeline is the heart of every application, maybe an open project that uses various available tools would be a good idea 🤔
Read 4 tweets
#Twig does not have a "master" branch. Instead, it has a 1.x, 2.x, and 3.x branches. Works wonderfully. I propose to do the almost same for #Symfony by renaming the current "master" branch to "5.x". We will keep 5.1, 5.2, ... branches as we do maintenance on minor versions.
See github.com/symfony/symfon… for the issue discussing the matter.
Funny how some react to this. Nobody objected when I got rid of master for Twig for semantic reasons. Having something more descriptive is enough to make the change. Think of the master /slave debate as a starting point for the discussion, not as the main goal if you want.
Read 6 tweets
I know you have heard of password #Salts which are similar to Nonces and used to add uniqueness to passwords and protect against pre-computed hashes (rainbow tables).

Did you also know about password #Peppers ? They are equally important too.
In modern web applications of today, you should #Pepper your passwords as well as #Salt them too before hashing them. Here is the order:

Original Password ---> Salt ---> Pepper ---> Hash ---> Store-In-DB.

However, if you #Pepper passwords wrongly. It could be very disastrous!
What do i mean by this ?

Well, the simplest (and safest - very important) way to #Pepper a password is to HMAC(Original_Password, key) it.

HMACs are resistant to length-extension attacks & brutes-force attacks.

There must be a #Pepper key used for the HMAC too
Read 16 tweets
Thread Reader will be down for maintenance this night at 10pm PST for about 1h. Thank you for your understanding!
Down in a few minutes, see you soon!
in progress ... database migration
Read 4 tweets

Related hashtags

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!