@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use Psr\Log\LoggerInterface; |
| 8 | 8 | use Psr\Log\NullLogger; |
| 9 | 9 | use Wabel\Zoho\CRM\AbstractZohoDao; |
| 10 | -use Wabel\Zoho\CRM\Request\Response; |
|
| 11 | 10 | use zcrmsdk\crm\setup\users\ZCRMUser; |
| 12 | 11 | |
| 13 | 12 | /** |
@@ -86,15 +86,15 @@ discard block |
||
| 86 | 86 | $table = $schema->createTable($tableName); |
| 87 | 87 | |
| 88 | 88 | //@Temporary fix to use Mysql5.7 not strict |
| 89 | - $table->addColumn('uid', 'string', ['length' => 36,'notnull'=>false]); |
|
| 90 | - $table->addColumn('id', 'string', ['length' => 100,'notnull'=>false]); |
|
| 89 | + $table->addColumn('uid', 'string', ['length' => 36, 'notnull'=>false]); |
|
| 90 | + $table->addColumn('id', 'string', ['length' => 100, 'notnull'=>false]); |
|
| 91 | 91 | $table->addUniqueIndex(['id']); |
| 92 | 92 | $table->setPrimaryKey(['uid']); |
| 93 | 93 | |
| 94 | 94 | foreach ($dao->getFields() as $field) { |
| 95 | 95 | $columnName = $field->getName(); |
| 96 | 96 | //It seems sometime we can have the same field twice in the list of fields from the API. |
| 97 | - if($table->hasColumn($columnName)) { |
|
| 97 | + if ($table->hasColumn($columnName)) { |
|
| 98 | 98 | continue; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -105,23 +105,23 @@ discard block |
||
| 105 | 105 | switch ($field->getType()) { |
| 106 | 106 | case 'fileupload': |
| 107 | 107 | $type = 'string'; |
| 108 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 255; |
|
| 108 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 255; |
|
| 109 | 109 | break; |
| 110 | 110 | case 'lookup': |
| 111 | 111 | $type = 'string'; |
| 112 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 100; |
|
| 112 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 100; |
|
| 113 | 113 | $index = true; |
| 114 | 114 | break; |
| 115 | 115 | case 'userlookup': |
| 116 | 116 | case 'ownerlookup': |
| 117 | 117 | $type = 'string'; |
| 118 | 118 | $index = true; |
| 119 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 25; |
|
| 119 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 25; |
|
| 120 | 120 | break; |
| 121 | 121 | case 'formula': |
| 122 | 122 | // Note: a Formula can return any type, but we have no way to know which type it returns... |
| 123 | 123 | $type = 'string'; |
| 124 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 100; |
|
| 124 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 100; |
|
| 125 | 125 | break; |
| 126 | 126 | case 'datetime': |
| 127 | 127 | $type = 'datetime'; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | case 'picklist': |
| 146 | 146 | case 'website': |
| 147 | 147 | $type = 'string'; |
| 148 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 255; |
|
| 148 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 255; |
|
| 149 | 149 | break; |
| 150 | 150 | case 'multiselectlookup': |
| 151 | 151 | case 'multiuserlookup': |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | case 'autonumber': |
| 162 | 162 | case 'integer': |
| 163 | 163 | $type = 'integer'; |
| 164 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 255; |
|
| 164 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 255; |
|
| 165 | 165 | break; |
| 166 | 166 | case 'currency': |
| 167 | 167 | case 'decimal': |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $schema = new Schema(); |
| 214 | 214 | $table = $schema->createTable($tableName); |
| 215 | 215 | |
| 216 | - $table->addColumn('id', 'string', ['length' => 100,'notnull'=>false]); |
|
| 216 | + $table->addColumn('id', 'string', ['length' => 100, 'notnull'=>false]); |
|
| 217 | 217 | $table->setPrimaryKey(['id']); |
| 218 | 218 | foreach (ZCRMUser::$defaultKeys as $field) { |
| 219 | 219 | if ($field === 'id') { |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $this->zohoDatabaseModelSync = $zohoDatabaseModelSync; |
| 102 | 102 | $this->zohoDatabaseCopier = $zohoDatabaseCopier; |
| 103 | 103 | $this->zohoDatabaseSync = $zohoDatabaseSync; |
| 104 | - $this->zohoEntitiesGenerator = $zohoEntitiesGenerator; |
|
| 104 | + $this->zohoEntitiesGenerator = $zohoEntitiesGenerator; |
|
| 105 | 105 | $this->zohoClient = $zohoClient; |
| 106 | 106 | $this->pathZohoDaos = $pathZohoDaos; |
| 107 | 107 | $this->namespaceZohoDaos = $namespaceZohoDaos; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | if ($input->getOption('log-path') && $input->getOption('clear-logs')) { |
| 138 | 138 | $this->logger->info('Clearing logs...'); |
| 139 | 139 | $path = $input->getOption('log-path'); |
| 140 | - $logFile = $path . '/ZCRMClientLibrary.log'; |
|
| 140 | + $logFile = $path.'/ZCRMClientLibrary.log'; |
|
| 141 | 141 | if (file_exists($logFile)) { |
| 142 | 142 | if (is_writable($logFile)) { |
| 143 | 143 | if (file_put_contents($logFile, '') === false) { |
@@ -151,7 +151,7 @@ discard block |
||
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | - if(!$input->getOption('limit')) { |
|
| 154 | + if (!$input->getOption('limit')) { |
|
| 155 | 155 | ini_set('memory_limit', '-1'); |
| 156 | 156 | } |
| 157 | 157 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | if ($input->getOption('log-path') && $input->getOption('dump-logs')) { |
| 177 | 177 | $this->logger->info('Dumping logs...'); |
| 178 | 178 | $path = $input->getOption('log-path'); |
| 179 | - $logFile = $path . '/ZCRMClientLibrary.log'; |
|
| 179 | + $logFile = $path.'/ZCRMClientLibrary.log'; |
|
| 180 | 180 | if (file_exists($logFile)) { |
| 181 | 181 | if (is_readable($logFile)) { |
| 182 | 182 | $this->logger->info(file_get_contents($logFile)); |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | { |
| 286 | 286 | $this->logger->info('Start to synchronize Zoho data into Zoho CRM.'); |
| 287 | 287 | foreach ($this->zohoDaos as $zohoDao) { |
| 288 | - if($zohoDao->getFieldFromFieldName('createdTime')) { |
|
| 288 | + if ($zohoDao->getFieldFromFieldName('createdTime')) { |
|
| 289 | 289 | $this->zohoDatabaseSync->pushToZoho($zohoDao); |
| 290 | 290 | } |
| 291 | 291 | } |