Ottimizzazione file con php8.1

This commit is contained in:
Pek5892 2024-04-08 15:57:28 +02:00
parent de4759fd5b
commit 477a56e953
10 changed files with 16 additions and 19 deletions

View File

@ -15,6 +15,7 @@ return static function (RectorConfig $rectorConfig): void {
__DIR__ . '/modules',
__DIR__ . '/plugins',
__DIR__ . '/src',
__DIR__ . '/templates',
__DIR__ . '/update',
]);

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
$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,

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
$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,

View File

@ -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

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
$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,

View File

@ -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;

View File

@ -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;

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
$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,

View File

@ -17,8 +17,8 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
$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,

View File

@ -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 '