Completed
Push — master ( 013938...7af465 )
by Thierry
02:34
created
src/Response/Response.php 1 patch
Doc Comments   +49 added lines, -50 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
      * @param array         $aAttributes        Associative array of attributes that will describe the command
156 156
      * @param mixed            $mData                The data to be associated with this command
157 157
      *
158
-     * @return \Jaxon\Plugin\Response
158
+     * @return Response
159 159
      */
160 160
     public function addCommand($aAttributes, $mData)
161 161
     {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     /**
197 197
      * Clear all the commands already added to the response
198 198
      *
199
-     * @return \Jaxon\Plugin\Response
199
+     * @return Response
200 200
      */
201 201
     public function clearCommands()
202 202
     {
@@ -210,9 +210,9 @@  discard block
 block discarded – undo
210 210
      *
211 211
      * @param \Jaxon\Plugin\Plugin  $xPlugin            The plugin object
212 212
      * @param array                 $aAttributes        The attributes for this response command
213
-     * @param mixed                 $mData              The data to be sent with this command
213
+     * @param string                 $mData              The data to be sent with this command
214 214
      *
215
-     * @return \Jaxon\Plugin\Response
215
+     * @return Response
216 216
      */
217 217
     public function addPluginCommand($xPlugin, $aAttributes, $mData)
218 218
     {
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
      * @param integer        $iCmdNumber            The number of commands to skip upon cancel
274 274
      * @param string        $sMessage            The message to display to the user
275 275
      *
276
-     * @return \Jaxon\Plugin\Response
276
+     * @return Response
277 277
      */
278 278
     public function confirmCommands($iCmdNumber, $sMessage)
279 279
     {
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
      * @param string        $sAttribute           The attribute to be assigned
294 294
      * @param string        $sData                The value to be assigned to the attribute
295 295
      *
296
-     * @return \Jaxon\Plugin\Response
296
+     * @return Response
297 297
      */
298 298
     public function assign($sTarget, $sAttribute, $sData)
299 299
     {
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
      * @param string        $sTarget              The id of the html element on the browser
316 316
      * @param string        $sData                The value to be assigned to the attribute
317 317
      *
318
-     * @return \Jaxon\Plugin\Response
318
+     * @return Response
319 319
      */
320 320
     public function html($sTarget, $sData)
321 321
     {
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
      * @param string        $sAttribute            The name of the attribute to be appended to
330 330
      * @param string        $sData                The data to be appended to the attribute
331 331
      *
332
-     * @return \Jaxon\Plugin\Response
332
+     * @return Response
333 333
      */
334 334
     public function append($sTarget, $sAttribute, $sData)
335 335
     {    
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
      * @param string        $sAttribute            The name of the attribute to be prepended to
351 351
      * @param string        $sData                The value to be prepended to the attribute
352 352
      *
353
-     * @return \Jaxon\Plugin\Response
353
+     * @return Response
354 354
      */
355 355
     public function prepend($sTarget, $sAttribute, $sData)
356 356
     {
@@ -372,7 +372,7 @@  discard block
 block discarded – undo
372 372
      * @param string        $sSearch            The needle to search for
373 373
      * @param string        $sData                The data to use in place of the needle
374 374
      *
375
-     * @return \Jaxon\Plugin\Response
375
+     * @return Response
376 376
      */
377 377
     public function replace($sTarget, $sAttribute, $sSearch, $sData)
378 378
     {
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
      * @param string        $sTarget            The id of the element to be updated.
396 396
      * @param string        $sAttribute            The attribute to be cleared
397 397
      *
398
-     * @return \Jaxon\Plugin\Response
398
+     * @return Response
399 399
      */
400 400
     public function clear($sTarget, $sAttribute)
401 401
     {
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
      * @param string        $sAttribute            The attribute to be updated
412 412
      * @param string        $sData                The value to assign
413 413
      *
414
-     * @return \Jaxon\Plugin\Response
414
+     * @return Response
415 415
      */
416 416
     public function contextAssign($sAttribute, $sData)
417 417
     {
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
      * @param string        $sAttribute            The attribute to be appended to
434 434
      * @param string        $sData                The value to append
435 435
      *
436
-     * @return \Jaxon\Plugin\Response
436
+     * @return Response
437 437
      */
438 438
     public function contextAppend($sAttribute, $sData)
439 439
     {
@@ -455,7 +455,7 @@  discard block
 block discarded – undo
455 455
      * @param string        $sAttribute            The attribute to be updated
456 456
      * @param string        $sData                The value to be prepended
457 457
      *
458
-     * @return \Jaxon\Plugin\Response
458
+     * @return Response
459 459
      */
460 460
     public function contextPrepend($sAttribute, $sData)
461 461
     {
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
      *
477 477
      * @param string        $sAttribute            The attribute to be cleared
478 478
      *
479
-     * @return \Jaxon\Plugin\Response
479
+     * @return Response
480 480
      */
481 481
     public function contextClear($sAttribute)
482 482
     {
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
      *
489 489
      * @param string        $sMessage            The message to be displayed
490 490
      *
491
-     * @return \Jaxon\Plugin\Response
491
+     * @return Response
492 492
      */
493 493
     public function alert($sMessage)
494 494
     {
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
      *
506 506
      * @param string        $sMessage            The message to be displayed
507 507
      *
508
-     * @return \Jaxon\Plugin\Response
508
+     * @return Response
509 509
      */
510 510
     public function debug($sMessage)
511 511
     {
@@ -523,7 +523,7 @@  discard block
 block discarded – undo
523 523
      * @param string        $sURL                The relative or fully qualified URL
524 524
      * @param integer        $iDelay                Number of seconds to delay before the redirect occurs
525 525
      *
526
-     * @return \Jaxon\Plugin\Response
526
+     * @return Response
527 527
      */
528 528
     public function redirect($sURL, $iDelay=0)
529 529
     {
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
      *
577 577
      * @param string        $sJS                The script to execute
578 578
      *
579
-     * @return \Jaxon\Plugin\Response
579
+     * @return Response
580 580
      */
581 581
     public function script($sJS)
582 582
     {
@@ -593,7 +593,7 @@  discard block
 block discarded – undo
593 593
      *
594 594
      * @param string        $sFunc                The name of the function to call
595 595
      *
596
-     * @return \Jaxon\Plugin\Response
596
+     * @return Response
597 597
      */
598 598
     public function call($sFunc)
599 599
     {
@@ -613,7 +613,7 @@  discard block
 block discarded – undo
613 613
      *
614 614
      * @param string        $sTarget            The id of the element to be removed
615 615
      *
616
-     * @return \Jaxon\Plugin\Response
616
+     * @return Response
617 617
      */
618 618
     public function remove($sTarget)
619 619
     {
@@ -633,7 +633,7 @@  discard block
 block discarded – undo
633 633
      * @param string        $sTag                The tag name to be used for the new element
634 634
      * @param string        $sId                The id to assign to the new element
635 635
      *
636
-     * @return \Jaxon\Plugin\Response
636
+     * @return Response
637 637
      */
638 638
     public function create($sParent, $sTag, $sId)
639 639
     {
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
      * @param string        $sTag                The tag name to be used for the new element
655 655
      * @param string        $sId                The id to assign to the new element
656 656
      *
657
-     * @return \Jaxon\Plugin\Response
657
+     * @return Response
658 658
      */
659 659
     public function insert($sBefore, $sTag, $sId)
660 660
     {
@@ -671,11 +671,10 @@  discard block
 block discarded – undo
671 671
     /**
672 672
      * Add a command to insert a new element after the specified
673 673
      *
674
-     * @param string        $sBefore            The id of the element used as a reference point for the insertion
675 674
      * @param string        $sTag                The tag name to be used for the new element
676 675
      * @param string        $sId                The id to assign to the new element
677 676
      *
678
-     * @return \Jaxon\Plugin\Response
677
+     * @return Response
679 678
      */
680 679
     public function insertAfter($sAfter, $sTag, $sId)
681 680
     {
@@ -697,7 +696,7 @@  discard block
 block discarded – undo
697 696
      * @param string        $sName                The name of the new input element
698 697
      * @param string        $sId                The id of the new element
699 698
      *
700
-     * @return \Jaxon\Plugin\Response
699
+     * @return Response
701 700
      */
702 701
     public function createInput($sParent, $sType, $sName, $sId)
703 702
     {
@@ -720,7 +719,7 @@  discard block
 block discarded – undo
720 719
      * @param string        $sName                The name of the new input element
721 720
      * @param string        $sId                The id of the new element
722 721
      *
723
-     * @return \Jaxon\Plugin\Response
722
+     * @return Response
724 723
      */
725 724
     public function insertInput($sBefore, $sType, $sName, $sId)
726 725
     {
@@ -743,7 +742,7 @@  discard block
 block discarded – undo
743 742
      * @param string        $sName                The name of the new input element
744 743
      * @param string        $sId                The id of the new element
745 744
      *
746
-     * @return \Jaxon\Plugin\Response
745
+     * @return Response
747 746
      */
748 747
     public function insertInputAfter($sAfter, $sType, $sName, $sId)
749 748
     {
@@ -765,7 +764,7 @@  discard block
 block discarded – undo
765 764
      * @param string        $sEvent                The name of the event
766 765
      * @param string        $sScript            The javascript to execute when the event is fired
767 766
      *
768
-     * @return \Jaxon\Plugin\Response
767
+     * @return Response
769 768
      */
770 769
     public function setEvent($sTarget, $sEvent, $sScript)
771 770
     {
@@ -785,7 +784,7 @@  discard block
 block discarded – undo
785 784
      * @param string        $sTarget            The id of the element that contains the event
786 785
      * @param string        $sScript            The javascript to execute when the event is fired
787 786
      *
788
-     * @return \Jaxon\Plugin\Response
787
+     * @return Response
789 788
      */
790 789
     public function onClick($sTarget, $sScript)
791 790
     {
@@ -801,7 +800,7 @@  discard block
 block discarded – undo
801 800
      * @param string        $sEvent                The name of the event
802 801
      * @param string        $sHandler            The javascript function to call when the event is fired
803 802
      *
804
-     * @return \Jaxon\Plugin\Response
803
+     * @return Response
805 804
      */
806 805
     public function addHandler($sTarget, $sEvent, $sHandler)
807 806
     {
@@ -822,7 +821,7 @@  discard block
 block discarded – undo
822 821
      * @param string        $sEvent                The name of the event
823 822
      * @param string        $sHandler            The javascript function called when the event is fired
824 823
      *
825
-     * @return \Jaxon\Plugin\Response
824
+     * @return Response
826 825
      */
827 826
     public function removeHandler($sTarget, $sEvent, $sHandler)
828 827
     {
@@ -843,7 +842,7 @@  discard block
 block discarded – undo
843 842
      * @param string        $sArgs                Comma separated list of parameter names
844 843
      * @param string        $sScript            The javascript code that will become the body of the function
845 844
      *
846
-     * @return \Jaxon\Plugin\Response
845
+     * @return Response
847 846
      */
848 847
     public function setFunction($sFunction, $sArgs, $sScript)
849 848
     {
@@ -870,7 +869,7 @@  discard block
 block discarded – undo
870 869
      * @param string        $sReturnValueVar    The name of the variable that will retain the return value
871 870
      *                                             from the call to the original function
872 871
      *
873
-     * @return \Jaxon\Plugin\Response
872
+     * @return Response
874 873
      */
875 874
     public function wrapFunction($sFunction, $sArgs, $aScripts, $sReturnValueVar)
876 875
     {
@@ -891,7 +890,7 @@  discard block
 block discarded – undo
891 890
      * @param string        $sFileName            The relative or fully qualified URI of the javascript file
892 891
      * @param string        $sType                Determines the script type. Defaults to 'text/javascript'
893 892
      *
894
-     * @return \Jaxon\Plugin\Response
893
+     * @return Response
895 894
      */
896 895
     public function includeScript($sFileName, $sType = null, $sId = null)
897 896
     {
@@ -912,7 +911,7 @@  discard block
 block discarded – undo
912 911
      * @param string        $sFileName            The relative or fully qualified URI of the javascript file
913 912
      * @param string        $sType                Determines the script type. Defaults to 'text/javascript'
914 913
      *
915
-     * @return \Jaxon\Plugin\Response
914
+     * @return Response
916 915
      */
917 916
     public function includeScriptOnce($sFileName, $sType = null, $sId = null)
918 917
     {
@@ -935,7 +934,7 @@  discard block
 block discarded – undo
935 934
      * @param string        $sFileName            The relative or fully qualified URI of the javascript file
936 935
      * @param string        $sUnload            Name of a javascript function to call prior to unlaoding the file
937 936
      *
938
-     * @return \Jaxon\Plugin\Response
937
+     * @return Response
939 938
      */
940 939
     public function removeScript($sFileName, $sUnload = '')
941 940
     {
@@ -956,7 +955,7 @@  discard block
 block discarded – undo
956 955
      * @param string        $sFileName            The relative or fully qualified URI of the css file
957 956
      * @param string        $sMedia                The media type of the CSS file. Defaults to 'screen'
958 957
      *
959
-     * @return \Jaxon\Plugin\Response
958
+     * @return Response
960 959
      */
961 960
     public function includeCSS($sFileName, $sMedia = null)
962 961
     {
@@ -975,7 +974,7 @@  discard block
 block discarded – undo
975 974
      *
976 975
      * @param string        $sFileName            The relative or fully qualified URI of the css file
977 976
      *
978
-     * @return \Jaxon\Plugin\Response
977
+     * @return Response
979 978
      */
980 979
     public function removeCSS($sFileName, $sMedia = null)
981 980
     {
@@ -1000,7 +999,7 @@  discard block
 block discarded – undo
1000 999
      * @param integer        $iTimeout            The number of 1/10ths of a second to pause before timing out
1001 1000
      *                                             and continuing with the execution of the response commands
1002 1001
      *
1003
-     * @return \Jaxon\Plugin\Response
1002
+     * @return Response
1004 1003
      */
1005 1004
     public function waitForCSS($iTimeout = 600)
1006 1005
     {
@@ -1025,7 +1024,7 @@  discard block
 block discarded – undo
1025 1024
      * @param integer        $tenths                The number of 1/10ths of a second to wait before timing out
1026 1025
      *                                             and continuing with the execution of the response commands.
1027 1026
      *
1028
-     * @return \Jaxon\Plugin\Response
1027
+     * @return Response
1029 1028
      */
1030 1029
     public function waitFor($script, $tenths)
1031 1030
     {
@@ -1046,7 +1045,7 @@  discard block
 block discarded – undo
1046 1045
      *
1047 1046
      * @param integer        $tenths                The number of 1/10ths of a second to sleep
1048 1047
      *
1049
-     * @return \Jaxon\Plugin\Response
1048
+     * @return Response
1050 1049
      */
1051 1050
     public function sleep($tenths)
1052 1051
     {
@@ -1075,7 +1074,7 @@  discard block
 block discarded – undo
1075 1074
      * @param string        $variable            The DOM element name (id or class)
1076 1075
      * @param string        $tag                The HTML tag of the new DOM element
1077 1076
      *
1078
-     * @return \Jaxon\Plugin\Response
1077
+     * @return Response
1079 1078
      */
1080 1079
     public function domCreateElement($variable, $tag)
1081 1080
     {
@@ -1095,7 +1094,7 @@  discard block
 block discarded – undo
1095 1094
      * @param string        $key                The name of the attribute
1096 1095
      * @param string        $value                The value of the attribute
1097 1096
      *
1098
-     * @return \Jaxon\Plugin\Response
1097
+     * @return Response
1099 1098
      */
1100 1099
     public function domSetAttribute($variable, $key, $value)
1101 1100
     {
@@ -1116,7 +1115,7 @@  discard block
 block discarded – undo
1116 1115
      * @param string        $skip                The ??
1117 1116
      * @param string        $remove                The ??
1118 1117
      *
1119
-     * @return \Jaxon\Plugin\Response
1118
+     * @return Response
1120 1119
      */
1121 1120
     public function domRemoveChildren($parent, $skip = null, $remove = null)
1122 1121
     {
@@ -1137,7 +1136,7 @@  discard block
 block discarded – undo
1137 1136
      * @param string        $parent                The DOM parent element
1138 1137
      * @param string        $variable            The DOM element name (id or class)
1139 1138
      *
1140
-     * @return \Jaxon\Plugin\Response
1139
+     * @return Response
1141 1140
      */
1142 1141
     public function domAppendChild($parent, $variable)
1143 1142
     {
@@ -1156,7 +1155,7 @@  discard block
 block discarded – undo
1156 1155
      * @param string        $target                The DOM target element
1157 1156
      * @param string        $variable            The DOM element name (id or class)
1158 1157
      *
1159
-     * @return \Jaxon\Plugin\Response
1158
+     * @return Response
1160 1159
      */
1161 1160
     public function domInsertBefore($target, $variable)
1162 1161
     {
@@ -1175,7 +1174,7 @@  discard block
 block discarded – undo
1175 1174
      * @param string        $target                The DOM target element
1176 1175
      * @param string        $variable            The DOM element name (id or class)
1177 1176
      *
1178
-     * @return \Jaxon\Plugin\Response
1177
+     * @return Response
1179 1178
      */
1180 1179
     public function domInsertAfter($target, $variable)
1181 1180
     {
@@ -1194,7 +1193,7 @@  discard block
 block discarded – undo
1194 1193
      * @param string        $parent                The DOM parent element
1195 1194
      * @param string        $text                The HTML text to append
1196 1195
      *
1197
-     * @return \Jaxon\Plugin\Response
1196
+     * @return Response
1198 1197
      */
1199 1198
     public function domAppendText($parent, $text)
1200 1199
     {
@@ -1235,7 +1234,7 @@  discard block
 block discarded – undo
1235 1234
      *
1236 1235
      * @param mixed        $value                Any value
1237 1236
      *
1238
-     * @return \Jaxon\Plugin\Response
1237
+     * @return Response
1239 1238
      */
1240 1239
     public function setReturnValue($value)
1241 1240
     {
Please login to merge, or discard this patch.
src/Jaxon.php 1 patch
Braces   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -212,8 +212,9 @@  discard block
 block discarded – undo
212 212
             {
213 213
                 $sEvent = $aArgs[1];
214 214
                 $xUserFunction = $aArgs[2];
215
-                if(!is_a($xUserFunction, 'Request\\Support\\UserFunction'))
216
-                    $xUserFunction = new Request\Support\UserFunction($xUserFunction);
215
+                if(!is_a($xUserFunction, 'Request\\Support\\UserFunction')) {
216
+                                    $xUserFunction = new Request\Support\UserFunction($xUserFunction);
217
+                }
217 218
                 $this->aProcessingEvents[$sEvent] = $xUserFunction;
218 219
                 return true;
219 220
             }
@@ -324,8 +325,7 @@  discard block
 block discarded – undo
324 325
             try
325 326
             {
326 327
                 $mResult = $this->getPluginManager()->processRequest();
327
-            }
328
-            catch(Exception $e)
328
+            } catch(Exception $e)
329 329
             {
330 330
                 // An exception was thrown while processing the request.
331 331
                 // The request missed the corresponding handler function,
@@ -342,8 +342,7 @@  discard block
 block discarded – undo
342 342
                 {
343 343
                     $sEvent = self::PROCESSING_EVENT_INVALID;
344 344
                     $aParams = array($e->getMessage());
345
-                }
346
-                else
345
+                } else
347 346
                 {
348 347
                     $sEvent = self::PROCESSING_EVENT_ERROR;
349 348
                     $aParams = array($e);
@@ -353,8 +352,7 @@  discard block
 block discarded – undo
353 352
                 {
354 353
                     // Call the processing event
355 354
                     $this->aProcessingEvents[$sEvent]->call($aParams);
356
-                }
357
-                else
355
+                } else
358 356
                 {
359 357
                     // The exception is not to be processed here.
360 358
                     throw $e;
Please login to merge, or discard this patch.