Browse Source

Fix warning

Laurent Destailleur 2 years ago
parent
commit
8abde17e95
3 changed files with 6 additions and 5 deletions
  1. 2 2
      htdocs/core/modules/DolibarrModules.class.php
  2. 2 2
      htdocs/product/card.php
  3. 2 1
      qodana.yaml

+ 2 - 2
htdocs/core/modules/DolibarrModules.class.php

@@ -299,10 +299,10 @@ class DolibarrModules // Can not be abstract, because we need to instantiate it
 	public $picto;
 
 	/**
-	 * @var string[] List of config pages
+	 * @var string[]|string 	List of config pages (Old modules uses a string. New one must use an array)
 	 *
 	 * Name of php pages stored into module/admin directory, used to setup module.
-	 * e.g.: "admin.php@module"
+	 * e.g.: array("setup.php@mymodule")
 	 */
 	public $config_page_url;
 

+ 2 - 2
htdocs/product/card.php

@@ -541,7 +541,7 @@ if (empty($reshook)) {
 			if ($result < 0) {
 				$error++;
 				$mesg = 'Failed to get bar code type information ';
-				setEventMessages($mesg.$stdobject->error, $mesg.$stdobject->errors, 'errors');
+				setEventMessages($mesg.$stdobject->error, $stdobject->errors, 'errors');
 			}
 			$object->barcode_type_code      = $stdobject->barcode_type_code;
 			$object->barcode_type_coder     = $stdobject->barcode_type_coder;
@@ -780,7 +780,7 @@ if (empty($reshook)) {
 				if ($result < 0) {
 					$error++;
 					$mesg = 'Failed to get bar code type information ';
-					setEventMessages($mesg.$stdobject->error, $mesg.$stdobject->errors, 'errors');
+					setEventMessages($mesg.$stdobject->error, $stdobject->errors, 'errors');
 				}
 				$object->barcode_type_code      = $stdobject->barcode_type_code;
 				$object->barcode_type_coder     = $stdobject->barcode_type_coder;

+ 2 - 1
qodana.yaml

@@ -61,4 +61,5 @@ exclude:
   - name: PhpClassConstantAccessedViaChildClassInspection
   - name: RegExpUnnecessaryNonCapturingGroup
   - name: PhpPregMatchReplaceWithComparisonInspection
-  - name: PhpArrayWriteIsNotUsedInspection
+  - name: PhpArrayWriteIsNotUsedInspection
+  - name: PhpUndefinedNamespaceInspection