Skip to content

Commit d52a63e

Browse files
committed
clean code
1 parent 8b2401e commit d52a63e

File tree

4,914 files changed

+69
-646223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,914 files changed

+69
-646223
lines changed

.gitignore

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,21 @@
1-
# Generated binaries
2-
/build/*.zip
3-
/bin/*.zip
4-
/bin
5-
# Doxygen generated documentation
6-
/build/doxygen/doxygen_warnings.log
7-
/doc/code/doxygen
8-
# Composer managed dependencies
9-
/vendor
10-
/dev/bin
11-
# PHPdocumentor generated files
12-
/build/phpdoc
13-
/doc/code/phpdoc
14-
# Sphinx generated files
15-
/doc/user/build
16-
/.settings/
17-
/.buildpath
18-
/.project
19-
# Other
20-
*.back
21-
/.editorconfig
22-
/.gitattributes
1+
# Generated binaries
2+
/build/*.zip
3+
/bin/*.zip
4+
/bin
5+
# Doxygen generated documentation
6+
/build/doxygen/doxygen_warnings.log
7+
/doc/code/doxygen
8+
# Composer managed dependencies
9+
/vendor
10+
/dev/bin
11+
# PHPdocumentor generated files
12+
/build/phpdoc
13+
/doc/code/phpdoc
14+
# Sphinx generated files
15+
/doc/user/build
16+
/.settings/
17+
/.buildpath
18+
/.project
19+
# Other
20+
*.back
21+
/.gitattributes

core/modules/commande/doc/doc_easydoc_order_html.modules.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function __construct($db)
5858
global $langs, $mysoc;
5959

6060
// Load translation files required by the page
61-
$langs->loadLangs(array("main", "companies"));
61+
$langs->loadLangs(["main", "companies"]);
6262

6363
$this->db = $db;
6464
$this->name = "HTML templates";
@@ -72,7 +72,7 @@ public function __construct($db)
7272
$this->type = 'html';
7373
$this->page_largeur = 0;
7474
$this->page_hauteur = 0;
75-
$this->format = array($this->page_largeur, $this->page_hauteur);
75+
$this->format = [$this->page_largeur, $this->page_hauteur];
7676
$this->marge_gauche = 0;
7777
$this->marge_droite = 0;
7878
$this->marge_haute = 0;
@@ -107,7 +107,7 @@ public function info($langs)
107107
global $conf, $langs;
108108

109109
// Load translation files required by the page
110-
$langs->loadLangs(array("errors", "companies", "easydocgenerator@easydocgenerator"));
110+
$langs->loadLangs(["errors", "companies", "easydocgenerator@easydocgenerator"]);
111111

112112
$form = new Form($this->db);
113113

@@ -123,7 +123,7 @@ public function info($langs)
123123
$text .= '<tr><td>';
124124
$texttitle = $langs->trans("ListOfDirectoriesForHtmlTemplates");
125125
$listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->ORDER_ADDON_EASYDOC_HTM_PATH)));
126-
$listoffiles = array();
126+
$listoffiles = [];
127127
foreach ($listofdir as $key => $tmpdir) {
128128
$tmpdir = trim($tmpdir);
129129
$tmpdir = preg_replace('/DOL_DATA_ROOT/', DOL_DATA_ROOT, $tmpdir);
@@ -225,7 +225,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
225225
include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php';
226226
$hookmanager = new HookManager($this->db);
227227
}
228-
$hookmanager->initHooks(array('odtgeneration'));
228+
$hookmanager->initHooks(['odtgeneration']);
229229
global $action;
230230

231231
if (!is_object($outputlangs)) {
@@ -241,7 +241,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
241241
$outputlangs->charset_output = 'ISO-8859-1';
242242
}
243243

244-
$outputlangs->loadLangs(array("main", "dict", "companies", "bills", "products", "orders", "deliveries"));
244+
$outputlangs->loadLangs(["main", "dict", "companies", "bills", "products", "orders", "deliveries"]);
245245
$currency = !empty($currency) ? $currency : $conf->currency;
246246

247247
require dol_buildpath('easydocgenerator/vendor/autoload.php');
@@ -262,7 +262,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
262262
$logo = $logodir . '/logos/' . $this->emetteur->logo;
263263
}
264264
}
265-
$langtocountryflag = array(
265+
$langtocountryflag = [
266266
'ar_AR' => '',
267267
'ca_ES' => 'catalonia',
268268
'da_DA' => 'dk',
@@ -276,7 +276,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
276276
'MF' => 'unknown',
277277
'BL' => 'unknown',
278278
'SX' => 'unknown'
279-
);
279+
];
280280

281281
if (isset($langtocountryflag[$mysoc->country_code])) {
282282
$flagImage = $langtocountryflag[$mysoc->country_code];
@@ -400,7 +400,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
400400
'margin_header' => 10,
401401
'margin_footer' => 10
402402
]);
403-
$mpdf->SetProtection(array('print'));
403+
$mpdf->SetProtection(['print']);
404404
$mpdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
405405
$mpdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
406406
$mpdf->SetWatermarkText(getDolGlobalString('COMMANDE_DRAFT_WATERMARK'));
@@ -430,7 +430,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
430430

431431
$mpdf->Output($file, \Mpdf\Output\Destination::FILE);
432432

433-
$this->result = array('fullpath' => $file);
433+
$this->result = ['fullpath' => $file];
434434

435435
return 1;
436436

@@ -520,16 +520,16 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
520520
}
521521

522522
// Make substitution
523-
$substitutionarray = array(
523+
$substitutionarray = [
524524
'__FROM_NAME__' => $this->emetteur->name,
525525
'__FROM_EMAIL__' => $this->emetteur->email,
526526
'__TOTAL_TTC__' => $object->total_ttc,
527527
'__TOTAL_HT__' => $object->total_ht,
528528
'__TOTAL_VAT__' => $object->total_tva
529-
);
529+
];
530530
complete_substitutions_array($substitutionarray, $langs, $object);
531531
// Call the ODTSubstitution hook
532-
$parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray);
532+
$parameters = ['file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$substitutionarray];
533533
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
534534

535535
// Line of free text
@@ -544,12 +544,12 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
544544
try {
545545
$odfHandler = new Odf(
546546
$srctemplatepath,
547-
array(
547+
[
548548
'PATH_TO_TMP' => $conf->commande->dir_temp,
549549
'ZIP_PROXY' => 'PclZipProxy', // PhpZipProxy or PclZipProxy. Got "bad compression method" error when using PhpZipProxy.
550550
'DELIMITER_LEFT' => '{',
551551
'DELIMITER_RIGHT' => '}'
552-
)
552+
]
553553
);
554554
} catch (Exception $e) {
555555
$this->error = $e->getMessage();
@@ -579,7 +579,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
579579
$array_thirdparty = $this->get_substitutionarray_thirdparty($socobject, $outputlangs);
580580
$array_other = $this->get_substitutionarray_other($outputlangs);
581581
// retrieve contact information for use in object as contact_xxx tags
582-
$array_thirdparty_contact = array();
582+
$array_thirdparty_contact = [];
583583

584584
if ($usecontact && is_object($contactobject)) {
585585
$array_thirdparty_contact = $this->get_substitutionarray_contact($contactobject, $outputlangs, 'contact');
@@ -589,7 +589,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
589589
complete_substitutions_array($tmparray, $outputlangs, $object);
590590

591591
// Call the ODTSubstitution hook
592-
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
592+
$parameters = ['odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray];
593593
$reshook = $hookmanager->executeHooks('ODTSubstitution', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
594594

595595
foreach ($tmparray as $key => $value) {
@@ -627,7 +627,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
627627
$tmparray = $this->get_substitutionarray_lines($line, $outputlangs, $linenumber);
628628
complete_substitutions_array($tmparray, $outputlangs, $object, $line, "completesubstitutionarray_lines");
629629
// Call the ODTSubstitutionLine hook
630-
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray, 'line' => $line);
630+
$parameters = ['odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray, 'line' => $line];
631631
$reshook = $hookmanager->executeHooks('ODTSubstitutionLine', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
632632
foreach ($tmparray as $key => $val) {
633633
try {
@@ -659,7 +659,7 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
659659
}
660660

661661
// Call the beforeODTSave hook
662-
$parameters = array('odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray);
662+
$parameters = ['odfHandler' => &$odfHandler, 'file' => $file, 'object' => $object, 'outputlangs' => $outputlangs, 'substitutionarray' => &$tmparray];
663663
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
664664

665665
// Write new file
@@ -672,21 +672,21 @@ public function write_file($object, $outputlangs, $srctemplatepath, $hidedetails
672672
}
673673

674674

675-
$parameters = array(
675+
$parameters = [
676676
'odfHandler' => &$odfHandler,
677677
'file' => $file,
678678
'object' => $object,
679679
'outputlangs' => $outputlangs,
680680
'substitutionarray' => &$tmparray
681-
);
681+
];
682682
// Note that $action and $object may have been modified by some hooks
683683
$reshook = $hookmanager->executeHooks('afterODTCreation', $parameters, $this, $action);
684684

685685
dolChmod($file);
686686

687687
$odfHandler = null; // Destroy object
688688

689-
$this->result = array('fullpath' => $file);
689+
$this->result = ['fullpath' => $file];
690690

691691
return 1; // Success
692692
} else {

0 commit comments

Comments
 (0)