Skip to content

Commit bac1a52

Browse files
committed
Merge branch 'composer-update' of https://github.com/Dasc3er/openstamanager into Dasc3er-composer-update
2 parents 15b0301 + 5dc9483 commit bac1a52

20 files changed

Lines changed: 94 additions & 74 deletions

File tree

composer.json

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}],
1616
"type": "project",
1717
"require": {
18-
"php": "^8.1|^8.3",
18+
"php": "^8.1",
1919
"ext-curl": "*",
2020
"ext-dom": "*",
2121
"ext-fileinfo": "*",
@@ -39,38 +39,36 @@
3939
"greenlion/php-sql-parser": "^4.5",
4040
"guzzlehttp/guzzle": "^7.0.1",
4141
"ifsnop/mysqldump-php": "^2.3",
42-
"illuminate/database": "^8.0",
43-
"intervention/image": "^3.11",
42+
"illuminate/database": "^10.0",
43+
"intervention/image": "^3.0",
4444
"jurosh/pdf-merge": "^2.1",
4545
"league/csv": "^9.7.0",
4646
"league/flysystem": "^3.0",
4747
"league/flysystem-ftp": "^3.0",
4848
"league/oauth2-client": "^2.6",
4949
"league/oauth2-google": "^4.0",
50-
"monolog/monolog": "^1.27",
50+
"monolog/monolog": "^3.0",
5151
"mpdf/mpdf": "^v8.0.10",
52-
"mpociot/vat-calculator": "^2.3",
5352
"owasp/csrf-protector-php": "^1.0",
5453
"phpmailer/phpmailer": "^6.0",
5554
"picqer/php-barcode-generator": "^3.2",
5655
"respect/validation": "^2.0",
5756
"servo/fluidxml": "^2.0",
5857
"slim/flash": "^0.4.0",
5958
"spipu/html2pdf": "^5.0.0",
60-
"symfony/filesystem": "^5.0",
61-
"symfony/finder": "^5.0",
59+
"symfony/filesystem": "^6.0",
60+
"symfony/finder": "^6.0",
6261
"symfony/polyfill-ctype": "^1.8",
63-
"symfony/polyfill-php70": "^1.8",
64-
"symfony/translation": "^4.0",
65-
"symfony/var-dumper": "^5.0",
62+
"symfony/translation": "^6.0",
63+
"symfony/var-dumper": "^6.0",
6664
"thenetworg/oauth2-azure": "^2.0",
6765
"voku/stringy": "^6.0.0",
6866
"willdurand/geocoder": "^4.2"
6967
},
7068
"require-dev": {
7169
"friendsofphp/php-cs-fixer": "^3.53",
7270
"phpunit/phpunit": "^11.5",
73-
"rector/rector": "^1.0"
71+
"rector/rector": "^2.0"
7472
},
7573
"autoload": {
7674
"psr-4": {

core.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120

121121
// Aggiunta di Monolog a Whoops
122122
$whoops->pushHandler(function ($exception, $inspector, $run) use ($logger) {
123-
$logger->addError($exception->getMessage(), [
123+
$logger->addRecord(Monolog\Level::Error, $exception->getMessage(), [
124124
'code' => $exception->getCode(),
125125
'message' => $exception->getMessage(),
126126
'file' => $exception->getFile(),
@@ -151,9 +151,9 @@
151151
$handler = new Monolog\ErrorHandler($logger);
152152
if (!API\Response::isAPIRequest()) {
153153
$handler->registerErrorHandler([]);
154-
$handler->registerExceptionHandler(Monolog\Logger::ERROR);
154+
//$handler->registerExceptionHandler(); // Handled by Whoops above
155155
}
156-
$handler->registerFatalHandler(Monolog\Logger::ERROR);
156+
$handler->registerFatalHandler(\Psr\Log\LogLevel::ERROR);
157157

158158
// Database
159159
$dbo = $database = database();

lib/common.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use Modules\Fatture\Fattura;
3030
use Modules\Interventi\Intervento;
3131
use Modules\Ordini\Ordine;
32+
use Intervention\Image\ImageManager;
3233

3334
/**
3435
* Esegue una somma precisa tra due interi/array.
@@ -422,3 +423,12 @@ function hasArticoliFiglio($id_articolo)
422423
return false;
423424
}
424425
}
426+
427+
/**
428+
* Funzione per generare una classe helper standard per le immagini.
429+
*
430+
* @return ImageManager
431+
*/
432+
function getImageManager() {
433+
return extension_loaded('gd') ? ImageManager::gd() : ImageManager::imagick();
434+
}

lib/deprecated.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ function create_thumbnails($tmp, $filename, $dir)
6969
return false;
7070
}
7171

72-
$driver = extension_loaded('gd') ? 'gd' : 'imagick';
73-
Intervention\Image\ImageManagerStatic::configure(['driver' => $driver]);
74-
75-
$img = Intervention\Image\ImageManagerStatic::make($tmp);
72+
$img = getImageManager()->read($tmp);
7673

7774
$img->resize(600, null, function ($constraint) {
7875
$constraint->aspectRatio();

modules/contratti/src/Contratto.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ class Contratto extends Document
5050
*
5151
* @var array
5252
*/
53-
protected $dates = [
54-
'data_bozza',
55-
'data_conclusione',
56-
'data_accettazione',
57-
'data_rifiuto',
53+
protected $casts = [
54+
'data_bozza' => 'date',
55+
'data_conclusione' => 'date',
56+
'data_accettazione' => 'date',
57+
'data_rifiuto' => 'date',
5858
];
5959

6060
/**

modules/fatture/src/Fattura.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ class Fattura extends Document
5151
'bollo' => 'float',
5252
'peso' => 'float',
5353
'volume' => 'float',
54+
'data' => 'date',
5455

5556
'sconto_finale' => 'float',
5657
'sconto_finale_percentuale' => 'float',
@@ -60,10 +61,6 @@ class Fattura extends Document
6061
'tipo',
6162
];
6263

63-
protected $dates = [
64-
'data',
65-
];
66-
6764
/** @var GestoreScadenze */
6865
protected $gestoreScadenze;
6966
/** @var GestoreMovimenti */

modules/interventi/actions.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -747,10 +747,10 @@
747747

748748
$data = explode(',', post('firma_base64'));
749749

750-
$manager = ImageManager::gd();
751-
$img = $manager->read(base64_decode($data[1]));
752-
753-
$img->scale(680, 202);
750+
$img = getImageManager()->read(base64_decode($data[1]));
751+
$img->resize(680, 202, function ($constraint) {
752+
$constraint->aspectRatio();
753+
});
754754

755755
if (setting('Sistema di firma') == 'Tavoletta Wacom') {
756756
$img->brightness((float)setting('Luminosità firma Wacom'));
@@ -835,9 +835,10 @@
835835

836836
$data = explode(',', post('firma_base64'));
837837

838-
$manager = ImageManager::gd();
839-
$img = $manager->read(base64_decode($data[1]));
840-
$img->scale(680, 202);
838+
$img = getImageManager()->read(base64_decode($data[1]));
839+
$img->resize(680, 202, function ($constraint) {
840+
$constraint->aspectRatio();
841+
});
841842

842843
if (!$img->save(base_dir().'/files/interventi/'.$firma_file)) {
843844
flash()->error(tr('Impossibile creare il file!'));

modules/interventi/src/Intervento.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ class Intervento extends Document
4141

4242
protected $info = [];
4343

44-
protected $dates = [
45-
'data_richiesta',
46-
'data_scadenza',
44+
protected $casts = [
45+
'data_richiesta' => 'date',
46+
'data_scadenza' => 'date',
4747
];
4848

4949
protected static $translated_fields = [];

modules/preventivi/src/Preventivo.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ class Preventivo extends Document
4949
*
5050
* @var array
5151
*/
52-
protected $dates = [
53-
'data_bozza',
54-
'data_conclusione',
55-
'data_accettazione',
56-
'data_rifiuto',
52+
protected $casts = [
53+
'data_bozza' => 'date',
54+
'data_conclusione' => 'date',
55+
'data_accettazione' => 'date',
56+
'data_rifiuto' => 'date',
5757
];
5858

5959
protected $info = [];

modules/scadenzario/src/Scadenza.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class Scadenza extends Model
3232

3333
protected $table = 'co_scadenziario';
3434

35-
protected $dates = [
36-
'scadenza',
37-
'data_pagamento',
35+
protected $casts = [
36+
'scadenza' => 'date',
37+
'data_pagamento' => 'date',
3838
];
3939

4040
public static function build($idanagrafica = null, $descrizione = null, $importo = null, $data_scadenza = null, $id_pagamento = null, $id_banca_azienda = null, $id_banca_controparte = null, $type = 'fattura', $is_pagato = false)

0 commit comments

Comments
 (0)