Completed
Branch develop (c3c152)
by
unknown
24:51
created
dev/tools/phan/config.php 1 patch
Spacing   +70 added lines, -70 removed lines patch added patch discarded remove patch
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 	'bom' => 'Bom',
80 80
 	'bookcal' => 'BookCal',
81 81
 	'bookmark' => 'Bookmark',
82
-	'cashdesk' => null,  // TODO: fill in proper class
82
+	'cashdesk' => null, // TODO: fill in proper class
83 83
 	'category' => 'Categorie',
84 84
 	'clicktodial' => 'ClickToDial',
85 85
 	'collab' => 'Collab',
86 86
 	'comptabilite' => 'Comptabilite',
87
-	'contact' => null,  // TODO: fill in proper class
87
+	'contact' => null, // TODO: fill in proper class
88 88
 	'contract' => 'Contrat',
89 89
 	'cron' => 'Cron',
90 90
 	'datapolicy' => 'DataPolicy',
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 	'don' => 'Don',
97 97
 	'dynamicprices' => 'DynamicPrices',
98 98
 	'ecm' => 'ECM',
99
-	'ecotax' => null,  // TODO: External module ?
99
+	'ecotax' => null, // TODO: External module ?
100 100
 	'emailcollector' => 'EmailCollector',
101 101
 	'eventorganization' => 'EventOrganization',
102 102
 	'expensereport' => 'ExpenseReport',
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 	'fournisseur' => 'Fournisseur',
108 108
 	'ftp' => 'FTP',
109 109
 	'geoipmaxmind' => 'GeoIPMaxmind',
110
-	'google' => null,  // External ?
110
+	'google' => null, // External ?
111 111
 	'gravatar' => 'Gravatar',
112 112
 	'holiday' => 'Holiday',
113 113
 	'hrm' => 'HRM',
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	'ldap' => 'Ldap',
122 122
 	'loan' => 'Loan',
123 123
 	'mailing' => 'Mailing',
124
-	'mailman' => null,  // Same module as mailmanspip -> MailmanSpip ??
124
+	'mailman' => null, // Same module as mailmanspip -> MailmanSpip ??
125 125
 	'mailmanspip' => 'MailmanSpip',
126 126
 	'margin' => 'Margin',
127 127
 	'member' => 'Adherent',
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 	'notification' => 'Notification',
135 135
 	'numberwords' => null, // Not provided by default, no module tests
136 136
 	'oauth' => 'OAuth',
137
-	'openstreetmap' => null,  // External module?
137
+	'openstreetmap' => null, // External module?
138 138
 	'opensurvey' => 'OpenSurvey',
139 139
 	'order' => 'Commande',
140 140
 	'partnership' => 'Partnership',
@@ -161,8 +161,8 @@  discard block
 block discarded – undo
161 161
 	'stock' => 'Stock',
162 162
 	'stocktransfer' => 'StockTransfer',
163 163
 	'stripe' => 'Stripe',
164
-	'supplier_invoice' => null,  // Special case, uses invoice
165
-	'supplier_order' => null,  // Special case, uses invoice
164
+	'supplier_invoice' => null, // Special case, uses invoice
165
+	'supplier_order' => null, // Special case, uses invoice
166 166
 	'supplier_proposal' => 'SupplierProposal',
167 167
 	'syslog' => 'Syslog',
168 168
 	'takepos' => 'TakePos',
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 	//	'processes' => 6,
225 225
 	'backward_compatibility_checks' => false,
226 226
 	'simplify_ast' => true,
227
-	'analyzed_file_extensions' => ['php','inc'],
227
+	'analyzed_file_extensions' => ['php', 'inc'],
228 228
 	'globals_type_map' => [
229 229
 		'_Avery_Labels' => 'array<string,array{name:string,paper-size:string|array{0:float,1:float},orientation:string,metric:string,marginLeft:float,marginTop:float,NX:int,NY:int,SpaceX:float,SpaceY:float,width:float,height:float,font-size:float,custom_x:float,custom_y:float}>',
230 230
 		'action' => 'string',
@@ -283,7 +283,7 @@  discard block
 block discarded – undo
283 283
 		'shmkeys' => 'array<string,int>', // memory.lib
284 284
 		'shmoffset' => 'int', // memory.lib
285 285
 		'user' => '\User',
286
-		'website' => 'string',  // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334  // Disable because Phan infers Website type
286
+		'website' => 'string', // See discussion https://github.com/Dolibarr/dolibarr/pull/28891#issuecomment-2002268334  // Disable because Phan infers Website type
287 287
 		'websitepage' => '\WebSitePage',
288 288
 		'websitepagefile' => 'string',
289 289
 		// 'object' => '\CommonObject',  // Deprecated, not enabled because conflicts with $object assignments
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
 	'directory_list' => [
309 309
 		'htdocs',
310 310
 		'scripts',
311
-		PHAN_DIR . '/stubs',
311
+		PHAN_DIR.'/stubs',
312 312
 	],
313 313
 
314 314
 	// A directory list that defines files that will be excluded
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
 		'htdocs/includes/',
327 327
 		'htdocs/install/doctemplates/websites/',
328 328
 		'htdocs/core/class/lessc.class.php', // External library
329
-		PHAN_DIR . '/stubs/',
329
+		PHAN_DIR.'/stubs/',
330 330
 	],
331 331
 	//'exclude_file_regex' => '@^vendor/.*/(tests?|Tests?)/@',
332 332
 	'exclude_file_regex' => '@^('  // @phpstan-ignore-line
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
 		.'|htdocs/includes/stripe/.*'  // @phpstan-ignore-line
345 345
 		.'|htdocs/conf/conf.php'  // @phpstan-ignore-line
346 346
 		// .'|htdocs/[^h].*/.*'  // For testing @phpstan-ignore-line
347
-		.')@',  // @phpstan-ignore-line
347
+		.')@', // @phpstan-ignore-line
348 348
 
349 349
 	// A list of plugin files to execute.
350 350
 	// Plugins which are bundled with Phan can be added here by providing their name
@@ -360,14 +360,14 @@  discard block
 block discarded – undo
360 360
 		'/^isModEnabled$/' => [0, $moduleNameRegex, 'UnknownModuleName'],
361 361
 		// Note: trick to have different key for same regex:
362 362
 		'/^isModEnable[d]$/' => [0, $deprecatedModuleNameRegex, "DeprecatedModuleName"],
363
-		'/^sanitizeVal$/' => [1, $sanitizeRegex,"UnknownSanitizeType"],
364
-		'/^checkVal$/' => [1, $sanitizeRegex,"UnknownCheckValSanitizeType"],
365
-		'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex,"UnknownExtrafieldTypeBack"],
366
-		'/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}',"InvalidDolNowArgument"],
367
-		'/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}',"InvalidDolMktimeArgument"],  // '', 0, 1 match bool and int values
368
-		'/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}',"InvalidDolMktimeArgument"],  // '', 0, 1 match bool and int values
369
-		'/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidGetPostFloatRounding"],
370
-		'/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}',"InvalidPrice2NumRounding"],
363
+		'/^sanitizeVal$/' => [1, $sanitizeRegex, "UnknownSanitizeType"],
364
+		'/^checkVal$/' => [1, $sanitizeRegex, "UnknownCheckValSanitizeType"],
365
+		'/^\\\\ExtraFields::addExtraField$/' => [2, $extraFieldTypeRegex, "UnknownExtrafieldTypeBack"],
366
+		'/^dol_now$/' => [0, '{^(?:auto|gmt|tz(?:server|ref|user(?:rel)?))$}', "InvalidDolNowArgument"],
367
+		'/^dol_mktime$/' => [6, '{^(?:|0|1|auto|gmt|tz(?:server|ref|user(?:rel)?|,[+a-zA-Z-/]+))$}', "InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values
368
+		'/^dol_print_date$/' => [2, '{^(?:|0|1|auto|gmt|tz(?:server|user(?:rel)?))$}', "InvalidDolMktimeArgument"], // '', 0, 1 match bool and int values
369
+		'/^GETPOSTFLOAT$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}', "InvalidGetPostFloatRounding"],
370
+		'/^price2num$/' => [1, '{^(?:|M[UTS]|C[UT]|\d+)$}', "InvalidPrice2NumRounding"],
371 371
 	],
372 372
 	'plugins' => [
373 373
 		__DIR__.'/plugins/NoVarDumpPlugin.php',
@@ -428,44 +428,44 @@  discard block
 block discarded – undo
428 428
 		// Dolibarr uses a lot of internal deprecated stuff, not reporting
429 429
 		'PhanDeprecatedProperty',
430 430
 
431
-		'PhanCompatibleNegativeStringOffset',	// return false positive
432
-		'PhanPluginConstantVariableBool',		// a lot of false positive, in most cases, we want to keep the code as it is
431
+		'PhanCompatibleNegativeStringOffset', // return false positive
432
+		'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
433 433
 		// 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
434
-		'PhanTypeArraySuspiciousNullable',	// About 440 occurrences
434
+		'PhanTypeArraySuspiciousNullable', // About 440 occurrences
435 435
 		// 'PhanTypeInvalidDimOffset',			// Helps identify missing array indexes in types or reference to unset indexes
436 436
 		'PhanTypeObjectUnsetDeclaredProperty',
437
-		'PhanTypePossiblyInvalidDimOffset',			// a lot of false positive, in most cases, we want to keep the code as it is
437
+		'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
438 438
 		// 'PhanPluginUnknownArrayFunctionReturnType',	// a lot of false positive, in most cases, we want to keep the code as it is
439 439
 
440
-		'PhanPluginWhitespaceTab',		// Dolibarr uses tabs
441
-		'PhanPluginCanUsePHP71Void',	// Dolibarr is maintaining 7.0 compatibility
442
-		'PhanPluginShortArray',			// Dolibarr uses array()
443
-		'PhanPluginShortArrayList',		// Dolibarr uses array()
440
+		'PhanPluginWhitespaceTab', // Dolibarr uses tabs
441
+		'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
442
+		'PhanPluginShortArray', // Dolibarr uses array()
443
+		'PhanPluginShortArrayList', // Dolibarr uses array()
444 444
 		// Fixers From PHPDocToRealTypesPlugin:
445
-		'PhanPluginCanUseParamType',			// Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
446
-		'PhanPluginCanUseReturnType',			// Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
447
-		'PhanPluginCanUseNullableParamType',	// Fixer - Report/Add nullable parameter types in the function definition
448
-		'PhanPluginCanUseNullableReturnType',	// Fixer - Report/Add nullable return types in the function definition
445
+		'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
446
+		'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
447
+		'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
448
+		'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
449 449
 
450
-		'PhanPluginNonBoolBranch',			// Not essential - 31240+ occurrences
451
-		'PhanPluginNumericalComparison',	// Not essential - 19870+ occurrences
450
+		'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
451
+		'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
452 452
 		// 'PhanTypeMismatchArgument',		// Can detect missing array keys, invalid types, objects being passed when scalar expected - Not all reported by phpstan - <=3800 cases (was: 12300+ before)
453
-		'PhanPluginNonBoolInLogicalArith',	// Not essential - 11040+ occurrences
454
-		'PhanPluginConstantVariableScalar',	// Not essential - 5180+ occurrences
453
+		'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
454
+		'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
455 455
 		'PhanPluginDuplicateAdjacentStatement',
456
-		'PhanPluginDuplicateConditionalTernaryDuplication',		// 2750+ occurrences
457
-		'PhanPluginDuplicateConditionalNullCoalescing',	// Not essential - 990+ occurrences
458
-		'PhanPluginRedundantAssignmentInGlobalScope',	// Not essential, a lot of false warning
459
-		'PhanPluginRedundantAssignment',				// Not essential, useless
460
-		'PhanPluginDuplicateCatchStatementBody',  // Requires PHP7.1 - 50+ occurrences
456
+		'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences
457
+		'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences
458
+		'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning
459
+		'PhanPluginRedundantAssignment', // Not essential, useless
460
+		'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences
461 461
 
462
-		'PhanPluginUnknownClosureReturnType',	// When we use closure (we must avoid), we do not have PHP doc
462
+		'PhanPluginUnknownClosureReturnType', // When we use closure (we must avoid), we do not have PHP doc
463 463
 
464 464
 		// 'PhanPluginUnknownArrayMethodParamType',	// All fixed
465 465
 		// 'PhanPluginUnknownArrayMethodReturnType',	// All fixed
466 466
 		// 'PhanUndeclaredGlobalVariable',			// Helps identify variables that are not set/defined - add '@phan-var-force TYPE $varname' in tpl or includes to help type the variable
467 467
 		// 'PhanPluginUnknownObjectMethodCall',	// False positive for some class. Is enabled in config_extended only.
468
-		'PhanTypeSuspiciousNonTraversableForeach',  // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code.
468
+		'PhanTypeSuspiciousNonTraversableForeach', // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code.
469 469
 	],
470 470
 	// You can put relative paths to internal stubs in this config option.
471 471
 	// Phan will continue using its detailed type annotations,
@@ -484,31 +484,31 @@  discard block
 block discarded – undo
484 484
 		//'xdebug'	=> 'vendor/phan/phan/.phan/internal_stubs/xdebug.phan_php',
485 485
 		//'memcached'  => PHAN_DIR . '/your_internal_stubs_folder_name/memcached.phan_php',
486 486
 		//'PDO'  => PHAN_DIR . '/stubs/PDO.phan_php',
487
-		'brotli'  => PHAN_DIR . '/stubs/brotli.phan_php',
488
-		'curl'  => PHAN_DIR . '/stubs/curl.phan_php',
489
-		'calendar'  => PHAN_DIR . '/stubs/calendar.phan_php',
490
-		'fileinfo'  => PHAN_DIR . '/stubs/fileinfo.phan_php',
491
-		'ftp'  => PHAN_DIR . '/stubs/ftp.phan_php',
492
-		'gd'  => PHAN_DIR . '/stubs/gd.phan_php',
493
-		'geoip'  => PHAN_DIR . '/stubs/geoip.phan_php',
494
-		'imagick'  => PHAN_DIR . '/stubs/imagick.phan_php',
495
-		'imap'  => PHAN_DIR . '/stubs/imap.phan_php',
496
-		'intl'  => PHAN_DIR . '/stubs/intl.phan_php',
497
-		'ldap'  => PHAN_DIR . '/stubs/ldap.phan_php',
498
-		'mcrypt'  => PHAN_DIR . '/stubs/mcrypt.phan_php',
499
-		'memcache'  => PHAN_DIR . '/stubs/memcache.phan_php',
500
-		'memcached' => PHAN_DIR . '/stubs/memcached.phan_php',
501
-		'mysqli'  => PHAN_DIR . '/stubs/mysqli.phan_php',
502
-		'pdo_cubrid'  => PHAN_DIR . '/stubs/pdo_cubrid.phan_php',
503
-		'pdo_mysql'  => PHAN_DIR . '/stubs/pdo_mysql.phan_php',
504
-		'pdo_pgsql'  => PHAN_DIR . '/stubs/pdo_pgsql.phan_php',
505
-		'pdo_sqlite'  => PHAN_DIR . '/stubs/pdo_sqlite.phan_php',
506
-		'pgsql'  => PHAN_DIR . '/stubs/pgsql.phan_php',
507
-		'session'  => PHAN_DIR . '/stubs/session.phan_php',
508
-		'simplexml'  => PHAN_DIR . '/stubs/SimpleXML.phan_php',
509
-		'soap'  => PHAN_DIR . '/stubs/soap.phan_php',
510
-		'sockets'  => PHAN_DIR . '/stubs/sockets.phan_php',
511
-		'tidy'  => PHAN_DIR . '/stubs/tidy.phan_php',
512
-		'zip'  => PHAN_DIR . '/stubs/zip.phan_php',
487
+		'brotli'  => PHAN_DIR.'/stubs/brotli.phan_php',
488
+		'curl'  => PHAN_DIR.'/stubs/curl.phan_php',
489
+		'calendar'  => PHAN_DIR.'/stubs/calendar.phan_php',
490
+		'fileinfo'  => PHAN_DIR.'/stubs/fileinfo.phan_php',
491
+		'ftp'  => PHAN_DIR.'/stubs/ftp.phan_php',
492
+		'gd'  => PHAN_DIR.'/stubs/gd.phan_php',
493
+		'geoip'  => PHAN_DIR.'/stubs/geoip.phan_php',
494
+		'imagick'  => PHAN_DIR.'/stubs/imagick.phan_php',
495
+		'imap'  => PHAN_DIR.'/stubs/imap.phan_php',
496
+		'intl'  => PHAN_DIR.'/stubs/intl.phan_php',
497
+		'ldap'  => PHAN_DIR.'/stubs/ldap.phan_php',
498
+		'mcrypt'  => PHAN_DIR.'/stubs/mcrypt.phan_php',
499
+		'memcache'  => PHAN_DIR.'/stubs/memcache.phan_php',
500
+		'memcached' => PHAN_DIR.'/stubs/memcached.phan_php',
501
+		'mysqli'  => PHAN_DIR.'/stubs/mysqli.phan_php',
502
+		'pdo_cubrid'  => PHAN_DIR.'/stubs/pdo_cubrid.phan_php',
503
+		'pdo_mysql'  => PHAN_DIR.'/stubs/pdo_mysql.phan_php',
504
+		'pdo_pgsql'  => PHAN_DIR.'/stubs/pdo_pgsql.phan_php',
505
+		'pdo_sqlite'  => PHAN_DIR.'/stubs/pdo_sqlite.phan_php',
506
+		'pgsql'  => PHAN_DIR.'/stubs/pgsql.phan_php',
507
+		'session'  => PHAN_DIR.'/stubs/session.phan_php',
508
+		'simplexml'  => PHAN_DIR.'/stubs/SimpleXML.phan_php',
509
+		'soap'  => PHAN_DIR.'/stubs/soap.phan_php',
510
+		'sockets'  => PHAN_DIR.'/stubs/sockets.phan_php',
511
+		'tidy'  => PHAN_DIR.'/stubs/tidy.phan_php',
512
+		'zip'  => PHAN_DIR.'/stubs/zip.phan_php',
513 513
 	],
514 514
 ];
Please login to merge, or discard this patch.
dev/tools/phan/config_extended.php 1 patch
Spacing   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -66,40 +66,40 @@
 block discarded – undo
66 66
 		// Dolibarr uses a lot of internal deprecated stuff, not reporting
67 67
 		'PhanDeprecatedProperty',
68 68
 
69
-		'PhanCompatibleNegativeStringOffset',	// return false positive
70
-		'PhanPluginConstantVariableBool',		// a lot of false positive, in most cases, we want to keep the code as it is
69
+		'PhanCompatibleNegativeStringOffset', // return false positive
70
+		'PhanPluginConstantVariableBool', // a lot of false positive, in most cases, we want to keep the code as it is
71 71
 		// 'PhanPluginUnknownArrayPropertyType', // Helps find missing array keys or mismatches, remaining occurrences are likely unused properties
72
-		'PhanTypeArraySuspiciousNullable',	// About 400 cases
72
+		'PhanTypeArraySuspiciousNullable', // About 400 cases
73 73
 		// 'PhanTypeInvalidDimOffset',			// Helps identify missing array indexes in types or reference to unset indexes
74 74
 		'PhanTypeObjectUnsetDeclaredProperty',
75
-		'PhanTypePossiblyInvalidDimOffset',		// a lot of false positive, in most cases, we want to keep the code as it is
76
-		'PhanPluginUnknownArrayFunctionReturnType',	// a lot of false positive, in most cases, we want to keep the code as it is
75
+		'PhanTypePossiblyInvalidDimOffset', // a lot of false positive, in most cases, we want to keep the code as it is
76
+		'PhanPluginUnknownArrayFunctionReturnType', // a lot of false positive, in most cases, we want to keep the code as it is
77 77
 
78
-		'PhanPluginWhitespaceTab',		// Dolibarr used tabs
79
-		'PhanPluginCanUsePHP71Void',	// Dolibarr is maintaining 7.0 compatibility
80
-		'PhanPluginShortArray',			// Dolibarr uses array()
81
-		'PhanPluginShortArrayList',		// Dolibarr uses array()
78
+		'PhanPluginWhitespaceTab', // Dolibarr used tabs
79
+		'PhanPluginCanUsePHP71Void', // Dolibarr is maintaining 7.0 compatibility
80
+		'PhanPluginShortArray', // Dolibarr uses array()
81
+		'PhanPluginShortArrayList', // Dolibarr uses array()
82 82
 		// Fixers From PHPDocToRealTypesPlugin:
83
-		'PhanPluginCanUseParamType',			// Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
84
-		'PhanPluginCanUseReturnType',			// Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
85
-		'PhanPluginCanUseNullableParamType',	// Fixer - Report/Add nullable parameter types in the function definition
86
-		'PhanPluginCanUseNullableReturnType',	// Fixer - Report/Add nullable return types in the function definition
83
+		'PhanPluginCanUseParamType', // Fixer - Report/Add types in the function definition (function abc(string $var) (adds string)
84
+		'PhanPluginCanUseReturnType', // Fixer - Report/Add return types in the function definition (function abc(string $var) (adds string)
85
+		'PhanPluginCanUseNullableParamType', // Fixer - Report/Add nullable parameter types in the function definition
86
+		'PhanPluginCanUseNullableReturnType', // Fixer - Report/Add nullable return types in the function definition
87 87
 
88
-		'PhanPluginNonBoolBranch',			// Not essential - 31240+ occurrences
89
-		'PhanPluginNumericalComparison',	// Not essential - 19870+ occurrences
90
-		'PhanTypeMismatchArgument',			// Not showing in cti.dolibarr until low count - Can detect missing array keys, invalid types, objects being passed when scalar expected - Not all reported by phpstan - <=1200 cases (was: 12300+ before)
91
-		'PhanPluginNonBoolInLogicalArith',	// Not essential - 11040+ occurrences
92
-		'PhanPluginConstantVariableScalar',	// Not essential - 5180+ occurrences
88
+		'PhanPluginNonBoolBranch', // Not essential - 31240+ occurrences
89
+		'PhanPluginNumericalComparison', // Not essential - 19870+ occurrences
90
+		'PhanTypeMismatchArgument', // Not showing in cti.dolibarr until low count - Can detect missing array keys, invalid types, objects being passed when scalar expected - Not all reported by phpstan - <=1200 cases (was: 12300+ before)
91
+		'PhanPluginNonBoolInLogicalArith', // Not essential - 11040+ occurrences
92
+		'PhanPluginConstantVariableScalar', // Not essential - 5180+ occurrences
93 93
 		'PhanPluginDuplicateAdjacentStatement',
94
-		'PhanPluginDuplicateConditionalTernaryDuplication',		// 2750+ occurrences
95
-		'PhanPluginDuplicateConditionalNullCoalescing',	// Not essential - 990+ occurrences
96
-		'PhanPluginRedundantAssignmentInGlobalScope',	// Not essential, a lot of false warning
97
-		'PhanPluginRedundantAssignment',				// Not essential, useless
98
-		'PhanPluginDuplicateCatchStatementBody',  // Requires PHP7.1 - 50+ occurrences
94
+		'PhanPluginDuplicateConditionalTernaryDuplication', // 2750+ occurrences
95
+		'PhanPluginDuplicateConditionalNullCoalescing', // Not essential - 990+ occurrences
96
+		'PhanPluginRedundantAssignmentInGlobalScope', // Not essential, a lot of false warning
97
+		'PhanPluginRedundantAssignment', // Not essential, useless
98
+		'PhanPluginDuplicateCatchStatementBody', // Requires PHP7.1 - 50+ occurrences
99 99
 
100 100
 		// 'PhanPluginUnknownArrayMethodParamType',	// All fixed
101 101
 		// 'PhanPluginUnknownArrayMethodReturnType',	// All fixed
102
-		'PhanTypeSuspiciousNonTraversableForeach',  // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code.
102
+		'PhanTypeSuspiciousNonTraversableForeach', // Reports on `foreach ($object as $key => $value)` which works without php notices, so we ignore it because this is intentional in the code.
103 103
 ];
104 104
 
105 105
 return $config;
Please login to merge, or discard this patch.
htdocs/societe/class/api_thirdparties.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 
156 156
 		$sql = "SELECT t.rowid";
157 157
 		$sql .= " FROM ".MAIN_DB_PREFIX."societe as t";
158
-		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields AS ef ON ef.fk_object = t.rowid";	// So we will be able to filter on extrafields
158
+		$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_extrafields AS ef ON ef.fk_object = t.rowid"; // So we will be able to filter on extrafields
159 159
 		if ($category > 0) {
160 160
 			if ($mode != 4) {
161 161
 				$sql .= ", ".MAIN_DB_PREFIX."categorie_societe as c";
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 		if (!DolibarrApi::_checkAccessToResource('societe', $this->company->id)) {
432 432
 			throw new RestException(403, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
433 433
 		}
434
-		$this->company->oldcopy = clone $this->company;  // @phan-suppress-current-line PhanTypeMismatchProperty
434
+		$this->company->oldcopy = clone $this->company; // @phan-suppress-current-line PhanTypeMismatchProperty
435 435
 
436 436
 		$res = $this->company->delete($id);
437 437
 		if ($res < 0) {
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 		}
481 481
 
482 482
 		if ($priceLevel < 1 || $priceLevel > getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT')) {
483
-			throw new RestException(400, 'Price level must be between 1 and ' . getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'));
483
+			throw new RestException(400, 'Price level must be between 1 and '.getDolGlobalString('PRODUIT_MULTIPRICES_LIMIT'));
484 484
 		}
485 485
 
486 486
 		if (!DolibarrApiAccess::$user->hasRight('societe', 'creer')) {
Please login to merge, or discard this patch.
htdocs/product/class/product.class.php 1 patch
Spacing   +65 added lines, -65 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
 	/**
151 151
 	 * @var string
152 152
 	 */
153
-	public $price_formated;			// used by takepos/ajax/ajax.php
153
+	public $price_formated; // used by takepos/ajax/ajax.php
154 154
 
155 155
 	/**
156 156
 	 * Selling price with tax
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 	/**
163 163
 	 * @var string
164 164
 	 */
165
-	public $price_ttc_formated;		// used by takepos/ajax/ajax.php
165
+	public $price_ttc_formated; // used by takepos/ajax/ajax.php
166 166
 
167 167
 	/**
168 168
 	 * Minimum price net
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 	/**
512 512
 	 * @var ?int
513 513
 	 */
514
-	public $weight_units;	// scale -3, 0, 3, 6
514
+	public $weight_units; // scale -3, 0, 3, 6
515 515
 	/**
516 516
 	 * @var float|string
517 517
 	 */
@@ -519,7 +519,7 @@  discard block
 block discarded – undo
519 519
 	/**
520 520
 	 * @var ?int
521 521
 	 */
522
-	public $length_units;	// scale -3, 0, 3, 6
522
+	public $length_units; // scale -3, 0, 3, 6
523 523
 	/**
524 524
 	 * @var float|string
525 525
 	 */
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
 	/**
528 528
 	 * @var ?int
529 529
 	 */
530
-	public $width_units;	// scale -3, 0, 3, 6
530
+	public $width_units; // scale -3, 0, 3, 6
531 531
 	/**
532 532
 	 * @var float|string|null
533 533
 	 */
@@ -535,7 +535,7 @@  discard block
 block discarded – undo
535 535
 	/**
536 536
 	 * @var ?int
537 537
 	 */
538
-	public $height_units;	// scale -3, 0, 3, 6
538
+	public $height_units; // scale -3, 0, 3, 6
539 539
 	/**
540 540
 	 * @var float|string|null
541 541
 	 */
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 	/**
544 544
 	 * @var ?int
545 545
 	 */
546
-	public $surface_units;	// scale -3, 0, 3, 6
546
+	public $surface_units; // scale -3, 0, 3, 6
547 547
 	/**
548 548
 	 * @var float|string|null
549 549
 	 */
@@ -551,7 +551,7 @@  discard block
 block discarded – undo
551 551
 	/**
552 552
 	 * @var ?int
553 553
 	 */
554
-	public $volume_units;	// scale -3, 0, 3, 6
554
+	public $volume_units; // scale -3, 0, 3, 6
555 555
 
556 556
 	/**
557 557
 	 * @var float|string|null
@@ -560,7 +560,7 @@  discard block
 block discarded – undo
560 560
 	/**
561 561
 	 * @var ?int
562 562
 	 */
563
-	public $net_measure_units;	// scale -3, 0, 3, 6
563
+	public $net_measure_units; // scale -3, 0, 3, 6
564 564
 
565 565
 	/**
566 566
 	 * @var string
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
 		'import_key'    => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => 1, 'visible' => -2, 'notnull' => -1, 'index' => 0, 'position' => 1000),
876 876
 		//'tosell'       =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
877 877
 		//'tobuy'        =>array('type'=>'integer',      'label'=>'Status',           'enabled'=>1, 'visible'=>1,  'notnull'=>1, 'default'=>'0', 'index'=>1,  'position'=>1000, 'arrayofkeyval'=>array(0=>'Draft', 1=>'Active', -1=>'Cancel')),
878
-		'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1,  'notnull' => 1, 'default' => '0', 'index' => 1,  'position' => 1000),
878
+		'mandatory_period' => array('type' => 'integer', 'label' => 'mandatoryperiod', 'enabled' => 1, 'visible' => -1, 'notnull' => 1, 'default' => '0', 'index' => 1, 'position' => 1000),
879 879
 	);
880 880
 
881 881
 	/**
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 					$sql .= ", batch_mask";
1122 1122
 					$sql .= ", fk_unit";
1123 1123
 					$sql .= ", mandatory_period";
1124
-					if (!empty($this->default_vat_code)) $sql.=", default_vat_code";
1124
+					if (!empty($this->default_vat_code)) $sql .= ", default_vat_code";
1125 1125
 					$sql .= ") VALUES (";
1126 1126
 					$sql .= "'".$this->db->idate($this->date_creation)."'";
1127 1127
 					$sql .= ", ".(!empty($this->entity) ? (int) $this->entity : (int) $conf->entity);
@@ -1153,7 +1153,7 @@  discard block
 block discarded – undo
1153 1153
 					$sql .= ", '".$this->db->escape($this->batch_mask)."'";
1154 1154
 					$sql .= ", ".($this->fk_unit > 0 ? ((int) $this->fk_unit) : 'NULL');
1155 1155
 					$sql .= ", '".$this->db->escape((string) $this->mandatory_period)."'";
1156
-					if (!empty($this->default_vat_code)) $sql.=", '".$this->db->escape($this->default_vat_code)."'";
1156
+					if (!empty($this->default_vat_code)) $sql .= ", '".$this->db->escape($this->default_vat_code)."'";
1157 1157
 					$sql .= ")";
1158 1158
 					dol_syslog(get_class($this)."::Create", LOG_DEBUG);
1159 1159
 
@@ -1180,9 +1180,9 @@  discard block
 block discarded – undo
1180 1180
 
1181 1181
 							// update accountancy for this entity
1182 1182
 							if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1183
-								$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " .((int) $this->id) . " AND entity = " . ((int) $conf->entity));
1183
+								$this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
1184 1184
 
1185
-								$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
1185
+								$sql = "INSERT INTO ".$this->db->prefix()."product_perentity (";
1186 1186
 								$sql .= " fk_product";
1187 1187
 								$sql .= ", entity";
1188 1188
 								$sql .= ", accountancy_code_buy";
@@ -1193,13 +1193,13 @@  discard block
 block discarded – undo
1193 1193
 								$sql .= ", accountancy_code_sell_export";
1194 1194
 								$sql .= ") VALUES (";
1195 1195
 								$sql .= $this->id;
1196
-								$sql .= ", " . ((int) $conf->entity);
1197
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
1198
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1199
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1200
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
1201
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1202
-								$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1196
+								$sql .= ", ".((int) $conf->entity);
1197
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
1198
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1199
+								$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
1200
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
1201
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1202
+								$sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'";
1203 1203
 								$sql .= ")";
1204 1204
 								$result = $this->db->query($sql);
1205 1205
 								if (!$result) {
@@ -1583,12 +1583,12 @@  discard block
 block discarded – undo
1583 1583
 			$sql .= ", note_public = ".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : 'null');
1584 1584
 			$sql .= ", duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."'";
1585 1585
 			if (!getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1586
-				$sql .= ", accountancy_code_buy = '" . $this->db->escape($this->accountancy_code_buy) . "'";
1587
-				$sql .= ", accountancy_code_buy_intra = '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1588
-				$sql .= ", accountancy_code_buy_export = '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1589
-				$sql .= ", accountancy_code_sell= '" . $this->db->escape($this->accountancy_code_sell) . "'";
1590
-				$sql .= ", accountancy_code_sell_intra= '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1591
-				$sql .= ", accountancy_code_sell_export= '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1586
+				$sql .= ", accountancy_code_buy = '".$this->db->escape($this->accountancy_code_buy)."'";
1587
+				$sql .= ", accountancy_code_buy_intra = '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1588
+				$sql .= ", accountancy_code_buy_export = '".$this->db->escape($this->accountancy_code_buy_export)."'";
1589
+				$sql .= ", accountancy_code_sell= '".$this->db->escape($this->accountancy_code_sell)."'";
1590
+				$sql .= ", accountancy_code_sell_intra= '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1591
+				$sql .= ", accountancy_code_sell_export= '".$this->db->escape($this->accountancy_code_sell_export)."'";
1592 1592
 			}
1593 1593
 			$sql .= ", desiredstock = ".((isset($this->desiredstock) && is_numeric($this->desiredstock)) ? (float) $this->desiredstock : "null");
1594 1594
 			$sql .= ", cost_price = ".($this->cost_price != '' ? ((float) $this->cost_price) : 'null');
@@ -1621,9 +1621,9 @@  discard block
 block discarded – undo
1621 1621
 
1622 1622
 				// update accountancy for this entity
1623 1623
 				if (!$error && getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED')) {
1624
-					$this->db->query("DELETE FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = " . ((int) $this->id) . " AND entity = " . ((int) $conf->entity));
1624
+					$this->db->query("DELETE FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $this->id)." AND entity = ".((int) $conf->entity));
1625 1625
 
1626
-					$sql = "INSERT INTO " . $this->db->prefix() . "product_perentity (";
1626
+					$sql = "INSERT INTO ".$this->db->prefix()."product_perentity (";
1627 1627
 					$sql .= " fk_product";
1628 1628
 					$sql .= ", entity";
1629 1629
 					$sql .= ", accountancy_code_buy";
@@ -1634,13 +1634,13 @@  discard block
 block discarded – undo
1634 1634
 					$sql .= ", accountancy_code_sell_export";
1635 1635
 					$sql .= ") VALUES (";
1636 1636
 					$sql .= ((int) $this->id);
1637
-					$sql .= ", " . ((int) $conf->entity);
1638
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy) . "'";
1639
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_intra) . "'";
1640
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_buy_export) . "'";
1641
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell) . "'";
1642
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_intra) . "'";
1643
-					$sql .= ", '" . $this->db->escape($this->accountancy_code_sell_export) . "'";
1637
+					$sql .= ", ".((int) $conf->entity);
1638
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy)."'";
1639
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy_intra)."'";
1640
+					$sql .= ", '".$this->db->escape($this->accountancy_code_buy_export)."'";
1641
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell)."'";
1642
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell_intra)."'";
1643
+					$sql .= ", '".$this->db->escape($this->accountancy_code_sell_export)."'";
1644 1644
 					$sql .= ")";
1645 1645
 					$result = $this->db->query($sql);
1646 1646
 					if (!$result) {
@@ -1718,7 +1718,7 @@  discard block
 block discarded – undo
1718 1718
 								$error++;
1719 1719
 							} else {
1720 1720
 								// to keep old entries with the new dir
1721
-								require_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
1721
+								require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
1722 1722
 								$ecmfiles = new EcmFiles($this->db);
1723 1723
 								$ecmfiles->updateAfterRename("produit/".dol_sanitizeFileName($this->oldcopy->ref), "produit/".dol_sanitizeFileName($this->ref));
1724 1724
 							}
@@ -2016,7 +2016,7 @@  discard block
 block discarded – undo
2016 2016
 				}
2017 2017
 			} elseif (isset($this->multilangs[$key])) {
2018 2018
 				if (empty($this->multilangs[$key]["label"])) {
2019
-					$this->errors[] = $key . ' : ' . $langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
2019
+					$this->errors[] = $key.' : '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label"));
2020 2020
 					return -1;
2021 2021
 				}
2022 2022
 
@@ -2214,7 +2214,7 @@  discard block
 block discarded – undo
2214 2214
 	 */
2215 2215
 	private function getArrayForPriceCompare($level = 0)
2216 2216
 	{
2217
-		$testExit = array('multiprices','multiprices_ttc','multiprices_base_type','multiprices_min','multiprices_min_ttc','multiprices_tva_tx','multiprices_recuperableonly');
2217
+		$testExit = array('multiprices', 'multiprices_ttc', 'multiprices_base_type', 'multiprices_min', 'multiprices_min_ttc', 'multiprices_tva_tx', 'multiprices_recuperableonly');
2218 2218
 
2219 2219
 		foreach ($testExit as $field) {
2220 2220
 			if (!isset($this->$field)) {
@@ -2365,7 +2365,7 @@  discard block
 block discarded – undo
2365 2365
 							$price_base_type = $custprice_line->price_base_type;
2366 2366
 							$tva_tx = $custprice_line->tva_tx;
2367 2367
 							if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
2368
-								$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
2368
+								$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
2369 2369
 							}
2370 2370
 							$tva_npr = $custprice_line->recuperableonly;
2371 2371
 							if (empty($tva_tx)) {
@@ -2431,7 +2431,7 @@  discard block
 block discarded – undo
2431 2431
 							$price_base_type = $custprice_line->price_base_type;
2432 2432
 							$tva_tx = $custprice_line->tva_tx;
2433 2433
 							if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
2434
-								$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
2434
+								$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
2435 2435
 							}
2436 2436
 							$tva_npr = $custprice_line->recuperableonly;
2437 2437
 							if (empty($tva_tx)) {
@@ -2916,12 +2916,12 @@  discard block
 block discarded – undo
2916 2916
 
2917 2917
 		// For MultiCompany
2918 2918
 		// PMP per entity & Stocks Sharings stock_reel includes only stocks shared with this entity
2919
-		$separatedEntityPMP = false;	// Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2920
-		$separatedStock = false;		// Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2919
+		$separatedEntityPMP = false; // Set to true to get the AWP from table llx_product_perentity instead of field 'pmp' into llx_product.
2920
+		$separatedStock = false; // Set to true will count stock from subtable llx_product_stock. It is slower than using denormalized field 'stock', but it is required when using multientity and shared warehouses.
2921 2921
 		$visibleWarehousesEntities = $conf->entity;
2922 2922
 		if (getDolGlobalString('MULTICOMPANY_PRODUCT_SHARING_ENABLED')) {
2923 2923
 			if (getDolGlobalString('MULTICOMPANY_PMP_PER_ENTITY_ENABLED')) {
2924
-				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM " . $this->db->prefix() . "product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
2924
+				$checkPMPPerEntity = $this->db->query("SELECT pmp FROM ".$this->db->prefix()."product_perentity WHERE fk_product = ".((int) $id)." AND entity = ".(int) $conf->entity);
2925 2925
 				if ($this->db->num_rows($checkPMPPerEntity) > 0) {
2926 2926
 					$separatedEntityPMP = true;
2927 2927
 				}
@@ -2929,7 +2929,7 @@  discard block
 block discarded – undo
2929 2929
 			global $mc;
2930 2930
 			$separatedStock = true;
2931 2931
 			if (isset($mc->sharings['stock']) && !empty($mc->sharings['stock'])) {
2932
-				$visibleWarehousesEntities .= "," . implode(",", $mc->sharings['stock']);
2932
+				$visibleWarehousesEntities .= ",".implode(",", $mc->sharings['stock']);
2933 2933
 			}
2934 2934
 		}
2935 2935
 		if ($separatedEntityPMP) {
@@ -2947,10 +2947,10 @@  discard block
 block discarded – undo
2947 2947
 		}
2948 2948
 		$sql .= " FROM ".$this->db->prefix()."product as p";
2949 2949
 		if (getDolGlobalString('MAIN_PRODUCT_PERENTITY_SHARED') || $separatedEntityPMP) {
2950
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = " . ((int) $conf->entity);
2950
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_perentity as ppe ON ppe.fk_product = p.rowid AND ppe.entity = ".((int) $conf->entity);
2951 2951
 		}
2952 2952
 		if ($separatedStock) {
2953
-			$sql .= " LEFT JOIN " . $this->db->prefix() . "product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))";
2953
+			$sql .= " LEFT JOIN ".$this->db->prefix()."product_stock as sp ON sp.fk_product = p.rowid AND sp.fk_entrepot IN (SELECT rowid FROM ".$this->db->prefix()."entrepot WHERE entity IN (".$this->db->sanitize($visibleWarehousesEntities)."))";
2954 2954
 		}
2955 2955
 
2956 2956
 		if ($id) {
@@ -3117,15 +3117,15 @@  discard block
 block discarded – undo
3117 3117
 						$sql .= " WHERE entity IN (".getEntity('productprice').")";
3118 3118
 						$sql .= " AND price_level=".((int) $i);
3119 3119
 						$sql .= " AND fk_product = ".((int) $this->id);
3120
-						$sql .= " ORDER BY date_price DESC, rowid DESC";	// Get the most recent line
3121
-						$sql .= " LIMIT 1";									// Only the first one
3120
+						$sql .= " ORDER BY date_price DESC, rowid DESC"; // Get the most recent line
3121
+						$sql .= " LIMIT 1"; // Only the first one
3122 3122
 						$resql = $this->db->query($sql);
3123 3123
 						if ($resql) {
3124 3124
 							$result = $this->db->fetch_array($resql);
3125 3125
 
3126 3126
 							$this->multiprices[$i] = $result ? $result["price"] : null;
3127 3127
 							$this->multiprices_ttc[$i] = $result ? $result["price_ttc"] : null;
3128
-							$this->multiprices_min[$i] =  $result ? $result["price_min"] : null;
3128
+							$this->multiprices_min[$i] = $result ? $result["price_min"] : null;
3129 3129
 							$this->multiprices_min_ttc[$i] = $result ? $result["price_min_ttc"] : null;
3130 3130
 							$this->multiprices_base_type[$i] = $result ? $result["price_base_type"] : null;
3131 3131
 							// Next two fields are used only if PRODUIT_MULTIPRICES_USE_VAT_PER_LEVEL is on
@@ -3350,7 +3350,7 @@  discard block
 block discarded – undo
3350 3350
 				$obj = $this->db->fetch_object($result);
3351 3351
 				$this->stats_mo['customers_'.$role] = $obj->nb_customers ? $obj->nb_customers : 0;
3352 3352
 				$this->stats_mo['nb_'.$role] = $obj->nb ? $obj->nb : 0;
3353
-				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0;		// qty may be a float due to the SUM()
3353
+				$this->stats_mo['qty_'.$role] = $obj->qty ? price2num($obj->qty, 'MS') : 0; // qty may be a float due to the SUM()
3354 3354
 			} else {
3355 3355
 				$this->error = $this->db->error();
3356 3356
 				$error++;
@@ -4873,7 +4873,7 @@  discard block
 block discarded – undo
4873 4873
 				//Addition of a product with the highest rank +1
4874 4874
 				$sql = "INSERT INTO ".$this->db->prefix()."product_association(fk_product_pere,fk_product_fils,qty,incdec,rang)";
4875 4875
 				$sql .= " VALUES (".((int) $id_pere).", ".((int) $id_fils).", ".price2num($qty, 'MS').", ".((int) $incdec).", ".((int) $rank).")";
4876
-				if (! $this->db->query($sql)) {
4876
+				if (!$this->db->query($sql)) {
4877 4877
 					dol_print_error($this->db);
4878 4878
 					return -1;
4879 4879
 				} else {
@@ -4994,7 +4994,7 @@  discard block
 block discarded – undo
4994 4994
 				$sql = "UPDATE ".$this->db->prefix()."product_association";
4995 4995
 				$sql .= " SET rang = ".((int) $cpt);
4996 4996
 				$sql .= " WHERE rowid = ".((int) $objrank->rowid);
4997
-				if (! $this->db->query($sql)) {
4997
+				if (!$this->db->query($sql)) {
4998 4998
 					dol_print_error($this->db);
4999 4999
 					return -1;
5000 5000
 				}
@@ -5434,7 +5434,7 @@  discard block
 block discarded – undo
5434 5434
 		if (isset($this->sousprods) && is_array($this->sousprods)) {
5435 5435
 			foreach ($this->sousprods as $prod_name => $desc_product) {
5436 5436
 				if (is_array($desc_product)) {
5437
-					$this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load);	// This set $this->res
5437
+					$this->fetch_prod_arbo($desc_product, "", $multiply, 1, $this->id, $ignore_stock_load); // This set $this->res
5438 5438
 				}
5439 5439
 			}
5440 5440
 		}
@@ -5589,7 +5589,7 @@  discard block
 block discarded – undo
5589 5589
 		$sql .= " AND pa.fk_product_fils <> ".((int) $id); // This should not happens, it is to avoid infinite loop if it happens
5590 5590
 		$sql .= " ORDER BY pa.rang";
5591 5591
 
5592
-		dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
5592
+		dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level.' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG);
5593 5593
 
5594 5594
 		// Protection against infinite loop
5595 5595
 		if ($level > 30) {
@@ -5652,7 +5652,7 @@  discard block
 block discarded – undo
5652 5652
 			$parent[$this->label][$keyChild] = $valueChild;
5653 5653
 		}
5654 5654
 		foreach ($parent as $key => $value) {        // key=label, value is array of children
5655
-			$this->sousprods[$key] = $value;  // @phan-suppress-current-line PhanTypeMismatchProperty
5655
+			$this->sousprods[$key] = $value; // @phan-suppress-current-line PhanTypeMismatchProperty
5656 5656
 		}
5657 5657
 	}
5658 5658
 
@@ -5688,7 +5688,7 @@  discard block
 block discarded – undo
5688 5688
 		if (!empty($this->entity) && $permissiontoreadproduct) {
5689 5689
 			$tmpphoto = $this->show_photos('product', $conf->product->multidir_output[$this->entity], 1, 1, 0, 0, 0, 80, 0, 0, 0, 0, '1');
5690 5690
 			if ($this->nbphoto > 0) {
5691
-				$datas['photo'] = '<div class="photointooltip floatright">'."\n" . $tmpphoto . '</div>';
5691
+				$datas['photo'] = '<div class="photointooltip floatright">'."\n".$tmpphoto.'</div>';
5692 5692
 			}
5693 5693
 		}
5694 5694
 
@@ -5698,7 +5698,7 @@  discard block
 block discarded – undo
5698 5698
 			$datas['picto'] = img_picto('', 'service').' <u class="paddingrightonly">'.$langs->trans("Service").'</u>';
5699 5699
 		}
5700 5700
 		if (isset($this->status) && isset($this->status_buy)) {
5701
-			$datas['status'] = ' '.$this->getLibStatut(5, 0) . ' '.$this->getLibStatut(5, 1);
5701
+			$datas['status'] = ' '.$this->getLibStatut(5, 0).' '.$this->getLibStatut(5, 1);
5702 5702
 		}
5703 5703
 
5704 5704
 		if (!empty($this->ref)) {
@@ -5748,7 +5748,7 @@  discard block
 block discarded – undo
5748 5748
 					$labelsurfacevolume .= ($labelsurfacevolume ? " - " : "")."<b>".$langs->trans("Volume").'</b>: '.$this->volume.' '.measuringUnitString(0, 'volume', $this->volume_units);
5749 5749
 				}
5750 5750
 				if ($labelsurfacevolume) {
5751
-					$datas['surface'] = "<br>" . $labelsurfacevolume;
5751
+					$datas['surface'] = "<br>".$labelsurfacevolume;
5752 5752
 				}
5753 5753
 			}
5754 5754
 			if ($this->isService() && !empty($this->duration_value)) {
@@ -5790,9 +5790,9 @@  discard block
 block discarded – undo
5790 5790
 			}
5791 5791
 			// show categories for this record only in ajax to not overload lists
5792 5792
 			if (isModEnabled('category') && !$nofetch) {
5793
-				require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
5793
+				require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
5794 5794
 				$form = new Form($this->db);
5795
-				$datas['categories'] = '<br>' . $form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
5795
+				$datas['categories'] = '<br>'.$form->showCategories($this->id, Categorie::TYPE_PRODUCT, 1);
5796 5796
 			}
5797 5797
 		}
5798 5798
 
@@ -6320,7 +6320,7 @@  discard block
 block discarded – undo
6320 6320
 		if (isModEnabled("supplier_order")) {
6321 6321
 			$filterStatus = getDolGlobalString('SUPPLIER_ORDER_STATUS_FOR_VIRTUAL_STOCK', '3,4');
6322 6322
 			if (isset($includedraftpoforvirtual)) {
6323
-				$filterStatus = '0,1,2,'.$filterStatus;	// 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
6323
+				$filterStatus = '0,1,2,'.$filterStatus; // 1,2 may have already been inside $filterStatus but it is better to have twice than missing $filterStatus does not include them
6324 6324
 			}
6325 6325
 			$result = $this->load_stats_commande_fournisseur(0, $filterStatus, 1, $dateofvirtualstock);
6326 6326
 			if ($result < 0) {
@@ -6361,7 +6361,7 @@  discard block
 block discarded – undo
6361 6361
 		} elseif (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER')) {
6362 6362
 			if (getDolGlobalString('STOCK_CALCULATE_ON_VALIDATE_ORDER_INCLUDE_DRAFT')) {	// By default, draft means "does not exist", so we do not include them by default, except if option is on
6363 6363
 				$tmpnewprod = dol_clone($this, 1);
6364
-				$result = $tmpnewprod->load_stats_commande(0, '0', 1);	// Get qty in draft orders
6364
+				$result = $tmpnewprod->load_stats_commande(0, '0', 1); // Get qty in draft orders
6365 6365
 				$this->stock_theorique += $tmpnewprod->stats_commande['qty'];
6366 6366
 			}
6367 6367
 		} elseif (getDolGlobalString('STOCK_CALCULATE_ON_BILL') && $weBillOrderOrShipmentReception == 'order') {
@@ -6378,7 +6378,7 @@  discard block
 block discarded – undo
6378 6378
 		} elseif (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER')) {	// Warning: stock change "on approval", not on validation !
6379 6379
 			if (getDolGlobalString('STOCK_CALCULATE_ON_SUPPLIER_VALIDATE_ORDER_INCLUDE_DRAFT')) {	// By default, draft means "does not exist", so we do not include them by default, except if option is on
6380 6380
 				$tmpnewprod = dol_clone($this, 1);
6381
-				$result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1);	// Get qty in draft orders
6381
+				$result = $tmpnewprod->load_stats_commande_fournisseur(0, '0', 1); // Get qty in draft orders
6382 6382
 				$this->stock_theorique += $this->stats_commande_fournisseur['qty'];
6383 6383
 			}
6384 6384
 			$this->stock_theorique -= $stock_reception_fournisseur;
@@ -6755,7 +6755,7 @@  discard block
 block discarded – undo
6755 6755
 		if (getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM')) {
6756 6756
 			$dirsociete = array_merge(array('/core/modules/barcode/'), $conf->modules_parts['barcode']);
6757 6757
 			foreach ($dirsociete as $dirroot) {
6758
-				$res = dol_include_once($dirroot . getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
6758
+				$res = dol_include_once($dirroot.getDolGlobalString('BARCODE_PRODUCT_ADDON_NUM').'.php');
6759 6759
 				if ($res) {
6760 6760
 					break;
6761 6761
 				}
Please login to merge, or discard this patch.
htdocs/admin/remotestore/class/externalModules.class.php 1 patch
Spacing   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -188,12 +188,12 @@  discard block
 block discarded – undo
188 188
 			$httpheader[] = 'Authorization: Basic '.base64_encode($basicAuthLogin.':'.$basicAuthPassword);
189 189
 		}
190 190
 
191
-		$url = $this->dolistore_api_url . (preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/') . $resource;
191
+		$url = $this->dolistore_api_url.(preg_match('/\/$/', $this->dolistore_api_url) ? '' : '/').$resource;
192 192
 
193 193
 		$options['apikey'] = $this->dolistore_api_key;
194 194
 
195 195
 		if ($options) {
196
-			$url .= '?' . http_build_query($options);
196
+			$url .= '?'.http_build_query($options);
197 197
 		}
198 198
 
199 199
 		$url .= (preg_match('/\?/', $url) ? '&' : '?').'apikey='.$this->dolistore_api_key;
@@ -221,13 +221,13 @@  discard block
 block discarded – undo
221 221
 		$modules = array();
222 222
 
223 223
 		if (!empty($this->cache_file) && file_exists($this->cache_file)) {
224
-			dol_syslog(__METHOD__ . " - Loading cache file: " . $this->cache_file, LOG_DEBUG);
224
+			dol_syslog(__METHOD__." - Loading cache file: ".$this->cache_file, LOG_DEBUG);
225 225
 
226 226
 			$content = file_get_contents($this->cache_file);
227 227
 			if ($content !== false) {
228 228
 				$modules = $this->readYaml($content);
229 229
 			} else {
230
-				dol_syslog(__METHOD__ . " - Error reading cache file", LOG_ERR);
230
+				dol_syslog(__METHOD__." - Error reading cache file", LOG_ERR);
231 231
 			}
232 232
 		}
233 233
 
@@ -252,20 +252,20 @@  discard block
 block discarded – undo
252 252
 		if (isset($resCategories['response']) && is_array($resCategories['response'])) {
253 253
 			$organized_tree = $resCategories['response'];
254 254
 		} else {
255
-			return $html ;
255
+			return $html;
256 256
 		}
257 257
 
258 258
 		$html = '';
259 259
 		foreach ($organized_tree as $key => $value) {
260 260
 			if ($value['label'] != "Versions" && $value['label'] != "Specials") {
261 261
 				$html .= '<li>';
262
-				$html .= '<a href="?mode=marketplace&categorie=' . $value['rowid'] . '">' . $value['label'] . '</a>';
262
+				$html .= '<a href="?mode=marketplace&categorie='.$value['rowid'].'">'.$value['label'].'</a>';
263 263
 				if (isset($value['children'])) {
264 264
 					$html .= '<ul>';
265 265
 					usort($value['children'], $this->buildSorter('position'));
266 266
 					foreach ($value['children'] as $key_children => $value_children) {
267 267
 						$html .= '<li>';
268
-						$html .= '<a href="?mode=marketplace&categorie=' . $value_children['rowid'] . '" title="' . dol_escape_htmltag(strip_tags($value_children['description'])) . '">' . $value_children['label'] . '</a>';
268
+						$html .= '<a href="?mode=marketplace&categorie='.$value_children['rowid'].'" title="'.dol_escape_htmltag(strip_tags($value_children['description'])).'">'.$value_children['label'].'</a>';
269 269
 						$html .= '</li>';
270 270
 					}
271 271
 					$html .= '</ul>';
@@ -287,13 +287,13 @@  discard block
 block discarded – undo
287 287
 
288 288
 		$html       = "";
289 289
 		$last_month = dol_now() - (30 * 24 * 60 * 60);
290
-		$dolibarrversiontouse = DOL_VERSION;	// full string with version
290
+		$dolibarrversiontouse = DOL_VERSION; // full string with version
291 291
 
292 292
 		$this->products = array();
293 293
 
294 294
 		$this->categorie = $options['categorie'] ?? 0;
295 295
 		$this->per_page  = $options['per_page'] ?? 11;
296
-		$this->no_page  = $options['no_page'] ?? 1;
296
+		$this->no_page = $options['no_page'] ?? 1;
297 297
 		$this->search    = $options['search'] ?? '';
298 298
 
299 299
 		$data = [
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 		// fetch from github repo
320 320
 		$fileProducts = array();
321 321
 		if (!empty($this->githubFileStatus) && getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY')) {
322
-			$fileProducts = $this->fetchModulesFromFile($data);			// Return an array with all modules from the cache filecontent in $data
322
+			$fileProducts = $this->fetchModulesFromFile($data); // Return an array with all modules from the cache filecontent in $data
323 323
 
324 324
 			$fileProducts = $this->adaptData($fileProducts, 'githubcommunity');
325 325
 
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 			 * @param array<string, mixed> $b Second product for comparison.
340 340
 			 * @return int
341 341
 			 */
342
-			static function ($a, $b) {
342
+			static function($a, $b) {
343 343
 				return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0');
344 344
 			}
345 345
 		);
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 				if ($product['source'] === 'githubcommunity') {
379 379
 					$download_link = '<a class="paddingleft paddingright" target="_blank" href="'.$product["link"].'"><img width="32" src="'.DOL_URL_ROOT.'/admin/remotestore/img/follow.png" /></a>';
380 380
 					if (!empty($product['direct-download']) && $product['direct-download'] == 'yes') {
381
-						$urldownload = $product["dolistore-download"];		// In a future, we will have the download to the zip file
381
+						$urldownload = $product["dolistore-download"]; // In a future, we will have the download to the zip file
382 382
 						$reg = array();
383 383
 						if (preg_match('/https:.*\?id=(\d+)$/', $urldownload, $reg)) {
384 384
 							$urldownload = 'https://www.dolistore.com/_service_download.php?t=free&p='.$reg[1];
@@ -431,12 +431,12 @@  discard block
 block discarded – undo
431 431
 			//output template
432 432
 			$html .= '<tr class="app oddeven '.dol_escape_htmltag($compatible).'">';
433 433
 			$html .= '<td class="center" width="160"><div class="newAppParent">';
434
-			$html .= $newapp.$images;	// No dol_escape_htmltag, it is already escape html
434
+			$html .= $newapp.$images; // No dol_escape_htmltag, it is already escape html
435 435
 			$html .= '</div></td>';
436 436
 			$html .= '<td class="margeCote"><h2 class="appTitle">';
437 437
 			$html .= dol_escape_htmltag(dol_string_nohtmltag($product["label"]));
438 438
 			$html .= '<br><small>';
439
-			$html .= $version;			// No dol_escape_htmltag, it is already escape html
439
+			$html .= $version; // No dol_escape_htmltag, it is already escape html
440 440
 			$html .= '</small></h2>';
441 441
 			$html .= '<small> ';
442 442
 			if (empty($product['tms'])) {
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
 		}
477 477
 
478 478
 
479
-		return $html ;
479
+		return $html;
480 480
 	}
481 481
 
482 482
 	/**
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 		 * @param array<string, mixed> $b
494 494
 		 * @return int
495 495
 		 */
496
-		function (array $a, array $b) use ($key) {
496
+		function(array $a, array $b) use ($key) {
497 497
 			$valA = isset($a[$key]) && is_scalar($a[$key]) ? (string) $a[$key] : '';
498 498
 			$valB = isset($b[$key]) && is_scalar($b[$key]) ? (string) $b[$key] : '';
499 499
 
@@ -635,12 +635,12 @@  discard block
 block discarded – undo
635 635
 		}
636 636
 
637 637
 		// Get the predefined error message or use a default one
638
-		$error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: ' . $request['status_code'];
638
+		$error_message = $error_messages[$request['status_code']] ?? 'Unexpected HTTP status: '.$request['status_code'];
639 639
 
640 640
 		// Append error details if available
641 641
 		if (!empty($request['response']) && isset($request['response']['errors']) && is_array($request['response']['errors'])) {
642 642
 			foreach ($request['response']['errors'] as $error) {
643
-				$error_message .= ' - (Code ' . $error['code'] . '): ' . $error['message'];
643
+				$error_message .= ' - (Code '.$error['code'].'): '.$error['message'];
644 644
 			}
645 645
 		}
646 646
 
@@ -866,7 +866,7 @@  discard block
 block discarded – undo
866 866
 			 *
867 867
 			 * @return int
868 868
 			 */
869
-			static function ($a, $b) {
869
+			static function($a, $b) {
870 870
 				return strtotime($b['datec'] ?? '0') - strtotime($a['datec'] ?? '0');
871 871
 			}
872 872
 		);
@@ -881,7 +881,7 @@  discard block
 block discarded – undo
881 881
 				 *
882 882
 				 * @return bool
883 883
 				 */
884
-				static function ($package) use ($options) {
884
+				static function($package) use ($options) {
885 885
 					return stripos($package['label'], $options['search']) !== false || stripos($package['description'], $options['search']) !== false;
886 886
 				}
887 887
 			);
@@ -897,7 +897,7 @@  discard block
 block discarded – undo
897 897
 				 *
898 898
 				 * @return bool
899 899
 				 */
900
-				static function ($package) use ($options) {
900
+				static function($package) use ($options) {
901 901
 					return in_array($options['categorieid'], $package['category']);
902 902
 				}
903 903
 			);
Please login to merge, or discard this patch.
htdocs/admin/modules.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
 $options['categorie'] 		= ((int) (GETPOSTINT('categorie') ? GETPOSTINT('categorie') : 0));
88 88
 $options['search']    		= GETPOST('search_keyword', 'alpha');
89 89
 
90
-$options['search_source_dolistore']	= getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE');
91
-$options['search_source_github']	= getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY');
90
+$options['search_source_dolistore'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_DOLISTORE');
91
+$options['search_source_github'] = getDolGlobalInt('MAIN_ENABLE_EXTERNALMODULES_COMMUNITY');
92 92
 
93 93
 //$remotestore = new Dolistore(false);
94 94
 $remotestore = new ExternalModules();
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 				//var_dump($modulenamearrays);exit;
318 318
 
319 319
 				// Lop on each packages (can have several if package is a metapackage)
320
-				if (! $error) {
320
+				if (!$error) {
321 321
 					foreach ($modulenamearrays as $modulenameval) {
322 322
 						if (strpos($modulenameval, '#') === 0) {
323 323
 							continue; // Discard comments
@@ -386,7 +386,7 @@  discard block
 block discarded – undo
386 386
 			'search_version' => '-1'
387 387
 		);
388 388
 		$queryString = http_build_query($searchParams);
389
-		$redirectUrl = DOL_URL_ROOT . '/admin/modules.php?' . $queryString;
389
+		$redirectUrl = DOL_URL_ROOT.'/admin/modules.php?'.$queryString;
390 390
 
391 391
 		$message = $langs->trans("SetupIsReadyForUse", $redirectUrl, $langs->transnoentitiesnoconv("Home").' - '.$langs->transnoentitiesnoconv("Setup").' - '.$langs->transnoentitiesnoconv("Modules"));
392 392
 
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
 								} else {
588 588
 									$familykey = $objMod->family;
589 589
 								}
590
-								'@phan-var-force string $familykey';  // if not, phan considers $familykey may be null
590
+								'@phan-var-force string $familykey'; // if not, phan considers $familykey may be null
591 591
 
592 592
 								$moduleposition = ($objMod->module_position ? $objMod->module_position : '50');
593 593
 								if ($objMod->isCoreOrExternalModule() == 'external' && $moduleposition < 100000) {
@@ -693,7 +693,7 @@  discard block
 block discarded – undo
693 693
 print load_fiche_titre($langs->trans("ModulesSetup"), '', 'title_setup');
694 694
 
695 695
 // Start to show page
696
-$deschelp  = '';
696
+$deschelp = '';
697 697
 if ($mode == 'common' || $mode == 'commonkanban') {
698 698
 	$desc = $langs->trans("ModulesDesc", '{picto}');
699 699
 	$desc .= ' '.$langs->trans("ModulesDesc2", '{picto2}');
@@ -980,7 +980,7 @@  discard block
 block discarded – undo
980 980
 		}
981 981
 
982 982
 		if ($objMod->isCoreOrExternalModule() == 'external' && $action == 'checklastversion' && !getDolGlobalString('DISABLE_CHECK_ON_MALWARE_MODULES')) {
983
-			$checkRes = $objMod->checkForCompliance();	// Check if module is reported as non compliant with Dolibarr rules and law
983
+			$checkRes = $objMod->checkForCompliance(); // Check if module is reported as non compliant with Dolibarr rules and law
984 984
 			if (!is_numeric($checkRes) && $checkRes != '') {
985 985
 				$langs->load("errors");
986 986
 				setEventMessages($objMod->getName().' : '.$langs->trans($checkRes), null, 'errors');
@@ -1328,7 +1328,7 @@  discard block
 block discarded – undo
1328 1328
 
1329 1329
 		print '<span class="opacitymedium">'.$langs->trans('DOLISTOREdescriptionLong').'</span><br><br>';
1330 1330
 
1331
-		$categories_tree = $remotestore->getCategories();		// Call API to get the categories
1331
+		$categories_tree = $remotestore->getCategories(); // Call API to get the categories
1332 1332
 
1333 1333
 		$products_list = $remotestore->getProducts($options);
1334 1334
 
Please login to merge, or discard this patch.
htdocs/comm/action/class/api_agendaevents.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -274,7 +274,7 @@  discard block
 block discarded – undo
274 274
 		if ($result) {
275 275
 			$this->actioncomm->fetch_optionals();
276 276
 			$this->actioncomm->fetch_userassigned();
277
-			$this->actioncomm->oldcopy = clone $this->actioncomm;  // @phan-suppress-current-line PhanTypeMismatchProperty
277
+			$this->actioncomm->oldcopy = clone $this->actioncomm; // @phan-suppress-current-line PhanTypeMismatchProperty
278 278
 		}
279 279
 		if (!$result) {
280 280
 			throw new RestException(404, 'actioncomm not found');
@@ -328,7 +328,7 @@  discard block
 block discarded – undo
328 328
 		if ($result) {
329 329
 			$this->actioncomm->fetch_optionals();
330 330
 			$this->actioncomm->fetch_userassigned();
331
-			$this->actioncomm->oldcopy = clone $this->actioncomm;  // @phan-suppress-current-line PhanTypeMismatchProperty
331
+			$this->actioncomm->oldcopy = clone $this->actioncomm; // @phan-suppress-current-line PhanTypeMismatchProperty
332 332
 		}
333 333
 
334 334
 		if (!DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'delete') && DolibarrApiAccess::$user->id != $this->actioncomm->userownerid) {
Please login to merge, or discard this patch.
htdocs/commande/list.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 $search_deliverymonth = '';
150 150
 $search_deliveryyear = '';
151 151
 
152
-$search_import_key  = trim(GETPOST("search_import_key", "alpha"));
152
+$search_import_key = trim(GETPOST("search_import_key", "alpha"));
153 153
 
154 154
 $diroutputmassaction = $conf->order->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
155 155
 
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 	'typent.code' => array('label' => "ThirdPartyType", 'checked' => (string) $checkedtypetiers, 'position' => 55),
217 217
 	'c.date_commande' => array('label' => "OrderDateShort", 'checked' => '1', 'position' => 60, 'csslist' => 'nowraponall'),
218 218
 	'c.delivery_date' => array('label' => "DateDeliveryPlanned", 'checked' => '1', 'enabled' => (string) (int) !getDolGlobalString('ORDER_DISABLE_DELIVERY_DATE'), 'position' => 65, 'csslist' => 'nowraponall'),
219
-	'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => '-1', 'position' => 66 , 'enabled' => (string) (int) isModEnabled("shipping")),
219
+	'c.fk_shipping_method' => array('label' => "SendingMethod", 'checked' => '-1', 'position' => 66, 'enabled' => (string) (int) isModEnabled("shipping")),
220 220
 	'c.fk_cond_reglement' => array('label' => "PaymentConditionsShort", 'checked' => '-1', 'position' => 67),
221 221
 	'c.fk_mode_reglement' => array('label' => "PaymentMode", 'checked' => '-1', 'position' => 68),
222 222
 	'c.fk_input_reason' => array('label' => "Origin", 'checked' => '-1', 'position' => 69),
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	'c.date_cloture' => array('label' => "DateClosing", 'checked' => '0', 'position' => 130),
240 240
 	'c.note_public' => array('label' => 'NotePublic', 'checked' => '0', 'enabled' => (string) (int) (!getDolGlobalInt('MAIN_LIST_HIDE_PUBLIC_NOTES')), 'position' => 135, 'searchall' => 1),
241 241
 	'c.note_private' => array('label' => 'NotePrivate', 'checked' => '0', 'enabled' => (string) (int) (!getDolGlobalInt('MAIN_LIST_HIDE_PRIVATE_NOTES')), 'position' => 140),
242
-	'shippable' => array('label' => "Shippable", 'checked' => '1','enabled' => (string) (int) (isModEnabled("shipping")), 'position' => 990),
242
+	'shippable' => array('label' => "Shippable", 'checked' => '1', 'enabled' => (string) (int) (isModEnabled("shipping")), 'position' => 990),
243 243
 	'c.facture' => array('label' => "Billed", 'checked' => '1', 'enabled' => (string) (int) (!getDolGlobalString('WORKFLOW_BILL_ON_SHIPMENT')), 'position' => 995),
244 244
 	'c.import_key' => array('type' => 'varchar(14)', 'label' => 'ImportId', 'enabled' => '1', 'visible' => -2, 'position' => 999),
245 245
 	'c.fk_statut' => array('label' => "Status", 'checked' => '1', 'position' => 1000)
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 				}
430 430
 
431 431
 				if (empty($objecttmp->note_public)) {
432
-					$objecttmp->note_public =  $langs->transnoentities("Orders");
432
+					$objecttmp->note_public = $langs->transnoentities("Orders");
433 433
 				}
434 434
 
435 435
 				$datefacture = dol_mktime(12, 0, 0, GETPOSTINT('remonth'), GETPOSTINT('reday'), GETPOSTINT('reyear'));
@@ -754,7 +754,7 @@  discard block
 block discarded – undo
754 754
 			$db->rollback();
755 755
 
756 756
 			$action = 'create';
757
-			$_GET["origin"] = $_POST["origin"];		// Keep GET and POST here ?
757
+			$_GET["origin"] = $_POST["origin"]; // Keep GET and POST here ?
758 758
 			$_GET["originid"] = $_POST["originid"]; // Keep GET and POST here ?
759 759
 			if (!empty($errors)) {
760 760
 				setEventMessages(null, $errors, 'errors');
@@ -1129,7 +1129,7 @@  discard block
 block discarded – undo
1129 1129
 			if ($searchCategoryCustomerOperator == 0) {
1130 1130
 				$searchCategoryCustomerSqlList[] = " EXISTS (SELECT cs.fk_soc FROM ".MAIN_DB_PREFIX."categorie_societe as cs WHERE s.rowid = cs.fk_soc AND cs.fk_categorie = ".((int) $searchCategoryCustomer).")";
1131 1131
 			} else {
1132
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryCustomer);
1132
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryCustomer);
1133 1133
 			}
1134 1134
 		}
1135 1135
 	}
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
 			if ($searchCategoryProductOperator == 0) {
1160 1160
 				$searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM ".MAIN_DB_PREFIX."categorie_product as ck, ".MAIN_DB_PREFIX."commandedet as cd WHERE cd.fk_commande = c.rowid AND cd.fk_product = ck.fk_product AND ck.fk_categorie = ".((int) $searchCategoryProduct).")";
1161 1161
 			} else {
1162
-				$listofcategoryid .= ($listofcategoryid ? ', ' : '') .((int) $searchCategoryProduct);
1162
+				$listofcategoryid .= ($listofcategoryid ? ', ' : '').((int) $searchCategoryProduct);
1163 1163
 			}
1164 1164
 		}
1165 1165
 	}
@@ -1620,7 +1620,7 @@  discard block
 block discarded – undo
1620 1620
 }
1621 1621
 
1622 1622
 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
1623
-$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN'));  // This also change content of $arrayfields with user setup
1623
+$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
1624 1624
 $selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
1625 1625
 $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
1626 1626
 
@@ -2793,15 +2793,15 @@  discard block
 block discarded – undo
2793 2793
 			if (!empty($show_shippable_command) && isModEnabled('stock')) {
2794 2794
 				$text_icon = '';
2795 2795
 				if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
2796
-					$generic_commande->getLinesArray(); 	// Load array ->lines
2797
-					$generic_commande->loadExpeditions();	// Load array ->expeditions
2796
+					$generic_commande->getLinesArray(); // Load array ->lines
2797
+					$generic_commande->loadExpeditions(); // Load array ->expeditions
2798 2798
 
2799 2799
 					$numlines = count($generic_commande->lines); // Loop on each line of order
2800 2800
 					for ($lig = 0; $lig < $numlines; $lig++) {
2801 2801
 						$orderLine = $generic_commande->lines[$lig];
2802 2802
 						'@phan-var-force OrderLine $orderLine';
2803 2803
 						if (isset($generic_commande->expeditions[$orderLine->id])) {
2804
-							$reliquat =  $orderLine->qty - $generic_commande->expeditions[$orderLine->id];
2804
+							$reliquat = $orderLine->qty - $generic_commande->expeditions[$orderLine->id];
2805 2805
 						} else {
2806 2806
 							$reliquat = $orderLine->qty;
2807 2807
 						}
Please login to merge, or discard this patch.
htdocs/commande/card.php 1 patch
Spacing   +63 added lines, -63 removed lines patch added patch discarded remove patch
@@ -91,18 +91,18 @@  discard block
 block discarded – undo
91 91
 
92 92
 
93 93
 $id        = (GETPOSTINT('id') ? GETPOSTINT('id') : GETPOSTINT('orderid'));
94
-$ref       =  GETPOST('ref', 'alpha');
95
-$socid     =  GETPOSTINT('socid');
96
-$action    =  GETPOST('action', 'aZ09');
97
-$cancel    =  GETPOST('cancel', 'alpha');
98
-$confirm   =  GETPOST('confirm', 'alpha');
94
+$ref       = GETPOST('ref', 'alpha');
95
+$socid     = GETPOSTINT('socid');
96
+$action    = GETPOST('action', 'aZ09');
97
+$cancel    = GETPOST('cancel', 'alpha');
98
+$confirm   = GETPOST('confirm', 'alpha');
99 99
 $backtopage = GETPOST('backtopage', 'alpha');
100 100
 
101
-$lineid    =  GETPOSTINT('lineid');
102
-$contactid =  GETPOSTINT('contactid');
103
-$projectid =  GETPOSTINT('projectid');
104
-$origin    =  GETPOST('origin', 'alpha');
105
-$originid  = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id'));    // For backward compatibility
101
+$lineid    = GETPOSTINT('lineid');
102
+$contactid = GETPOSTINT('contactid');
103
+$projectid = GETPOSTINT('projectid');
104
+$origin    = GETPOST('origin', 'alpha');
105
+$originid  = (GETPOSTINT('originid') ? GETPOSTINT('originid') : GETPOSTINT('origin_id')); // For backward compatibility
106 106
 $rank      = (GETPOSTINT('rank') > 0) ? GETPOSTINT('rank') : -1;
107 107
 
108 108
 // Type Contact default
@@ -145,26 +145,26 @@  discard block
 block discarded – undo
145 145
 $extrafields->fetch_name_optionals_label($object->table_element);
146 146
 
147 147
 // Load object
148
-include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php';     // Must be 'include', not 'include_once'
148
+include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be 'include', not 'include_once'
149 149
 
150 150
 // Permissions / Rights
151
-$usercanread    =  $user->hasRight("commande", "lire");
152
-$usercancreate  =  $user->hasRight("commande", "creer");
153
-$usercandelete  =  $user->hasRight("commande", "supprimer");
151
+$usercanread    = $user->hasRight("commande", "lire");
152
+$usercancreate  = $user->hasRight("commande", "creer");
153
+$usercandelete  = $user->hasRight("commande", "supprimer");
154 154
 
155 155
 // Advanced permissions
156
-$usercanclose       =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close')));
157
-$usercanvalidate    =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate')));
158
-$usercancancel      =  ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler')));
159
-$usercansend        =   (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send'));
160
-$usercangeneretedoc =   (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc'));
156
+$usercanclose       = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !empty($usercancreate)) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'close')));
157
+$usercanvalidate    = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'validate')));
158
+$usercancancel      = ((!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $usercancreate) || (getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && $user->hasRight('commande', 'order_advance', 'annuler')));
159
+$usercansend        = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'send'));
160
+$usercangeneretedoc = (!getDolGlobalString('MAIN_USE_ADVANCED_PERMS') || $user->hasRight('commande', 'order_advance', 'generetedoc'));
161 161
 
162 162
 $usermustrespectpricemin    = ((getDolGlobalString('MAIN_USE_ADVANCED_PERMS') && !$user->hasRight('produit', 'ignore_price_min_advance')) || !getDolGlobalString('MAIN_USE_ADVANCED_PERMS'));
163 163
 $usercancreatepurchaseorder = ($user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'));
164 164
 
165
-$permissionnote    = $usercancreate;     //  Used by the include of actions_setnotes.inc.php
166
-$permissiondellink = $usercancreate;     //  Used by the include of actions_dellink.inc.php
167
-$permissiontoadd   = $usercancreate;     //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
165
+$permissionnote    = $usercancreate; //  Used by the include of actions_setnotes.inc.php
166
+$permissiondellink = $usercancreate; //  Used by the include of actions_dellink.inc.php
167
+$permissiontoadd   = $usercancreate; //  Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
168 168
 
169 169
 
170 170
 $error = 0;
@@ -211,11 +211,11 @@  discard block
 block discarded – undo
211 211
 		$action = '';
212 212
 	}
213 213
 
214
-	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php';    // Must be 'include', not 'include_once'
214
+	include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php'; // Must be 'include', not 'include_once'
215 215
 
216
-	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';     // Must be 'include', not 'include_once'
216
+	include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php'; // Must be 'include', not 'include_once'
217 217
 
218
-	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';  // Must be 'include', not 'include_once'
218
+	include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php'; // Must be 'include', not 'include_once'
219 219
 
220 220
 	// Action clone object
221 221
 	if ($action == 'confirm_clone' && $confirm == 'yes' && $usercancreate) {
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
 		$pu_ht = '';
748 748
 		$pu_ttc = '';
749 749
 		$pu_ht_devise = '';
750
-		$pu_ttc_devise  = '';
750
+		$pu_ttc_devise = '';
751 751
 
752 752
 		if (GETPOST('price_ht') !== '') {
753 753
 			$price_ht = price2num(GETPOST('price_ht'), 'MU', 2);
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
 									$price_base_type = $custprice_line->price_base_type;
889 889
 									$tva_tx = $custprice_line->tva_tx;
890 890
 									if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', (string) $tva_tx)) {
891
-										$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
891
+										$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
892 892
 									}
893 893
 									$tva_npr = $custprice_line->recuperableonly;
894 894
 									if (empty($tva_tx)) {
@@ -954,7 +954,7 @@  discard block
 block discarded – undo
954 954
 									$price_base_type = $custprice_line->price_base_type;
955 955
 									$tva_tx = $custprice_line->tva_tx;
956 956
 									if ($custprice_line->default_vat_code && !preg_match('/\(.*\)/', $tva_tx)) {
957
-										$tva_tx .= ' (' . $custprice_line->default_vat_code . ')';
957
+										$tva_tx .= ' ('.$custprice_line->default_vat_code.')';
958 958
 									}
959 959
 									$tva_npr = $custprice_line->recuperableonly;
960 960
 									if (empty($tva_tx)) {
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
 					GETPOST('generate_deposit', 'alpha') == 'on' && !empty($deposit_percent_from_payment_terms)
1486 1486
 					&& isModEnabled('invoice') && $user->hasRight('facture', 'creer')
1487 1487
 				) {
1488
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
1488
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
1489 1489
 
1490 1490
 					$date = dol_mktime(0, 0, 0, GETPOSTINT('datefmonth'), GETPOSTINT('datefday'), GETPOSTINT('datefyear'));
1491 1491
 					$forceFields = array();
@@ -1498,7 +1498,7 @@  discard block
 block discarded – undo
1498 1498
 
1499 1499
 					if ($deposit) {
1500 1500
 						setEventMessage('DepositGenerated');
1501
-						$locationTarget = DOL_URL_ROOT . '/compta/facture/card.php?id=' . $deposit->id;
1501
+						$locationTarget = DOL_URL_ROOT.'/compta/facture/card.php?id='.$deposit->id;
1502 1502
 					} else {
1503 1503
 						$error++;
1504 1504
 						setEventMessages($object->error, $object->errors, 'errors');
@@ -1506,7 +1506,7 @@  discard block
 block discarded – undo
1506 1506
 				}
1507 1507
 
1508 1508
 				// Define output language
1509
-				if (! $error) {
1509
+				if (!$error) {
1510 1510
 					$db->commit();
1511 1511
 
1512 1512
 					if (!getDolGlobalString('MAIN_DISABLE_PDF_AUTOUPDATE')) {
@@ -1534,7 +1534,7 @@  discard block
 block discarded – undo
1534 1534
 					}
1535 1535
 
1536 1536
 					if ($locationTarget) {
1537
-						header('Location: ' . $locationTarget);
1537
+						header('Location: '.$locationTarget);
1538 1538
 						exit;
1539 1539
 					}
1540 1540
 				} else {
@@ -1625,7 +1625,7 @@  discard block
 block discarded – undo
1625 1625
 	}
1626 1626
 
1627 1627
 	if ($action == 'update_extras' && $usercancreate) {
1628
-		$object->oldcopy = dol_clone($object, 2);  // @phan-suppress-current-line PhanTypeMismatchProperty
1628
+		$object->oldcopy = dol_clone($object, 2); // @phan-suppress-current-line PhanTypeMismatchProperty
1629 1629
 		$attribute_name = GETPOST('attribute', 'restricthtml');
1630 1630
 
1631 1631
 		// Fill array 'array_options' with data from update form
@@ -1862,7 +1862,7 @@  discard block
 block discarded – undo
1862 1862
 
1863 1863
 			$classname = ucfirst($subelement);
1864 1864
 			$objectsrc = new $classname($db);
1865
-			'@phan-var-force Commande|Propal|Contrat $objectsrc';  // Can possibly be other class but CommonObject is too general
1865
+			'@phan-var-force Commande|Propal|Contrat $objectsrc'; // Can possibly be other class but CommonObject is too general
1866 1866
 			$objectsrc->fetch($originid);
1867 1867
 			if (empty($objectsrc->lines) && method_exists($objectsrc, 'fetch_lines')) {
1868 1868
 				$objectsrc->fetch_lines();
@@ -1959,7 +1959,7 @@  discard block
 block discarded – undo
1959 1959
 	print '<form name="crea_commande" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
1960 1960
 	print '<input type="hidden" name="token" value="'.newToken().'">';
1961 1961
 	print '<input type="hidden" name="action" value="add">';
1962
-	print '<input type="hidden" name="changecompany" value="0">';	// will be set to 1 by javascript so we know post is done after a company change
1962
+	print '<input type="hidden" name="changecompany" value="0">'; // will be set to 1 by javascript so we know post is done after a company change
1963 1963
 	print '<input type="hidden" name="remise_percent" value="'.$soc->remise_percent.'">';
1964 1964
 	print '<input type="hidden" name="origin" value="'.$origin.'">';
1965 1965
 	print '<input type="hidden" name="originid" value="'.$originid.'">';
@@ -2141,7 +2141,7 @@  discard block
 block discarded – undo
2141 2141
 		// Other attributes
2142 2142
 		$parameters = array();
2143 2143
 		if (!empty($origin) && !empty($originid) && is_object($objectsrc)) {
2144
-			$parameters['objectsrc'] =  $objectsrc;
2144
+			$parameters['objectsrc'] = $objectsrc;
2145 2145
 		}
2146 2146
 		$parameters['socid'] = $socid;
2147 2147
 
@@ -2367,7 +2367,7 @@  discard block
 block discarded – undo
2367 2367
 			$nbMandated = 0;
2368 2368
 			foreach ($object->lines as $line) {
2369 2369
 				$res = $line->fetch_product();
2370
-				if ($res  > 0) {
2370
+				if ($res > 0) {
2371 2371
 					if ($line->product->isService() && $line->product->isMandatoryPeriod() && (empty($line->date_start) || empty($line->date_end))) {
2372 2372
 						$nbMandated++;
2373 2373
 						break;
@@ -2391,7 +2391,7 @@  discard block
 block discarded – undo
2391 2391
 				$deposit_percent_from_payment_terms = (float) getDictionaryValue('c_payment_term', 'deposit_percent', $object->cond_reglement_id);
2392 2392
 
2393 2393
 				if (!empty($deposit_percent_from_payment_terms) && isModEnabled('invoice') && $user->hasRight('facture', 'creer')) {
2394
-					require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php';
2394
+					require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
2395 2395
 
2396 2396
 					$object->fetchObjectLinked();
2397 2397
 
@@ -2604,7 +2604,7 @@  discard block
 block discarded – undo
2604 2604
 		$morehtmlref = '<div class="refidno">';
2605 2605
 		// Ref customer
2606 2606
 		$morehtmlref .= $form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string', '', 0, 1);
2607
-		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':' . getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2607
+		$morehtmlref .= $form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, (int) $usercancreate, 'string'.(isset($conf->global->THIRDPARTY_REF_INPUT_SIZE) ? ':'.getDolGlobalString('THIRDPARTY_REF_INPUT_SIZE') : ''), '', null, null, '', 1);
2608 2608
 		// Thirdparty
2609 2609
 		$morehtmlref .= '<br>'.$soc->getNomUrl(1, 'customer');
2610 2610
 		if (!getDolGlobalString('MAIN_DISABLE_OTHER_LINK') && $object->thirdparty->id > 0) {
@@ -2924,36 +2924,36 @@  discard block
 block discarded – undo
2924 2924
 
2925 2925
 			$alert = '';
2926 2926
 			if (getDolGlobalString('ORDER_MANAGE_MIN_AMOUNT') && $object->total_ht < $object->thirdparty->order_min_amount) {
2927
-				$alert = ' ' . img_warning($langs->trans('OrderMinAmount') . ': ' . price($object->thirdparty->order_min_amount));
2927
+				$alert = ' '.img_warning($langs->trans('OrderMinAmount').': '.price($object->thirdparty->order_min_amount));
2928 2928
 			}
2929 2929
 
2930 2930
 			print '<tr>';
2931
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountHT') . '</td>';
2932
-			print '<td class="nowrap amountcard right">' . price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2931
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountHT').'</td>';
2932
+			print '<td class="nowrap amountcard right">'.price($object->total_ht, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2933 2933
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2934 2934
 				// Multicurrency Amount HT
2935
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2935
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_ht, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2936 2936
 			}
2937 2937
 			print '</tr>';
2938 2938
 
2939 2939
 			print '<tr>';
2940
-			print '<td class="titlefieldmiddle">' . $langs->trans('AmountVAT') . '</td>';
2941
-			print '<td class="nowrap amountcard right">' . price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2940
+			print '<td class="titlefieldmiddle">'.$langs->trans('AmountVAT').'</td>';
2941
+			print '<td class="nowrap amountcard right">'.price($object->total_tva, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2942 2942
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2943 2943
 				// Multicurrency Amount VAT
2944
-				print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2944
+				print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_tva, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2945 2945
 			}
2946 2946
 			print '</tr>';
2947 2947
 
2948 2948
 			// Amount Local Taxes
2949 2949
 			if ($mysoc->localtax1_assuj == "1" || $object->total_localtax1 != 0) {
2950 2950
 				print '<tr>';
2951
-				print '<td class="titlefieldmiddle">' . $langs->transcountry("AmountLT1", $mysoc->country_code) . '</td>';
2952
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2951
+				print '<td class="titlefieldmiddle">'.$langs->transcountry("AmountLT1", $mysoc->country_code).'</td>';
2952
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2953 2953
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2954 2954
 					$object->multicurrency_total_localtax1 = price2num($object->total_localtax1 * $object->multicurrency_tx, 'MT');
2955 2955
 
2956
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2956
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax1, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2957 2957
 				}
2958 2958
 				print '</tr>';
2959 2959
 			}
@@ -2961,22 +2961,22 @@  discard block
 block discarded – undo
2961 2961
 			// Amount Local Taxes
2962 2962
 			if ($mysoc->localtax2_assuj == "1" || $object->total_localtax2 != 0) {
2963 2963
 				print '<tr>';
2964
-				print '<td>' . $langs->transcountry("AmountLT2", $mysoc->country_code) . '</td>';
2965
-				print '<td class="nowrap amountcard right">' . price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency) . '</td>';
2964
+				print '<td>'.$langs->transcountry("AmountLT2", $mysoc->country_code).'</td>';
2965
+				print '<td class="nowrap amountcard right">'.price($object->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency).'</td>';
2966 2966
 				if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2967 2967
 					$object->multicurrency_total_localtax2 = price2num($object->total_localtax2 * $object->multicurrency_tx, 'MT');
2968 2968
 
2969
-					print '<td class="nowrap amountcard right">' . price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code) . '</td>';
2969
+					print '<td class="nowrap amountcard right">'.price($object->multicurrency_total_localtax2, 0, $langs, 0, -1, -1, $object->multicurrency_code).'</td>';
2970 2970
 				}
2971 2971
 				print '</tr>';
2972 2972
 			}
2973 2973
 
2974 2974
 			print '<tr>';
2975
-			print '<td>' . $langs->trans('AmountTTC') . '</td>';
2976
-			print '<td class="valuefield nowrap right amountcard">' . price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency) . '</td>';
2975
+			print '<td>'.$langs->trans('AmountTTC').'</td>';
2976
+			print '<td class="valuefield nowrap right amountcard">'.price($object->total_ttc, 1, '', 1, -1, -1, $conf->currency).'</td>';
2977 2977
 			if (isModEnabled("multicurrency") && ($object->multicurrency_code && $object->multicurrency_code != $conf->currency)) {
2978 2978
 				// Multicurrency Amount TTC
2979
-				print '<td class="valuefield nowrap right amountcard">' . price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code) . '</td>';
2979
+				print '<td class="valuefield nowrap right amountcard">'.price($object->multicurrency_total_ttc, 1, '', 1, -1, -1, $object->multicurrency_code).'</td>';
2980 2980
 			}
2981 2981
 			print '</tr>'."\n";
2982 2982
 
@@ -3093,7 +3093,7 @@  discard block
 block discarded – undo
3093 3093
 						if ($usercansend) {
3094 3094
 							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER["PHP_SELF"].'?action=presend&token='.newToken().'&id='.$object->id.'&mode=init#formmailbeforetitle', '');
3095 3095
 						} else {
3096
-							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF']. '#', '', false);
3096
+							print dolGetButtonAction('', $langs->trans('SendMail'), 'email', $_SERVER['PHP_SELF'].'#', '', false);
3097 3097
 						}
3098 3098
 					}
3099 3099
 				}
@@ -3120,7 +3120,7 @@  discard block
 block discarded – undo
3120 3120
 						'enabled' => (isModEnabled("supplier_order") && $object->statut > Commande::STATUS_DRAFT),
3121 3121
 						'perm' => $usercancreatepurchaseorder,
3122 3122
 						'label' => 'AddPurchaseOrder',
3123
-						'url' => '/fourn/commande/card.php?action=create&amp;origin=' . urlencode($object->element) . '&amp;originid=' . ((int) $object->id)
3123
+						'url' => '/fourn/commande/card.php?action=create&amp;origin='.urlencode($object->element).'&amp;originid='.((int) $object->id)
3124 3124
 					);
3125 3125
 				}
3126 3126
 
@@ -3136,7 +3136,7 @@  discard block
 block discarded – undo
3136 3136
 					'enabled' => (isModEnabled("intervention") && $object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && $object->getNbOfServicesLines() > 0),
3137 3137
 					'perm' => ($user->hasRight('ficheinter', 'creer') == 1),
3138 3138
 					'label' => 'AddIntervention',
3139
-					'url' => '/fichinter/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid,
3139
+					'url' => '/fichinter/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid,
3140 3140
 				);
3141 3141
 				/*if (isModEnabled('ficheinter')) {
3142 3142
 					$langs->load("interventions");
@@ -3156,7 +3156,7 @@  discard block
 block discarded – undo
3156 3156
 					'enabled' => (isModEnabled("contract") && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)),
3157 3157
 					'perm' => ($user->hasRight('contrat', 'creer') == 1),
3158 3158
 					'label' => 'AddContract',
3159
-					'url' => '/contrat/card.php?action=create&amp;origin=' . $object->element . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid,
3159
+					'url' => '/contrat/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid,
3160 3160
 				);
3161 3161
 				/*if (isModEnabled('contrat') && ($object->statut == Commande::STATUS_VALIDATED || $object->statut == Commande::STATUS_SHIPMENTONPROCESS || $object->statut == Commande::STATUS_CLOSED)) {
3162 3162
 					$langs->load("contracts");
@@ -3179,7 +3179,7 @@  discard block
 block discarded – undo
3179 3179
 							'enabled' => (isModEnabled("shipping") && ($object->statut > Commande::STATUS_DRAFT && $object->statut < Commande::STATUS_CLOSED && ($object->getNbOfProductsLines() > 0 || getDolGlobalString('STOCK_SUPPORTS_SERVICES')))),
3180 3180
 							'perm' => $user->hasRight('expedition', 'creer'),
3181 3181
 							'label' => 'CreateShipment',
3182
-							'url' => '/expedition/shipment.php?id=' . $object->id
3182
+							'url' => '/expedition/shipment.php?id='.$object->id
3183 3183
 						);
3184 3184
 						/*
3185 3185
 						if ($user->hasRight('expedition', 'creer')) {
@@ -3189,7 +3189,7 @@  discard block
 block discarded – undo
3189 3189
 						}*/
3190 3190
 					} else {
3191 3191
 						$langs->load("errors");
3192
-						print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
3192
+						print dolGetButtonAction($langs->trans('ErrorModuleSetupNotComplete'), $langs->trans('CreateShipment'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
3193 3193
 					}
3194 3194
 				}
3195 3195
 
@@ -3199,7 +3199,7 @@  discard block
 block discarded – undo
3199 3199
 					'enabled' => (isModEnabled('invoice') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0),
3200 3200
 					'perm' => ($user->hasRight('facture', 'creer') && !getDolGlobalInt('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')),
3201 3201
 					'label' => 'CreateBill',
3202
-					'url' => '/compta/facture/card.php?action=create&amp;token=' . newToken() . '&amp;origin=' . urlencode($object->element) . '&amp;originid=' . $object->id . '&amp;socid=' . $object->socid
3202
+					'url' => '/compta/facture/card.php?action=create&amp;token='.newToken().'&amp;origin='.urlencode($object->element).'&amp;originid='.$object->id.'&amp;socid='.$object->socid
3203 3203
 				);
3204 3204
 				/*
3205 3205
 				 if (isModEnabled('facture') && $object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
@@ -3251,7 +3251,7 @@  discard block
 block discarded – undo
3251 3251
 					if ($numshipping == 0) {
3252 3252
 						print dolGetButtonAction('', $langs->trans('Delete'), 'delete', $_SERVER["PHP_SELF"].'?action=delete&token='.newToken().'&id='.$object->id, '');
3253 3253
 					} else {
3254
-						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF']. '#', '', false);
3254
+						print dolGetButtonAction($langs->trans('ShippingExist'), $langs->trans('Delete'), 'default', $_SERVER['PHP_SELF'].'#', '', false);
3255 3255
 					}
3256 3256
 				}
3257 3257
 			}
Please login to merge, or discard this patch.