From a296e35e1212f20e98da4e6d2b4e00a7b7eea550 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 22 May 2019 14:58:34 +1200 Subject: [PATCH] Fix variable types in DAO doc blocks Phpcs (stricter) reports 79 | ERROR | [x] Expected "intunsigned" but found "int unsigned" for @var tag in member variable comment 156 | ERROR | [x] Expected "bool" but found "boolean" for @var tag in member variable comment We are declaring int unsigned instead of int & boolean instead of bool Note this commit only contains sample of resulting change - will add more complete set after --- CRM/ACL/DAO/ACL.php | 6 +++--- CRM/Core/CodeGen/Specification.php | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CRM/ACL/DAO/ACL.php b/CRM/ACL/DAO/ACL.php index 3e59f9d2f9da..b2acb3e24155 100644 --- a/CRM/ACL/DAO/ACL.php +++ b/CRM/ACL/DAO/ACL.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/ACL/ACL.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:de12a8f0949faa12a7ffc89b7abfd7b7) + * (GenCodeChecksum:810da5f19a7ead8c949065156674c087) */ /** @@ -31,7 +31,7 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO { /** * Unique table ID * - * @var int unsigned + * @var int */ public $id; @@ -45,7 +45,7 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO { /** * Is this ACL entry Allow (0) or Deny (1) ? * - * @var boolean + * @var bool */ public $deny; diff --git a/CRM/Core/CodeGen/Specification.php b/CRM/Core/CodeGen/Specification.php index 45e0a5e5348d..101b3426b412 100644 --- a/CRM/Core/CodeGen/Specification.php +++ b/CRM/Core/CodeGen/Specification.php @@ -318,7 +318,7 @@ public function getField(&$fieldXML, &$fields) { // need this case since some versions of mysql do not have boolean as a valid column type and hence it // is changed to tinyint. hopefully after 2 yrs this case can be removed. $field['sqlType'] = 'tinyint'; - $field['phpType'] = $type; + $field['phpType'] = 'bool'; $field['crmType'] = 'CRM_Utils_Type::T_' . strtoupper($type); break; @@ -340,6 +340,7 @@ public function getField(&$fieldXML, &$fields) { $field['phpType'] = $this->value('phpType', $fieldXML, $type); $field['sqlType'] = $type; if ($type == 'int unsigned') { + $field['phpType'] = 'int'; $field['crmType'] = 'CRM_Utils_Type::T_INT'; } else {