diff --git a/rector.php b/rector.php
index 50ca55162..fb27b8a4d 100644
--- a/rector.php
+++ b/rector.php
@@ -15,6 +15,7 @@ return static function (RectorConfig $rectorConfig): void {
__DIR__ . '/modules',
__DIR__ . '/plugins',
__DIR__ . '/src',
+ __DIR__ . '/templates',
__DIR__ . '/update',
]);
diff --git a/templates/dashboard/settings.php b/templates/dashboard/settings.php
index 0eff70354..23674bf34 100755
--- a/templates/dashboard/settings.php
+++ b/templates/dashboard/settings.php
@@ -17,8 +17,8 @@
* along with this program. If not, see .
*/
-$format = (isset($_SESSION['dashboard']['format'])) ? $_SESSION['dashboard']['format'] : 'A4';
-$orientation = (isset($_SESSION['dashboard']['orientation'])) ? $_SESSION['dashboard']['orientation'] : 'L';
+$format = $_SESSION['dashboard']['format'] ?? 'A4';
+$orientation = $_SESSION['dashboard']['orientation'] ?? 'L';
return [
'format' => $format,
diff --git a/templates/dashboard_settimanale/settings.php b/templates/dashboard_settimanale/settings.php
index 0eff70354..23674bf34 100644
--- a/templates/dashboard_settimanale/settings.php
+++ b/templates/dashboard_settimanale/settings.php
@@ -17,8 +17,8 @@
* along with this program. If not, see .
*/
-$format = (isset($_SESSION['dashboard']['format'])) ? $_SESSION['dashboard']['format'] : 'A4';
-$orientation = (isset($_SESSION['dashboard']['orientation'])) ? $_SESSION['dashboard']['orientation'] : 'L';
+$format = $_SESSION['dashboard']['format'] ?? 'A4';
+$orientation = $_SESSION['dashboard']['orientation'] ?? 'L';
return [
'format' => $format,
diff --git a/templates/info.php b/templates/info.php
index c5f95c50d..995de7fe7 100755
--- a/templates/info.php
+++ b/templates/info.php
@@ -47,8 +47,8 @@ $azienda = $dbo->fetchOne('SELECT *, (SELECT `iban` FROM `co_banche` WHERE `id`
* @deprecated
*/
$replace = [
- 'c_' => isset($cliente) ? $cliente : [],
- 'f_' => isset($azienda) ? $azienda : [],
+ 'c_' => $cliente ?? [],
+ 'f_' => $azienda ?? [],
];
// Rinominazione di particolari campi all'interno delle informazioni su anagrafica e azienda
diff --git a/templates/liquidazione_iva/settings.php b/templates/liquidazione_iva/settings.php
index fe6e31828..bb0b24286 100644
--- a/templates/liquidazione_iva/settings.php
+++ b/templates/liquidazione_iva/settings.php
@@ -17,8 +17,8 @@
* along with this program. If not, see .
*/
-$format = (isset($_SESSION['stampe_contabili']['format'])) ? $_SESSION['stampe_contabili']['format'] : 'A4';
-$orientation = (isset($_SESSION['stampe_contabili']['orientation'])) ? $_SESSION['stampe_contabili']['orientation'] : 'L';
+$format = $_SESSION['stampe_contabili']['format'] ?? 'A4';
+$orientation = $_SESSION['stampe_contabili']['orientation'] ?? 'L';
return [
'format' => $format,
diff --git a/templates/ordini/body.php b/templates/ordini/body.php
index c385ae36e..cfc52f9c0 100755
--- a/templates/ordini/body.php
+++ b/templates/ordini/body.php
@@ -45,9 +45,7 @@ if (!setting('Visualizza riferimento su ogni riga in stampa')) {
$columns = 7;
-$has_image = $righe->search(function ($item) {
- return !empty($item->articolo->immagine);
-}) !== false && $options['images'] == true;
+$has_image = $righe->search(fn($item) => !empty($item->articolo->immagine)) !== false && $options['images'] == true;
if ($has_image) {
++$columns;
diff --git a/templates/preventivi/body.php b/templates/preventivi/body.php
index dcd64cb52..8bb225554 100755
--- a/templates/preventivi/body.php
+++ b/templates/preventivi/body.php
@@ -54,9 +54,7 @@ if ($pagamento && $pagamento->isRiBa()) {
// Righe documento
$righe = $documento->getRighe();
-$has_image = $righe->search(function ($item) {
- return !empty($item->articolo->immagine);
-}) !== false && $options['images'] == true;
+$has_image = $righe->search(fn($item) => !empty($item->articolo->immagine)) !== false && $options['images'] == true;
$columns = $options['no-iva'] ? 5 : 6;
$columns = $options['pricing'] ? $columns : 3;
diff --git a/templates/provvigione/settings.php b/templates/provvigione/settings.php
index fe6e31828..bb0b24286 100644
--- a/templates/provvigione/settings.php
+++ b/templates/provvigione/settings.php
@@ -17,8 +17,8 @@
* along with this program. If not, see .
*/
-$format = (isset($_SESSION['stampe_contabili']['format'])) ? $_SESSION['stampe_contabili']['format'] : 'A4';
-$orientation = (isset($_SESSION['stampe_contabili']['orientation'])) ? $_SESSION['stampe_contabili']['orientation'] : 'L';
+$format = $_SESSION['stampe_contabili']['format'] ?? 'A4';
+$orientation = $_SESSION['stampe_contabili']['orientation'] ?? 'L';
return [
'format' => $format,
diff --git a/templates/registro_iva/settings.php b/templates/registro_iva/settings.php
index fe6e31828..bb0b24286 100755
--- a/templates/registro_iva/settings.php
+++ b/templates/registro_iva/settings.php
@@ -17,8 +17,8 @@
* along with this program. If not, see .
*/
-$format = (isset($_SESSION['stampe_contabili']['format'])) ? $_SESSION['stampe_contabili']['format'] : 'A4';
-$orientation = (isset($_SESSION['stampe_contabili']['orientation'])) ? $_SESSION['stampe_contabili']['orientation'] : 'L';
+$format = $_SESSION['stampe_contabili']['format'] ?? 'A4';
+$orientation = $_SESSION['stampe_contabili']['orientation'] ?? 'L';
return [
'format' => $format,
diff --git a/templates/riepilogo_interventi/piece.php b/templates/riepilogo_interventi/piece.php
index 09c26aac6..ddbccf063 100644
--- a/templates/riepilogo_interventi/piece.php
+++ b/templates/riepilogo_interventi/piece.php
@@ -45,7 +45,7 @@ $somma_totale_imponibile[] = $totale_imponibile;
$somma_iva[] = $iva;
$somma_totale_ivato[] = $totale_ivato;
-$pricing = isset($pricing) ? $pricing : true;
+$pricing ??= true;
// Informazioni intervento
echo '