Skip to content

Instantly share code, notes, and snippets.

View lruozzi9's full-sized avatar
👨‍💻
Developing

Lorenzo Ruozzi lruozzi9

👨‍💻
Developing
View GitHub Profile
@lruozzi9
lruozzi9 / exportSymfonyMessagesToCSV.php
Last active July 26, 2022 15:31
Scripts to export and import messages to a CSV file to simplify the data entry for non-developer people.
<?php
declare(strict_types=1);
use League\Csv\CannotInsertRecord;
use League\Csv\InvalidArgument;
use League\Csv\Writer;
use Symfony\Component\Yaml\Yaml;
const ORIGINAL_MESSAGES_FILE_PATH = 'translations/messages+intl-icu.en.yaml';
@lruozzi9
lruozzi9 / Symfony framework clipboard.md
Created September 14, 2021 08:38
A quick and easy reminder of some tips and doubts that may arise with the use of the Symfony framework

Appunti framework Symfony

Validation

Validazione oggetto con group sequence provider referenziato

Qui viene documentata la differenza fra i gruppi di validazione Default e ClassName. Nello specifico viene indicato che quando è presente un oggetto referenziato nella prima entità, esso verrà validato (sempre se presente il constraint Valid) con lo stesso gruppo del primo. Quindi se valido User con il gruppo Default, Address verrà validato con il gruppo Default e similmente con il gruppo ClassName.

La cosa cambia quando si usano dei group sequence provider (qui la guida). In questo caso, il gruppo di validazione Default si riferisce al group sequence.

@lruozzi9
lruozzi9 / laravel.yml
Created January 23, 2021 18:00
GitHub action for testing Laravel app with MySQL
name: Laravel
on: [push, pull_request]
jobs:
laravel-tests:
runs-on: ubuntu-latest
services: