Passed
Push — scrutinizer-code-quality ( 09f5a1...c4c5fb )
by Adam
56:05 queued 14:08
created
modules/Contacts/ContactOpportunityRelationship.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -74,12 +74,12 @@  discard block
 block discarded – undo
74 74
 	var $new_schema = true;
75 75
 
76 76
 	var $additional_column_fields = Array();
77
-		var $field_defs = array (
77
+		var $field_defs = array(
78 78
        'id'=>array('name' =>'id', 'type' =>'char', 'len'=>'36', 'default'=>'')
79
-      , 'contact_id'=>array('name' =>'contact_id', 'type' =>'char', 'len'=>'36', )
79
+      , 'contact_id'=>array('name' =>'contact_id', 'type' =>'char', 'len'=>'36',)
80 80
       , 'opportunity_id'=>array('name' =>'opportunity_id', 'type' =>'char', 'len'=>'36',)
81 81
       , 'contact_role'=>array('name' =>'contact_role', 'type' =>'char', 'len'=>'50')
82
-      , 'date_modified'=>array ('name' => 'date_modified','type' => 'datetime')
82
+      , 'date_modified'=>array('name' => 'date_modified', 'type' => 'datetime')
83 83
       , 'deleted'=>array('name' =>'deleted', 'type' =>'bool', 'len'=>'1', 'default'=>'0', 'required'=>true)
84 84
       );
85 85
 	function __construct() {
@@ -87,16 +87,16 @@  discard block
 block discarded – undo
87 87
 		$this->db = DBManagerFactory::getInstance();
88 88
         $this->dbManager = DBManagerFactory::getInstance();
89 89
 
90
-		$this->disable_row_level_security =true;
90
+		$this->disable_row_level_security = true;
91 91
 
92 92
 		}
93 93
 
94 94
     /**
95 95
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
96 96
      */
97
-    function ContactOpportunityRelationship(){
97
+    function ContactOpportunityRelationship() {
98 98
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
99
-        if(isset($GLOBALS['log'])) {
99
+        if (isset($GLOBALS['log'])) {
100 100
             $GLOBALS['log']->deprecated($deprecatedMessage);
101 101
         }
102 102
         else {
@@ -109,27 +109,27 @@  discard block
 block discarded – undo
109 109
 	function fill_in_additional_detail_fields()
110 110
 	{
111 111
 		global $locale;
112
-		if(isset($this->contact_id) && $this->contact_id != "")
112
+		if (isset($this->contact_id) && $this->contact_id != "")
113 113
 		{
114 114
 			$query = "SELECT first_name, last_name from contacts where id='$this->contact_id' AND deleted=0";
115
-			$result =$this->db->query($query,true," Error filling in additional detail fields: ");
115
+			$result = $this->db->query($query, true, " Error filling in additional detail fields: ");
116 116
 			// Get the id and the name.
117 117
 			$row = $this->db->fetchByAssoc($result);
118 118
 
119
-			if($row != null)
119
+			if ($row != null)
120 120
 			{
121 121
 				$this->contact_name = $locale->getLocaleFormattedName($row['first_name'], $row['last_name']);
122 122
 			}
123 123
 		}
124 124
 
125
-		if(isset($this->opportunity_id) && $this->opportunity_id != "")
125
+		if (isset($this->opportunity_id) && $this->opportunity_id != "")
126 126
 		{
127 127
 			$query = "SELECT name from opportunities where id='$this->opportunity_id' AND deleted=0";
128
-			$result =$this->db->query($query,true," Error filling in additional detail fields: ");
128
+			$result = $this->db->query($query, true, " Error filling in additional detail fields: ");
129 129
 			// Get the id and the name.
130 130
 			$row = $this->db->fetchByAssoc($result);
131 131
 
132
-			if($row != null)
132
+			if ($row != null)
133 133
 			{
134 134
 				$this->opportunity_name = $row['name'];
135 135
 			}
Please login to merge, or discard this patch.
modules/AOR_Fields/AOR_Field.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -80,9 +80,9 @@  discard block
 block discarded – undo
80 80
     /**
81 81
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
82 82
      */
83
-    function AOR_Field(){
83
+    function AOR_Field() {
84 84
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
85
-        if(isset($GLOBALS['log'])) {
85
+        if (isset($GLOBALS['log'])) {
86 86
             $GLOBALS['log']->deprecated($deprecatedMessage);
87 87
         }
88 88
         else {
@@ -97,11 +97,11 @@  discard block
 block discarded – undo
97 97
 
98 98
         require_once('modules/AOW_WorkFlow/aow_utils.php');
99 99
 
100
-        $line_count = count($post_data[$key . 'field']);
100
+        $line_count = count($post_data[$key.'field']);
101 101
         for ($i = 0; $i < $line_count; ++$i) {
102 102
 
103
-            if ($post_data[$key . 'deleted'][$i] == 1) {
104
-                $this->mark_deleted($post_data[$key . 'id'][$i]);
103
+            if ($post_data[$key.'deleted'][$i] == 1) {
104
+                $this->mark_deleted($post_data[$key.'id'][$i]);
105 105
             } else {
106 106
                 $field = new AOR_Field();
107 107
                 $field->group_display = false;
@@ -117,22 +117,22 @@  discard block
 block discarded – undo
117 117
 
118 118
                 foreach ($this->field_defs as $field_def) {
119 119
                     $field_name = $field_def['name'];
120
-                    if (is_array($post_data[$key . $field_name])) {
121
-                        if ($field_name != 'group_display' && isset($post_data[$key . $field_name][$i])) {
122
-                            if (is_array($post_data[$key . $field_name][$i])) {
123
-                                $post_data[$key . $field_name][$i] = base64_encode(serialize($post_data[$key . $field_name][$i]));
120
+                    if (is_array($post_data[$key.$field_name])) {
121
+                        if ($field_name != 'group_display' && isset($post_data[$key.$field_name][$i])) {
122
+                            if (is_array($post_data[$key.$field_name][$i])) {
123
+                                $post_data[$key.$field_name][$i] = base64_encode(serialize($post_data[$key.$field_name][$i]));
124 124
                             } else if ($field_name == 'value') {
125
-                                $post_data[$key . $field_name][$i] = fixUpFormatting($_REQUEST['report_module'], $field->field, $post_data[$key . $field_name][$i]);
125
+                                $post_data[$key.$field_name][$i] = fixUpFormatting($_REQUEST['report_module'], $field->field, $post_data[$key.$field_name][$i]);
126 126
                             }
127 127
                             if ($field_name == 'module_path') {
128
-                                $post_data[$key . $field_name][$i] = base64_encode(serialize(explode(":", $post_data[$key . $field_name][$i])));
128
+                                $post_data[$key.$field_name][$i] = base64_encode(serialize(explode(":", $post_data[$key.$field_name][$i])));
129 129
                             }
130
-                            $field->$field_name = $post_data[$key . $field_name][$i];
130
+                            $field->$field_name = $post_data[$key.$field_name][$i];
131 131
                         }
132
-                    } else if (is_null($post_data[$key . $field_name])) {
132
+                    } else if (is_null($post_data[$key.$field_name])) {
133 133
                         // do nothing
134 134
                     } else {
135
-                        throw new Exception('illegal type in post data at key ' . $key . $field_name . ' ' . gettype($post_data[$key . $field_name]));
135
+                        throw new Exception('illegal type in post data at key '.$key.$field_name.' '.gettype($post_data[$key.$field_name]));
136 136
                     }
137 137
 
138 138
                 }
Please login to merge, or discard this patch.
modules/Cases/CasesJjwg_MapsLogicHook.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -14,9 +14,9 @@
 block discarded – undo
14 14
     /**
15 15
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
16 16
      */
17
-    function CasesJjwg_MapsLogicHook(){
17
+    function CasesJjwg_MapsLogicHook() {
18 18
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
19
-        if(isset($GLOBALS['log'])) {
19
+        if (isset($GLOBALS['log'])) {
20 20
             $GLOBALS['log']->deprecated($deprecatedMessage);
21 21
         }
22 22
         else {
Please login to merge, or discard this patch.
modules/AOR_Conditions/AOR_Condition.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -77,9 +77,9 @@  discard block
 block discarded – undo
77 77
     /**
78 78
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
79 79
      */
80
-    function AOR_Condition(){
80
+    function AOR_Condition() {
81 81
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
82
-        if(isset($GLOBALS['log'])) {
82
+        if (isset($GLOBALS['log'])) {
83 83
             $GLOBALS['log']->deprecated($deprecatedMessage);
84 84
         }
85 85
         else {
@@ -94,40 +94,40 @@  discard block
 block discarded – undo
94 94
 
95 95
         require_once('modules/AOW_WorkFlow/aow_utils.php');
96 96
 
97
-        $line_count = count($post_data[$key . 'field']);
97
+        $line_count = count($post_data[$key.'field']);
98 98
         $j = 0;
99 99
         for ($i = 0; $i < $line_count; ++$i) {
100 100
 
101
-            if ($post_data[$key . 'deleted'][$i] == 1) {
102
-                $this->mark_deleted($post_data[$key . 'id'][$i]);
101
+            if ($post_data[$key.'deleted'][$i] == 1) {
102
+                $this->mark_deleted($post_data[$key.'id'][$i]);
103 103
             } else {
104 104
                 $condition = new AOR_Condition();
105 105
                 foreach ($this->field_defs as $field_def) {
106 106
                     $field_name = $field_def['name'];
107
-                    if (isset($post_data[$key . $field_name][$i])) {
108
-                        if (is_array($post_data[$key . $field_name][$i])) {
107
+                    if (isset($post_data[$key.$field_name][$i])) {
108
+                        if (is_array($post_data[$key.$field_name][$i])) {
109 109
 
110 110
                             switch ($condition->value_type) {
111 111
                                 case 'Date':
112
-                                    $post_data[$key . $field_name][$i] = base64_encode(serialize($post_data[$key . $field_name][$i]));
112
+                                    $post_data[$key.$field_name][$i] = base64_encode(serialize($post_data[$key.$field_name][$i]));
113 113
                                     break;
114 114
                                 default:
115
-                                    $post_data[$key . $field_name][$i] = encodeMultienumValue($post_data[$key . $field_name][$i]);
115
+                                    $post_data[$key.$field_name][$i] = encodeMultienumValue($post_data[$key.$field_name][$i]);
116 116
                             }
117
-                        } else if ($field_name == 'value' && $post_data[$key . 'value_type'][$i] === 'Value') {
118
-                            $post_data[$key . $field_name][$i] = fixUpFormatting($_REQUEST['report_module'], $condition->field, $post_data[$key . $field_name][$i]);
117
+                        } else if ($field_name == 'value' && $post_data[$key.'value_type'][$i] === 'Value') {
118
+                            $post_data[$key.$field_name][$i] = fixUpFormatting($_REQUEST['report_module'], $condition->field, $post_data[$key.$field_name][$i]);
119 119
                         } else if ($field_name == 'parameter') {
120
-                            $post_data[$key . $field_name][$i] = isset($post_data[$key . $field_name][$i]);
120
+                            $post_data[$key.$field_name][$i] = isset($post_data[$key.$field_name][$i]);
121 121
                         } else if ($field_name == 'module_path') {
122
-                            $post_data[$key . $field_name][$i] = base64_encode(serialize(explode(":", $post_data[$key . $field_name][$i])));
122
+                            $post_data[$key.$field_name][$i] = base64_encode(serialize(explode(":", $post_data[$key.$field_name][$i])));
123 123
                         }
124
-                        if ($field_name == 'parenthesis' && $post_data[$key . $field_name][$i] == 'END') {
124
+                        if ($field_name == 'parenthesis' && $post_data[$key.$field_name][$i] == 'END') {
125 125
                             if (!isset($lastParenthesisStartConditionId)) {
126 126
                                 throw new Exception('a closure parenthesis has no starter pair');
127 127
                             }
128 128
                             $condition->parenthesis = $lastParenthesisStartConditionId;
129 129
                         } else {
130
-                            $condition->$field_name = $post_data[$key . $field_name][$i];
130
+                            $condition->$field_name = $post_data[$key.$field_name][$i];
131 131
                         }
132 132
                     } else if ($field_name == 'parameter') {
133 133
                         $condition->$field_name = 0;
Please login to merge, or discard this patch.
modules/jjwg_Maps/views/view.quick_radius_display.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
4 4
 
5 5
 class Jjwg_MapsViewQuick_Radius_Display extends SugarView {
6 6
 
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
13 13
      */
14
-    function Jjwg_MapsViewQuick_Radius_Display(){
14
+    function Jjwg_MapsViewQuick_Radius_Display() {
15 15
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
16
-        if(isset($GLOBALS['log'])) {
16
+        if (isset($GLOBALS['log'])) {
17 17
             $GLOBALS['log']->deprecated($deprecatedMessage);
18 18
         }
19 19
         else {
Please login to merge, or discard this patch.
modules/jjwg_Maps/views/view.geocoded_counts.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
4 4
 
5 5
 class Jjwg_MapsViewGeocoded_Counts extends SugarView {
6 6
 
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
13 13
      */
14
-    function Jjwg_MapsViewGeocoded_Counts(){
14
+    function Jjwg_MapsViewGeocoded_Counts() {
15 15
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
16
-        if(isset($GLOBALS['log'])) {
16
+        if (isset($GLOBALS['log'])) {
17 17
             $GLOBALS['log']->deprecated($deprecatedMessage);
18 18
         }
19 19
         else {
Please login to merge, or discard this patch.
modules/jjwg_Maps/views/view.quick_radius.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
4 4
 
5 5
 class Jjwg_MapsViewQuick_Radius extends SugarView {
6 6
 
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
13 13
      */
14
-    function Jjwg_MapsViewQuick_Radius(){
14
+    function Jjwg_MapsViewQuick_Radius() {
15 15
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
16
-        if(isset($GLOBALS['log'])) {
16
+        if (isset($GLOBALS['log'])) {
17 17
             $GLOBALS['log']->deprecated($deprecatedMessage);
18 18
         }
19 19
         else {
Please login to merge, or discard this patch.
modules/jjwg_Maps/views/view.geocoding_test.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
4 4
 
5 5
 class Jjwg_MapsViewGeocoding_Test extends SugarView {
6 6
 
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
13 13
      */
14
-    function Jjwg_MapsViewGeocoding_Test(){
14
+    function Jjwg_MapsViewGeocoding_Test() {
15 15
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
16
-        if(isset($GLOBALS['log'])) {
16
+        if (isset($GLOBALS['log'])) {
17 17
             $GLOBALS['log']->deprecated($deprecatedMessage);
18 18
         }
19 19
         else {
Please login to merge, or discard this patch.
modules/jjwg_Maps/views/view.map_display.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
4 4
 
5 5
 class Jjwg_MapsViewMap_Display extends SugarView {
6 6
 
@@ -11,9 +11,9 @@  discard block
 block discarded – undo
11 11
     /**
12 12
      * @deprecated deprecated since version 7.6, PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code, use __construct instead
13 13
      */
14
-    function Jjwg_MapsViewMap_Display(){
14
+    function Jjwg_MapsViewMap_Display() {
15 15
         $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code';
16
-        if(isset($GLOBALS['log'])) {
16
+        if (isset($GLOBALS['log'])) {
17 17
             $GLOBALS['log']->deprecated($deprecatedMessage);
18 18
         }
19 19
         else {
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
   function display() {
27 27
     // Limit URI query string parameters. Used to avoid URL length errors.
28 28
     $valid_names = array('action', 'module', 'entryPoint', 'submit', 'cron', 'geocoding_process', 'process_trigger', 'distance', 'unit_type', 'record', 'related_id', 'related_module', 'quick_address', 'display_module', 'list_id', 'uid', 'current_post');
29
-    $url = $GLOBALS['sugar_config']['site_url'] . '/index.php?module=' . $GLOBALS['currentModule'] . '&action=map_markers';
29
+    $url = $GLOBALS['sugar_config']['site_url'].'/index.php?module='.$GLOBALS['currentModule'].'&action=map_markers';
30 30
     foreach (array_keys($_REQUEST) as $key) {
31 31
       if (in_array($key, $valid_names) && !in_array($key, array('action', 'module', 'entryPoint'))) {
32 32
         $url .= '&'.$key.'='.urlencode($_REQUEST[$key]);
Please login to merge, or discard this patch.