@@ -250,8 +250,7 @@ discard block |
||
| 250 | 250 | $param = new TResultSetListItemParameter($obj, $parameter, $list); |
| 251 | 251 | $this->raiseRowDelegate($delegate, $param); |
| 252 | 252 | } |
| 253 | - } |
|
| 254 | - else |
|
| 253 | + } else |
|
| 255 | 254 | { |
| 256 | 255 | //var_dump($sql,$parameter); |
| 257 | 256 | foreach($reader as $row) |
@@ -327,8 +326,7 @@ discard block |
||
| 327 | 326 | $param = new TResultSetMapItemParameter($key, $value, $parameter, $map); |
| 328 | 327 | $this->raiseRowDelegate($delegate, $param); |
| 329 | 328 | } |
| 330 | - } |
|
| 331 | - else |
|
| 329 | + } else |
|
| 332 | 330 | { |
| 333 | 331 | //while($row = $recordSet->fetchRow()) |
| 334 | 332 | foreach($reader as $row) |
@@ -354,8 +352,7 @@ discard block |
||
| 354 | 352 | if(is_string($handler)) |
| 355 | 353 | { |
| 356 | 354 | call_user_func($handler, $this, $param); |
| 357 | - } |
|
| 358 | - elseif(is_callable($handler, true)) |
|
| 355 | + } elseif(is_callable($handler, true)) |
|
| 359 | 356 | { |
| 360 | 357 | // an array: 0 - object, 1 - method name/path |
| 361 | 358 | list($object, $method) = $handler; |
@@ -370,8 +367,7 @@ discard block |
||
| 370 | 367 | } |
| 371 | 368 | $object->$method($this, $param); |
| 372 | 369 | } |
| 373 | - } |
|
| 374 | - else |
|
| 370 | + } else |
|
| 375 | 371 | throw new TInvalidDataValueException('sqlmap_invalid_delegate', $this->getID(), $handler); |
| 376 | 372 | } |
| 377 | 373 | |
@@ -533,8 +529,7 @@ discard block |
||
| 533 | 529 | if($method == self::QUERY_FOR_ARRAY) |
| 534 | 530 | $values = $values->toArray(); |
| 535 | 531 | TPropertyAccess::set($resultObject, $property, $values); |
| 536 | - } |
|
| 537 | - elseif($method == self::QUERY_FOR_OBJECT) |
|
| 532 | + } elseif($method == self::QUERY_FOR_OBJECT) |
|
| 538 | 533 | { |
| 539 | 534 | $value = $statement->executeQueryForObject($connection, $keys, null); |
| 540 | 535 | TPropertyAccess::set($resultObject, $property, $value); |
@@ -664,8 +659,7 @@ discard block |
||
| 664 | 659 | else |
| 665 | 660 | foreach($resultMap->getColumns() as $property) |
| 666 | 661 | $this->setObjectProperty($resultMap, $property, $row, $resultObject); |
| 667 | - } |
|
| 668 | - else |
|
| 662 | + } else |
|
| 669 | 663 | { |
| 670 | 664 | $resultObject = $this->fillDefaultResultMap($resultMap, $row, $resultObject); |
| 671 | 665 | } |
@@ -810,8 +804,7 @@ discard block |
||
| 810 | 804 | if($key === '') |
| 811 | 805 | { |
| 812 | 806 | $resultObject = $property->getPropertyValue($registry, $row); |
| 813 | - } |
|
| 814 | - elseif(strlen($select) == 0 && ($nested === null)) |
|
| 807 | + } elseif(strlen($select) == 0 && ($nested === null)) |
|
| 815 | 808 | { |
| 816 | 809 | $value = $property->getPropertyValue($registry, $row); |
| 817 | 810 | |
@@ -820,8 +813,7 @@ discard block |
||
| 820 | 813 | TPropertyAccess::set($resultObject, $key, $value); |
| 821 | 814 | else |
| 822 | 815 | $resultObject = $value; |
| 823 | - } |
|
| 824 | - elseif($nested !== null) |
|
| 816 | + } elseif($nested !== null) |
|
| 825 | 817 | { |
| 826 | 818 | if($property->instanceOfListType($resultObject) || $property->instanceOfArrayType($resultObject)) |
| 827 | 819 | { |
@@ -829,16 +821,14 @@ discard block |
||
| 829 | 821 | throw new TSqlMapExecutionException( |
| 830 | 822 | 'sqlmap_non_groupby_array_list_type', $resultMap->getID(), |
| 831 | 823 | get_class($resultObject), $key); |
| 832 | - } |
|
| 833 | - else |
|
| 824 | + } else |
|
| 834 | 825 | { |
| 835 | 826 | $obj = $nested->createInstanceOfResult($this->getManager()->getTypeHandlers()); |
| 836 | 827 | if($this->fillPropertyWithResultMap($nested, $row, $obj) == false) |
| 837 | 828 | $obj = null; |
| 838 | 829 | TPropertyAccess::set($resultObject, $key, $obj); |
| 839 | 830 | } |
| 840 | - } |
|
| 841 | - else //'select' ResultProperty |
|
| 831 | + } else //'select' ResultProperty |
|
| 842 | 832 | { |
| 843 | 833 | $this->enquequePostSelect($select, $resultMap, $property, $row, $resultObject); |
| 844 | 834 | } |
@@ -870,11 +860,9 @@ discard block |
||
| 870 | 860 | $values = TLazyLoadList::newInstance($statement, $key, |
| 871 | 861 | $resultObject, $property->getProperty()); |
| 872 | 862 | TPropertyAccess::set($resultObject, $property->getProperty(), $values); |
| 873 | - } |
|
| 874 | - else |
|
| 863 | + } else |
|
| 875 | 864 | $postSelect->setMethod(self::QUERY_FOR_LIST); |
| 876 | - } |
|
| 877 | - elseif($property->instanceOfArrayType($resultObject)) |
|
| 865 | + } elseif($property->instanceOfArrayType($resultObject)) |
|
| 878 | 866 | $postSelect->setMethod(self::QUERY_FOR_ARRAY); |
| 879 | 867 | else |
| 880 | 868 | $postSelect->setMethod(self::QUERY_FOR_OBJECT); |
@@ -902,8 +890,7 @@ discard block |
||
| 902 | 890 | $keys[trim($pair[0])] = $row[trim($pair[1])]; |
| 903 | 891 | } |
| 904 | 892 | return $keys; |
| 905 | - } |
|
| 906 | - else |
|
| 893 | + } else |
|
| 907 | 894 | { |
| 908 | 895 | $registry = $this->getManager()->getTypeHandlers(); |
| 909 | 896 | return $property->getPropertyValue($registry, $row); |
@@ -135,28 +135,24 @@ |
||
| 135 | 135 | { |
| 136 | 136 | $param->setData($data); |
| 137 | 137 | $this->_nextPageList = null; |
| 138 | - } |
|
| 139 | - else |
|
| 138 | + } else |
|
| 140 | 139 | { |
| 141 | 140 | $param->setData(array_slice($data, 0, $pageSize)); |
| 142 | 141 | $this->_nextPageList = array_slice($data, $pageSize - 1, $total); |
| 143 | 142 | } |
| 144 | - } |
|
| 145 | - else |
|
| 143 | + } else |
|
| 146 | 144 | { |
| 147 | 145 | if($total <= $pageSize) |
| 148 | 146 | { |
| 149 | 147 | $this->_prevPageList = array_slice($data, 0, $total); |
| 150 | 148 | $param->setData([]); |
| 151 | 149 | $this->_nextPageList = null; |
| 152 | - } |
|
| 153 | - elseif($total <= $pageSize * 2) |
|
| 150 | + } elseif($total <= $pageSize * 2) |
|
| 154 | 151 | { |
| 155 | 152 | $this->_prevPageList = array_slice($data, 0, $pageSize); |
| 156 | 153 | $param->setData(array_slice($data, $pageSize, $total)); |
| 157 | 154 | $this->_nextPageList = null; |
| 158 | - } |
|
| 159 | - else |
|
| 155 | + } else |
|
| 160 | 156 | { |
| 161 | 157 | $this->_prevPageList = array_slice($data, 0, $pageSize); |
| 162 | 158 | $param->setData(array_slice($data, $pageSize, $pageSize)); |
@@ -196,8 +196,7 @@ discard block |
||
| 196 | 196 | $this->_pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
| 197 | 197 | $this->_active = true; |
| 198 | 198 | $this->setConnectionCharset(); |
| 199 | - } |
|
| 200 | - catch(PDOException $e) |
|
| 199 | + } catch(PDOException $e) |
|
| 201 | 200 | { |
| 202 | 201 | throw new TDbException('dbconnection_open_failed', $e->getMessage()); |
| 203 | 202 | } |
@@ -350,8 +349,7 @@ discard block |
||
| 350 | 349 | { |
| 351 | 350 | $this->_pdo->beginTransaction(); |
| 352 | 351 | return $this->_transaction = Prado::createComponent($this->getTransactionClass(), $this); |
| 353 | - } |
|
| 354 | - else |
|
| 352 | + } else |
|
| 355 | 353 | throw new TDbException('dbconnection_connection_inactive'); |
| 356 | 354 | } |
| 357 | 355 | |
@@ -332,8 +332,7 @@ discard block |
||
| 332 | 332 | { |
| 333 | 333 | $configFile = $basePath; |
| 334 | 334 | $basePath = dirname($configFile); |
| 335 | - } |
|
| 336 | - else |
|
| 335 | + } else |
|
| 337 | 336 | $configFile = null; |
| 338 | 337 | |
| 339 | 338 | // determine runtime path |
@@ -353,8 +352,7 @@ discard block |
||
| 353 | 352 | } |
| 354 | 353 | $this->setBasePath($basePath); |
| 355 | 354 | $this->setRuntimePath($runtimePath); |
| 356 | - } |
|
| 357 | - else |
|
| 355 | + } else |
|
| 358 | 356 | throw new TConfigurationException('application_runtimepath_invalid', $runtimePath); |
| 359 | 357 | |
| 360 | 358 | } |
@@ -383,8 +381,7 @@ discard block |
||
| 383 | 381 | $this->$method(); |
| 384 | 382 | $this->_step++; |
| 385 | 383 | } |
| 386 | - } |
|
| 387 | - catch(\Exception $e) |
|
| 384 | + } catch(\Exception $e) |
|
| 388 | 385 | { |
| 389 | 386 | $this->onError($e); |
| 390 | 387 | } |
@@ -985,8 +982,7 @@ discard block |
||
| 985 | 982 | foreach($parameter[1] as $name => $value) |
| 986 | 983 | $component->setSubProperty($name, $value); |
| 987 | 984 | $this->_parameters->add($id, $component); |
| 988 | - } |
|
| 989 | - else |
|
| 985 | + } else |
|
| 990 | 986 | $this->_parameters->add($id, $parameter); |
| 991 | 987 | } |
| 992 | 988 | |
@@ -1045,8 +1041,7 @@ discard block |
||
| 1045 | 1041 | $config->loadFromFile($this->_configFile); |
| 1046 | 1042 | if($this->_cacheFile !== null) |
| 1047 | 1043 | file_put_contents($this->_cacheFile, serialize($config), LOCK_EX); |
| 1048 | - } |
|
| 1049 | - else |
|
| 1044 | + } else |
|
| 1050 | 1045 | $config = unserialize(file_get_contents($this->_cacheFile)); |
| 1051 | 1046 | |
| 1052 | 1047 | $this->applyConfiguration($config, false); |
@@ -1091,8 +1086,7 @@ discard block |
||
| 1091 | 1086 | } |
| 1092 | 1087 | |
| 1093 | 1088 | $service->init($configElement); |
| 1094 | - } |
|
| 1095 | - else |
|
| 1089 | + } else |
|
| 1096 | 1090 | throw new THttpException(500, 'application_service_unknown', $serviceID); |
| 1097 | 1091 | } |
| 1098 | 1092 | |
@@ -550,8 +550,7 @@ discard block |
||
| 550 | 550 | } |
| 551 | 551 | if($callchain->getCount() > 0) |
| 552 | 552 | return call_user_func_array([$callchain,'call'], $args); |
| 553 | - } |
|
| 554 | - else |
|
| 553 | + } else |
|
| 555 | 554 | { |
| 556 | 555 | foreach($this->_m->toArray() as $behavior) |
| 557 | 556 | { |
@@ -608,29 +607,25 @@ discard block |
||
| 608 | 607 | { |
| 609 | 608 | // getting a property |
| 610 | 609 | return $this->$getter(); |
| 611 | - } |
|
| 612 | - elseif(method_exists($this, $jsgetter = 'getjs' . $name)) |
|
| 610 | + } elseif(method_exists($this, $jsgetter = 'getjs' . $name)) |
|
| 613 | 611 | { |
| 614 | 612 | // getting a javascript property |
| 615 | 613 | return (string)$this->$jsgetter(); |
| 616 | - } |
|
| 617 | - elseif(strncasecmp($name, 'on', 2) === 0 && method_exists($this, $name)) |
|
| 614 | + } elseif(strncasecmp($name, 'on', 2) === 0 && method_exists($this, $name)) |
|
| 618 | 615 | { |
| 619 | 616 | // getting an event (handler list) |
| 620 | 617 | $name = strtolower($name); |
| 621 | 618 | if(!isset($this->_e[$name])) |
| 622 | 619 | $this->_e[$name] = new TPriorityList; |
| 623 | 620 | return $this->_e[$name]; |
| 624 | - } |
|
| 625 | - elseif(strncasecmp($name, 'fx', 2) === 0) |
|
| 621 | + } elseif(strncasecmp($name, 'fx', 2) === 0) |
|
| 626 | 622 | { |
| 627 | 623 | // getting a global event (handler list) |
| 628 | 624 | $name = strtolower($name); |
| 629 | 625 | if(!isset(self::$_ue[$name])) |
| 630 | 626 | self::$_ue[$name] = new TPriorityList; |
| 631 | 627 | return self::$_ue[$name]; |
| 632 | - } |
|
| 633 | - elseif($this->_behaviorsenabled) |
|
| 628 | + } elseif($this->_behaviorsenabled) |
|
| 634 | 629 | { |
| 635 | 630 | // getting a behavior property/event (handler list) |
| 636 | 631 | if(isset($this->_m[$name])) |
@@ -670,18 +665,15 @@ discard block |
||
| 670 | 665 | if(strncasecmp($name, 'js', 2) === 0 && $value && !($value instanceof TJavaScriptLiteral)) |
| 671 | 666 | $value = new TJavaScriptLiteral($value); |
| 672 | 667 | return $this->$setter($value); |
| 673 | - } |
|
| 674 | - elseif(method_exists($this, $jssetter = 'setjs' . $name)) |
|
| 668 | + } elseif(method_exists($this, $jssetter = 'setjs' . $name)) |
|
| 675 | 669 | { |
| 676 | 670 | if($value && !($value instanceof TJavaScriptString)) |
| 677 | 671 | $value = new TJavaScriptString($value); |
| 678 | 672 | return $this->$jssetter($value); |
| 679 | - } |
|
| 680 | - elseif((strncasecmp($name, 'on', 2) === 0 && method_exists($this, $name)) || strncasecmp($name, 'fx', 2) === 0) |
|
| 673 | + } elseif((strncasecmp($name, 'on', 2) === 0 && method_exists($this, $name)) || strncasecmp($name, 'fx', 2) === 0) |
|
| 681 | 674 | { |
| 682 | 675 | return $this->attachEventHandler($name, $value); |
| 683 | - } |
|
| 684 | - elseif($this->_m !== null && $this->_m->getCount() > 0 && $this->_behaviorsenabled) |
|
| 676 | + } elseif($this->_m !== null && $this->_m->getCount() > 0 && $this->_behaviorsenabled) |
|
| 685 | 677 | { |
| 686 | 678 | $sets = 0; |
| 687 | 679 | foreach($this->_m->toArray() as $behavior) |
@@ -699,8 +691,7 @@ discard block |
||
| 699 | 691 | if(method_exists($this, 'get' . $name) || method_exists($this, 'getjs' . $name)) |
| 700 | 692 | { |
| 701 | 693 | throw new TInvalidOperationException('component_property_readonly', get_class($this), $name); |
| 702 | - } |
|
| 703 | - else |
|
| 694 | + } else |
|
| 704 | 695 | { |
| 705 | 696 | throw new TInvalidOperationException('component_property_undefined', get_class($this), $name); |
| 706 | 697 | } |
@@ -728,13 +719,11 @@ discard block |
||
| 728 | 719 | { |
| 729 | 720 | $name = strtolower($name); |
| 730 | 721 | return isset($this->_e[$name]) && $this->_e[$name]->getCount(); |
| 731 | - } |
|
| 732 | - elseif(strncasecmp($name, 'fx', 2) === 0) |
|
| 722 | + } elseif(strncasecmp($name, 'fx', 2) === 0) |
|
| 733 | 723 | { |
| 734 | 724 | $name = strtolower($name); |
| 735 | 725 | return isset(self::$_ue[$name]) && self::$_ue[$name]->getCount(); |
| 736 | - } |
|
| 737 | - elseif($this->_m !== null && $this->_m->getCount() > 0 && $this->_behaviorsenabled) |
|
| 726 | + } elseif($this->_m !== null && $this->_m->getCount() > 0 && $this->_behaviorsenabled) |
|
| 738 | 727 | { |
| 739 | 728 | if(isset($this->_m[$name])) |
| 740 | 729 | return true; |
@@ -744,8 +733,7 @@ discard block |
||
| 744 | 733 | return isset($behavior->$name); |
| 745 | 734 | } |
| 746 | 735 | |
| 747 | - } |
|
| 748 | - else |
|
| 736 | + } else |
|
| 749 | 737 | return false; |
| 750 | 738 | } |
| 751 | 739 | |
@@ -959,15 +947,13 @@ discard block |
||
| 959 | 947 | if(!isset($this->_e[$name])) |
| 960 | 948 | $this->_e[$name] = new TPriorityList; |
| 961 | 949 | return $this->_e[$name]; |
| 962 | - } |
|
| 963 | - elseif(strncasecmp($name, 'fx', 2) === 0) |
|
| 950 | + } elseif(strncasecmp($name, 'fx', 2) === 0) |
|
| 964 | 951 | { |
| 965 | 952 | $name = strtolower($name); |
| 966 | 953 | if(!isset(self::$_ue[$name])) |
| 967 | 954 | self::$_ue[$name] = new TPriorityList; |
| 968 | 955 | return self::$_ue[$name]; |
| 969 | - } |
|
| 970 | - elseif($this->_m !== null && $this->_behaviorsenabled) |
|
| 956 | + } elseif($this->_m !== null && $this->_behaviorsenabled) |
|
| 971 | 957 | { |
| 972 | 958 | foreach($this->_m->toArray() as $behavior) |
| 973 | 959 | { |
@@ -1046,8 +1032,7 @@ discard block |
||
| 1046 | 1032 | { |
| 1047 | 1033 | $this->getEventHandlers($name)->remove($handler, $priority); |
| 1048 | 1034 | return true; |
| 1049 | - } |
|
| 1050 | - catch(\Exception $e) |
|
| 1035 | + } catch(\Exception $e) |
|
| 1051 | 1036 | { |
| 1052 | 1037 | } |
| 1053 | 1038 | } |
@@ -1170,14 +1155,11 @@ discard block |
||
| 1170 | 1155 | $response = $object->__dycall($name, [$sender,$param,$name]); |
| 1171 | 1156 | else |
| 1172 | 1157 | $response = $object->$method($sender, $param, $name); |
| 1173 | - } |
|
| 1174 | - else |
|
| 1158 | + } else |
|
| 1175 | 1159 | throw new TInvalidDataValueException('component_eventhandler_invalid', get_class($this), $name, $handler); |
| 1176 | - } |
|
| 1177 | - else |
|
| 1160 | + } else |
|
| 1178 | 1161 | $response = call_user_func($handler, $sender, $param, $name); |
| 1179 | - } |
|
| 1180 | - elseif(is_callable($handler, true)) |
|
| 1162 | + } elseif(is_callable($handler, true)) |
|
| 1181 | 1163 | { |
| 1182 | 1164 | list($object, $method) = $handler; |
| 1183 | 1165 | if(is_string($object)) |
@@ -1195,12 +1177,10 @@ discard block |
||
| 1195 | 1177 | $response = $object->__dycall($name, [$sender,$param,$name]); |
| 1196 | 1178 | else |
| 1197 | 1179 | $response = $object->$method($sender, $param, $name); |
| 1198 | - } |
|
| 1199 | - else |
|
| 1180 | + } else |
|
| 1200 | 1181 | throw new TInvalidDataValueException('component_eventhandler_invalid', get_class($this), $name, $handler[1]); |
| 1201 | 1182 | } |
| 1202 | - } |
|
| 1203 | - else |
|
| 1183 | + } else |
|
| 1204 | 1184 | throw new TInvalidDataValueException('component_eventhandler_invalid', get_class($this), $name, gettype($handler)); |
| 1205 | 1185 | |
| 1206 | 1186 | $this->dyIntraRaiseEventPostHandler($name, $sender, $param, $handler, $response); |
@@ -1217,8 +1197,7 @@ discard block |
||
| 1217 | 1197 | $param = $response; |
| 1218 | 1198 | |
| 1219 | 1199 | } |
| 1220 | - } |
|
| 1221 | - elseif(strncasecmp($name, 'on', 2) === 0 && !$this->hasEvent($name)) |
|
| 1200 | + } elseif(strncasecmp($name, 'on', 2) === 0 && !$this->hasEvent($name)) |
|
| 1222 | 1201 | throw new TInvalidOperationException('component_event_undefined', get_class($this), $name); |
| 1223 | 1202 | |
| 1224 | 1203 | if($responsetype & TEventResults::EVENT_RESULT_FILTER) |
@@ -1254,8 +1233,7 @@ discard block |
||
| 1254 | 1233 | if(eval("\$result=$expression;") === false) |
| 1255 | 1234 | throw new \Exception(''); |
| 1256 | 1235 | return $result; |
| 1257 | - } |
|
| 1258 | - catch(\Exception $e) |
|
| 1236 | + } catch(\Exception $e) |
|
| 1259 | 1237 | { |
| 1260 | 1238 | throw new TInvalidOperationException('component_expression_invalid', get_class($this), $expression, $e->getMessage()); |
| 1261 | 1239 | } |
@@ -1289,8 +1267,7 @@ discard block |
||
| 1289 | 1267 | $content = ob_get_contents(); |
| 1290 | 1268 | ob_end_clean(); |
| 1291 | 1269 | return $content; |
| 1292 | - } |
|
| 1293 | - catch(\Exception $e) |
|
| 1270 | + } catch(\Exception $e) |
|
| 1294 | 1271 | { |
| 1295 | 1272 | throw new TInvalidOperationException('component_statements_invalid', get_class($this), $statements, $e->getMessage()); |
| 1296 | 1273 | } |
@@ -103,8 +103,7 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | $valid |= $action->performAction($args); |
| 105 | 105 | break; |
| 106 | - } |
|
| 107 | - else |
|
| 106 | + } else |
|
| 108 | 107 | { |
| 109 | 108 | $valid = false; |
| 110 | 109 | } |
@@ -205,8 +204,7 @@ discard block |
||
| 205 | 204 | } |
| 206 | 205 | |
| 207 | 206 | return Prado::getApplication(); |
| 208 | - } |
|
| 209 | - else |
|
| 207 | + } else |
|
| 210 | 208 | { |
| 211 | 209 | PradoCommandLineInterpreter::printGreeting(); |
| 212 | 210 | echo '+' . str_repeat('-', 77) . "+\n"; |
@@ -554,8 +552,7 @@ discard block |
||
| 554 | 552 | { |
| 555 | 553 | echo '** Unable to find table or view "' . $tablename . '" in "' . $manager->getDbConnection()->getConnectionString() . "\".\n"; |
| 556 | 554 | return false; |
| 557 | - } |
|
| 558 | - else |
|
| 555 | + } else |
|
| 559 | 556 | { |
| 560 | 557 | $properties = []; |
| 561 | 558 | foreach($tableInfo->getColumns() as $field => $column) |
@@ -699,8 +696,7 @@ discard block |
||
| 699 | 696 | $args = [$input[0],$input[1], $input[2],$app_dir,'soap']; |
| 700 | 697 | $cmd = new PradoCommandLineActiveRecordGen; |
| 701 | 698 | $cmd->performAction($args); |
| 702 | - } |
|
| 703 | - else |
|
| 699 | + } else |
|
| 704 | 700 | { |
| 705 | 701 | echo "\n Usage: generate table_name Application.pages.RecordClassName\n"; |
| 706 | 702 | } |