Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.
Common duplication problems, and corresponding solutions are:
Complex classes like TPage often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use TPage, and based on these observations, apply Extract Interface, too.
| 1 | <?php |
||
| 39 | class TPage extends TTemplateControl |
||
| 40 | { |
||
| 41 | /** |
||
| 42 | * system post fields |
||
| 43 | */ |
||
| 44 | const FIELD_POSTBACK_TARGET = 'PRADO_POSTBACK_TARGET'; |
||
| 45 | const FIELD_POSTBACK_PARAMETER = 'PRADO_POSTBACK_PARAMETER'; |
||
| 46 | const FIELD_LASTFOCUS = 'PRADO_LASTFOCUS'; |
||
| 47 | const FIELD_PAGESTATE = 'PRADO_PAGESTATE'; |
||
| 48 | const FIELD_CALLBACK_TARGET = 'PRADO_CALLBACK_TARGET'; |
||
| 49 | const FIELD_CALLBACK_PARAMETER = 'PRADO_CALLBACK_PARAMETER'; |
||
| 50 | |||
| 51 | /** |
||
| 52 | * @var array system post fields |
||
| 53 | */ |
||
| 54 | private static $_systemPostFields = [ |
||
| 55 | 'PRADO_POSTBACK_TARGET' => true, |
||
| 56 | 'PRADO_POSTBACK_PARAMETER' => true, |
||
| 57 | 'PRADO_LASTFOCUS' => true, |
||
| 58 | 'PRADO_PAGESTATE' => true, |
||
| 59 | 'PRADO_CALLBACK_TARGET' => true, |
||
| 60 | 'PRADO_CALLBACK_PARAMETER' => true |
||
| 61 | ]; |
||
| 62 | /** |
||
| 63 | * @var TForm form instance |
||
| 64 | */ |
||
| 65 | private $_form; |
||
| 66 | /** |
||
| 67 | * @var THead head instance |
||
| 68 | */ |
||
| 69 | private $_head; |
||
| 70 | /** |
||
| 71 | * @var array list of registered validators |
||
| 72 | */ |
||
| 73 | private $_validators = []; |
||
| 74 | /** |
||
| 75 | * @var bool if validation has been performed |
||
| 76 | */ |
||
| 77 | private $_validated = false; |
||
| 78 | /** |
||
| 79 | * @var TTheme page theme |
||
| 80 | */ |
||
| 81 | private $_theme; |
||
| 82 | /** |
||
| 83 | * @var string page title set when Head is not in page yet |
||
| 84 | */ |
||
| 85 | private $_title; |
||
| 86 | /** |
||
| 87 | * @var TTheme page stylesheet theme |
||
| 88 | */ |
||
| 89 | private $_styleSheet; |
||
| 90 | /** |
||
| 91 | * @var TClientScriptManager client script manager |
||
| 92 | */ |
||
| 93 | private $_clientScript; |
||
| 94 | /** |
||
| 95 | * @var TMap data post back by user |
||
| 96 | */ |
||
| 97 | protected $_postData; |
||
| 98 | /** |
||
| 99 | * @var TMap postback data that is not handled during first invocation of LoadPostData. |
||
| 100 | */ |
||
| 101 | protected $_restPostData; |
||
| 102 | /** |
||
| 103 | * @var array list of controls whose data have been changed due to the postback |
||
| 104 | */ |
||
| 105 | protected $_controlsPostDataChanged = []; |
||
| 106 | /** |
||
| 107 | * @var array list of controls that need to load post data in the current request |
||
| 108 | */ |
||
| 109 | protected $_controlsRequiringPostData = []; |
||
| 110 | /** |
||
| 111 | * @var array list of controls that need to load post data in the next postback |
||
| 112 | */ |
||
| 113 | protected $_controlsRegisteredForPostData = []; |
||
| 114 | /** |
||
| 115 | * @var TControl control that needs to raise postback event |
||
| 116 | */ |
||
| 117 | private $_postBackEventTarget; |
||
| 118 | /** |
||
| 119 | * @var string postback event parameter |
||
| 120 | */ |
||
| 121 | private $_postBackEventParameter; |
||
| 122 | /** |
||
| 123 | * @var bool whether the form has been rendered |
||
| 124 | */ |
||
| 125 | protected $_formRendered = false; |
||
| 126 | /** |
||
| 127 | * @var bool whether the current rendering is within a form |
||
| 128 | */ |
||
| 129 | protected $_inFormRender = false; |
||
| 130 | /** |
||
| 131 | * @var string|TControl the control or the ID of the element on the page to be focused when the page is sent back to user |
||
| 132 | */ |
||
| 133 | private $_focus; |
||
| 134 | /** |
||
| 135 | * @var string page path to this page |
||
| 136 | */ |
||
| 137 | private $_pagePath = ''; |
||
| 138 | /** |
||
| 139 | * @var bool whether page state should be HMAC validated |
||
| 140 | */ |
||
| 141 | private $_enableStateValidation = true; |
||
| 142 | /** |
||
| 143 | * @var bool whether page state should be encrypted |
||
| 144 | */ |
||
| 145 | private $_enableStateEncryption = false; |
||
| 146 | /** |
||
| 147 | * @var bool whether page state should be compressed |
||
| 148 | * @since 3.1.6 |
||
| 149 | */ |
||
| 150 | private $_enableStateCompression = true; |
||
| 151 | /** |
||
| 152 | * @var string page state persister class name |
||
| 153 | */ |
||
| 154 | private $_statePersisterClass = '\Prado\Web\UI\TPageStatePersister'; |
||
| 155 | /** |
||
| 156 | * @var mixed page state persister |
||
| 157 | */ |
||
| 158 | private $_statePersister; |
||
| 159 | /** |
||
| 160 | * @var TStack stack used to store currently active caching controls |
||
| 161 | */ |
||
| 162 | private $_cachingStack; |
||
| 163 | /** |
||
| 164 | * @var string state string to be stored on the client side |
||
| 165 | */ |
||
| 166 | private $_clientState = ''; |
||
| 167 | /** |
||
| 168 | * @var bool true if loading post data. |
||
| 169 | */ |
||
| 170 | protected $_isLoadingPostData = false; |
||
| 171 | /** |
||
| 172 | * @var bool whether client supports javascript |
||
| 173 | */ |
||
| 174 | private $_enableJavaScript = true; |
||
| 175 | /** |
||
| 176 | * @var THtmlWriter current html render writer |
||
| 177 | */ |
||
| 178 | private $_writer; |
||
| 179 | |||
| 180 | /** |
||
| 181 | * Constructor. |
||
| 182 | * Sets the page object to itself. |
||
| 183 | * Derived classes must call parent implementation. |
||
| 184 | */ |
||
| 185 | public function __construct() |
||
| 189 | |||
| 190 | /** |
||
| 191 | * Runs through the page lifecycles. |
||
| 192 | * @param THtmlTextWriter $writer the HTML writer |
||
| 193 | */ |
||
| 194 | public function run($writer) |
||
| 213 | |||
| 214 | protected function processNormalRequest($writer) |
||
| 247 | |||
| 248 | protected function processPostBackRequest($writer) |
||
| 292 | |||
| 293 | protected static function decodeUTF8($data, $enc) |
||
| 306 | |||
| 307 | /** |
||
| 308 | * Sets Adapter to TActivePageAdapter and calls apter to process the |
||
| 309 | * callback request. |
||
| 310 | * @param mixed $writer |
||
| 311 | */ |
||
| 312 | protected function processCallbackRequest($writer) |
||
| 383 | |||
| 384 | /** |
||
| 385 | * Gets the callback client script handler that allows javascript functions |
||
| 386 | * to be executed during the callback response. |
||
| 387 | * @return TCallbackClientScript interface to client-side javascript code. |
||
| 388 | */ |
||
| 389 | public function getCallbackClient() |
||
| 397 | |||
| 398 | /** |
||
| 399 | * Set a new callback client handler. |
||
| 400 | * @param TCallbackClientScript $client new callback client script handler. |
||
| 401 | */ |
||
| 402 | public function setCallbackClient($client) |
||
| 406 | |||
| 407 | /** |
||
| 408 | * @return TControl the control responsible for the current callback event, |
||
| 409 | * null if nonexistent |
||
| 410 | */ |
||
| 411 | public function getCallbackEventTarget() |
||
| 415 | |||
| 416 | /** |
||
| 417 | * Registers a control to raise callback event in the current request. |
||
| 418 | * @param TControl $control control registered to raise callback event. |
||
| 419 | */ |
||
| 420 | public function setCallbackEventTarget(TControl $control) |
||
| 424 | |||
| 425 | /** |
||
| 426 | * Callback parameter is decoded assuming JSON encoding. |
||
| 427 | * @return string callback event parameter |
||
| 428 | */ |
||
| 429 | public function getCallbackEventParameter() |
||
| 433 | |||
| 434 | /** |
||
| 435 | * @param mixed $value callback event parameter |
||
| 436 | */ |
||
| 437 | public function setCallbackEventParameter($value) |
||
| 441 | |||
| 442 | /** |
||
| 443 | * @return TForm the form on the page |
||
| 444 | */ |
||
| 445 | public function getForm() |
||
| 449 | |||
| 450 | /** |
||
| 451 | * Registers a TForm instance to the page. |
||
| 452 | * Note, a page can contain at most one TForm instance. |
||
| 453 | * @param TForm $form the form on the page |
||
| 454 | * @throws TInvalidOperationException if this method is invoked twice or more. |
||
| 455 | */ |
||
| 456 | public function setForm(TForm $form) |
||
| 464 | |||
| 465 | /** |
||
| 466 | * Returns a list of registered validators. |
||
| 467 | * If validation group is specified, only the validators in that group will be returned. |
||
| 468 | * @param null|string $validationGroup validation group |
||
| 469 | * @return TList registered validators in the requested group. If the group is null, all validators will be returned. |
||
| 470 | */ |
||
| 471 | public function getValidators($validationGroup = null) |
||
| 488 | |||
| 489 | /** |
||
| 490 | * Performs input validation. |
||
| 491 | * This method will invoke the registered validators to perform the actual validation. |
||
| 492 | * If validation group is specified, only the validators in that group will be invoked. |
||
| 493 | * @param string $validationGroup validation group. If null, all validators will perform validation. |
||
| 494 | */ |
||
| 495 | public function validate($validationGroup = null) |
||
| 513 | |||
| 514 | /** |
||
| 515 | * Returns whether user input is valid or not. |
||
| 516 | * This method must be invoked after {@link validate} is called. |
||
| 517 | * @throws TInvalidOperationException if {@link validate} is not invoked yet. |
||
| 518 | * @return bool whether the user input is valid or not. |
||
| 519 | */ |
||
| 520 | public function getIsValid() |
||
| 535 | |||
| 536 | /** |
||
| 537 | * @return TTheme the theme used for the page. Defaults to null. |
||
| 538 | */ |
||
| 539 | View Code Duplication | public function getTheme() |
|
| 546 | |||
| 547 | /** |
||
| 548 | * Sets the theme to be used for the page. |
||
| 549 | * @param string|TTheme $value the theme name or the theme object to be used for the page. |
||
| 550 | */ |
||
| 551 | public function setTheme($value) |
||
| 555 | |||
| 556 | |||
| 557 | /** |
||
| 558 | * @return TTheme the stylesheet theme used for the page. Defaults to null. |
||
| 559 | */ |
||
| 560 | View Code Duplication | public function getStyleSheetTheme() |
|
| 567 | |||
| 568 | /** |
||
| 569 | * Sets the stylesheet theme to be used for the page. |
||
| 570 | * @param string|TTheme $value the stylesheet theme name or the stylesheet theme object to be used for the page. |
||
| 571 | */ |
||
| 572 | public function setStyleSheetTheme($value) |
||
| 576 | |||
| 577 | /** |
||
| 578 | * Applies a skin in the current theme to a control. |
||
| 579 | * This method should only be used by framework developers. |
||
| 580 | * @param TControl $control a control to be applied skin with |
||
| 581 | */ |
||
| 582 | public function applyControlSkin($control) |
||
| 588 | |||
| 589 | /** |
||
| 590 | * Applies a stylesheet skin in the current theme to a control. |
||
| 591 | * This method should only be used by framework developers. |
||
| 592 | * @param TControl $control a control to be applied stylesheet skin with |
||
| 593 | */ |
||
| 594 | public function applyControlStyleSheet($control) |
||
| 600 | |||
| 601 | /** |
||
| 602 | * @return TClientScriptManager client script manager |
||
| 603 | */ |
||
| 604 | public function getClientScript() |
||
| 617 | |||
| 618 | /** |
||
| 619 | * Raises OnPreInit event. |
||
| 620 | * This method is invoked right before {@link onInit OnInit} stage. |
||
| 621 | * You may override this method to provide additional initialization that |
||
| 622 | * should be done before {@link onInit OnInit} (e.g. setting {@link setTheme Theme} or |
||
| 623 | * {@link setStyleSheetTheme StyleSheetTheme}). |
||
| 624 | * Remember to call the parent implementation to ensure OnPreInit event is raised. |
||
| 625 | * @param mixed $param event parameter |
||
| 626 | */ |
||
| 627 | public function onPreInit($param) |
||
| 631 | |||
| 632 | /** |
||
| 633 | * Raises OnInitComplete event. |
||
| 634 | * This method is invoked right after {@link onInit OnInit} stage and before {@link onLoad OnLoad} stage. |
||
| 635 | * You may override this method to provide additional initialization that |
||
| 636 | * should be done after {@link onInit OnInit}. |
||
| 637 | * Remember to call the parent implementation to ensure OnInitComplete event is raised. |
||
| 638 | * @param mixed $param event parameter |
||
| 639 | */ |
||
| 640 | public function onInitComplete($param) |
||
| 644 | |||
| 645 | /** |
||
| 646 | * Raises OnPreLoad event. |
||
| 647 | * This method is invoked right before {@link onLoad OnLoad} stage. |
||
| 648 | * You may override this method to provide additional page loading logic that |
||
| 649 | * should be done before {@link onLoad OnLoad}. |
||
| 650 | * Remember to call the parent implementation to ensure OnPreLoad event is raised. |
||
| 651 | * @param mixed $param event parameter |
||
| 652 | */ |
||
| 653 | public function onPreLoad($param) |
||
| 657 | |||
| 658 | /** |
||
| 659 | * Raises OnLoadComplete event. |
||
| 660 | * This method is invoked right after {@link onLoad OnLoad} stage. |
||
| 661 | * You may override this method to provide additional page loading logic that |
||
| 662 | * should be done after {@link onLoad OnLoad}. |
||
| 663 | * Remember to call the parent implementation to ensure OnLoadComplete event is raised. |
||
| 664 | * @param mixed $param event parameter |
||
| 665 | */ |
||
| 666 | public function onLoadComplete($param) |
||
| 670 | |||
| 671 | /** |
||
| 672 | * Raises OnPreRenderComplete event. |
||
| 673 | * This method is invoked right after {@link onPreRender OnPreRender} stage. |
||
| 674 | * You may override this method to provide additional preparation for page rendering |
||
| 675 | * that should be done after {@link onPreRender OnPreRender}. |
||
| 676 | * Remember to call the parent implementation to ensure OnPreRenderComplete event is raised. |
||
| 677 | * @param mixed $param event parameter |
||
| 678 | */ |
||
| 679 | public function onPreRenderComplete($param) |
||
| 706 | |||
| 707 | /** |
||
| 708 | * Determines the media type of the CSS file. |
||
| 709 | * The media type is determined according to the following file name pattern: |
||
| 710 | * xxx.media-type.extension |
||
| 711 | * For example, 'mystyle.print.css' means its media type is 'print'. |
||
| 712 | * @param string $url CSS URL |
||
| 713 | * @return string media type of the CSS file |
||
| 714 | */ |
||
| 715 | private function getCssMediaType($url) |
||
| 724 | |||
| 725 | /** |
||
| 726 | * Raises OnSaveStateComplete event. |
||
| 727 | * This method is invoked right after {@link onSaveState OnSaveState} stage. |
||
| 728 | * You may override this method to provide additional logic after page state is saved. |
||
| 729 | * Remember to call the parent implementation to ensure OnSaveStateComplete event is raised. |
||
| 730 | * @param mixed $param event parameter |
||
| 731 | */ |
||
| 732 | public function onSaveStateComplete($param) |
||
| 736 | |||
| 737 | /** |
||
| 738 | * Determines whether the current page request is a postback. |
||
| 739 | * Call {@link getIsPostBack} to get the result. |
||
| 740 | */ |
||
| 741 | private function determinePostBackMode() |
||
| 748 | |||
| 749 | /** |
||
| 750 | * @return bool whether the current page request is a postback |
||
| 751 | */ |
||
| 752 | public function getIsPostBack() |
||
| 756 | |||
| 757 | /** |
||
| 758 | * @return bool whether this is a callback request |
||
| 759 | */ |
||
| 760 | public function getIsCallback() |
||
| 764 | |||
| 765 | /** |
||
| 766 | * This method is invoked when control state is to be saved. |
||
| 767 | * You can override this method to do last step state saving. |
||
| 768 | * Parent implementation must be invoked. |
||
| 769 | */ |
||
| 770 | public function saveState() |
||
| 775 | |||
| 776 | /** |
||
| 777 | * This method is invoked right after the control has loaded its state. |
||
| 778 | * You can override this method to initialize data from the control state. |
||
| 779 | * Parent implementation must be invoked. |
||
| 780 | */ |
||
| 781 | public function loadState() |
||
| 786 | |||
| 787 | /** |
||
| 788 | * Loads page state from persistent storage. |
||
| 789 | */ |
||
| 790 | protected function loadPageState() |
||
| 796 | |||
| 797 | /** |
||
| 798 | * Saves page state from persistent storage. |
||
| 799 | */ |
||
| 800 | protected function savePageState() |
||
| 806 | |||
| 807 | /** |
||
| 808 | * @param string $field the field name |
||
| 809 | * @return bool whether the specified field is a system field in postback data |
||
| 810 | */ |
||
| 811 | protected function isSystemPostField($field) |
||
| 815 | |||
| 816 | /** |
||
| 817 | * Registers a control for loading post data in the next postback. |
||
| 818 | * This method needs to be invoked if the control to load post data |
||
| 819 | * may not have a post variable in some cases. For example, a checkbox, |
||
| 820 | * if not checked, will not have a post value. |
||
| 821 | * @param TControl $control control registered for loading post data |
||
| 822 | */ |
||
| 823 | public function registerRequiresPostData($control) |
||
| 832 | |||
| 833 | /** |
||
| 834 | * @return TControl the control responsible for the current postback event, null if nonexistent |
||
| 835 | */ |
||
| 836 | public function getPostBackEventTarget() |
||
| 846 | |||
| 847 | /** |
||
| 848 | * Registers a control to raise postback event in the current request. |
||
| 849 | * @param TControl $control control registered to raise postback event. |
||
| 850 | */ |
||
| 851 | public function setPostBackEventTarget(TControl $control) |
||
| 855 | |||
| 856 | /** |
||
| 857 | * @return string postback event parameter |
||
| 858 | */ |
||
| 859 | public function getPostBackEventParameter() |
||
| 868 | |||
| 869 | /** |
||
| 870 | * @param string $value postback event parameter |
||
| 871 | */ |
||
| 872 | public function setPostBackEventParameter($value) |
||
| 876 | |||
| 877 | /** |
||
| 878 | * Processes post data. |
||
| 879 | * @param TMap $postData post data to be processed |
||
| 880 | * @param bool $beforeLoad whether this method is invoked before {@link onLoad OnLoad}. |
||
| 881 | */ |
||
| 882 | protected function processPostData($postData, $beforeLoad) |
||
| 920 | |||
| 921 | /** |
||
| 922 | * @return bool true if loading post data. |
||
| 923 | */ |
||
| 924 | public function getIsLoadingPostData() |
||
| 928 | |||
| 929 | /** |
||
| 930 | * Raises OnPostDataChangedEvent for controls whose data have been changed due to the postback. |
||
| 931 | */ |
||
| 932 | protected function raiseChangedEvents() |
||
| 938 | |||
| 939 | /** |
||
| 940 | * Raises PostBack event. |
||
| 941 | */ |
||
| 942 | protected function raisePostBackEvent() |
||
| 950 | |||
| 951 | /** |
||
| 952 | * @return bool Whether form rendering is in progress |
||
| 953 | */ |
||
| 954 | public function getInFormRender() |
||
| 958 | |||
| 959 | /** |
||
| 960 | * Ensures the control is rendered within a form. |
||
| 961 | * @param TControl $control the control to be rendered |
||
| 962 | * @throws TConfigurationException if the control is outside of the form |
||
| 963 | */ |
||
| 964 | public function ensureRenderInForm($control) |
||
| 970 | |||
| 971 | /** |
||
| 972 | * @internal This method is invoked by TForm at the beginning of its rendering |
||
| 973 | * @param mixed $writer |
||
| 974 | */ |
||
| 975 | public function beginFormRender($writer) |
||
| 984 | |||
| 985 | /** |
||
| 986 | * @internal This method is invoked by TForm at the end of its rendering |
||
| 987 | * @param mixed $writer |
||
| 988 | */ |
||
| 989 | public function endFormRender($writer) |
||
| 1003 | |||
| 1004 | /** |
||
| 1005 | * Sets input focus on a control after the page is rendered to users. |
||
| 1006 | * @param string|TControl $value control to receive focus, or the ID of the element on the page to receive focus |
||
| 1007 | */ |
||
| 1008 | public function setFocus($value) |
||
| 1012 | |||
| 1013 | /** |
||
| 1014 | * @return bool whether client supports javascript. Defaults to true. |
||
| 1015 | */ |
||
| 1016 | public function getClientSupportsJavaScript() |
||
| 1020 | |||
| 1021 | /** |
||
| 1022 | * @param bool $value whether client supports javascript. If false, javascript will not be generated for controls. |
||
| 1023 | */ |
||
| 1024 | public function setClientSupportsJavaScript($value) |
||
| 1028 | |||
| 1029 | /** |
||
| 1030 | * @return THead page head, null if not available |
||
| 1031 | */ |
||
| 1032 | public function getHead() |
||
| 1036 | |||
| 1037 | /** |
||
| 1038 | * @param THead $value page head |
||
| 1039 | * @throws TInvalidOperationException if a head already exists |
||
| 1040 | */ |
||
| 1041 | public function setHead(THead $value) |
||
| 1052 | |||
| 1053 | /** |
||
| 1054 | * @return string page title. |
||
| 1055 | */ |
||
| 1056 | public function getTitle() |
||
| 1064 | |||
| 1065 | /** |
||
| 1066 | * Sets the page title. |
||
| 1067 | * Note, a {@link THead} control needs to place on the page |
||
| 1068 | * in order that this title be rendered. |
||
| 1069 | * @param string $value page title. This will override the title set in {@link getHead Head}. |
||
| 1070 | */ |
||
| 1071 | public function setTitle($value) |
||
| 1079 | |||
| 1080 | /** |
||
| 1081 | * Returns the state to be stored on the client side. |
||
| 1082 | * This method should only be used by framework and control developers. |
||
| 1083 | * @return string the state to be stored on the client side |
||
| 1084 | */ |
||
| 1085 | public function getClientState() |
||
| 1089 | |||
| 1090 | /** |
||
| 1091 | * Sets the state to be stored on the client side. |
||
| 1092 | * This method should only be used by framework and control developers. |
||
| 1093 | * @param string $state the state to be stored on the client side |
||
| 1094 | */ |
||
| 1095 | public function setClientState($state) |
||
| 1099 | |||
| 1100 | /** |
||
| 1101 | * @return string the state postback from client side |
||
| 1102 | */ |
||
| 1103 | public function getRequestClientState() |
||
| 1107 | |||
| 1108 | /** |
||
| 1109 | * @return string class name of the page state persister. Defaults to TPageStatePersister. |
||
| 1110 | */ |
||
| 1111 | public function getStatePersisterClass() |
||
| 1115 | |||
| 1116 | /** |
||
| 1117 | * @param string $value class name of the page state persister. |
||
| 1118 | */ |
||
| 1119 | public function setStatePersisterClass($value) |
||
| 1123 | |||
| 1124 | /** |
||
| 1125 | * @return IPageStatePersister page state persister |
||
| 1126 | */ |
||
| 1127 | public function getStatePersister() |
||
| 1138 | |||
| 1139 | /** |
||
| 1140 | * @return bool whether page state should be HMAC validated. Defaults to true. |
||
| 1141 | */ |
||
| 1142 | public function getEnableStateValidation() |
||
| 1146 | |||
| 1147 | /** |
||
| 1148 | * @param bool $value whether page state should be HMAC validated. |
||
| 1149 | */ |
||
| 1150 | public function setEnableStateValidation($value) |
||
| 1154 | |||
| 1155 | /** |
||
| 1156 | * @return bool whether page state should be encrypted. Defaults to false. |
||
| 1157 | */ |
||
| 1158 | public function getEnableStateEncryption() |
||
| 1162 | |||
| 1163 | /** |
||
| 1164 | * @param bool $value whether page state should be encrypted. |
||
| 1165 | */ |
||
| 1166 | public function setEnableStateEncryption($value) |
||
| 1170 | |||
| 1171 | /** |
||
| 1172 | * @return bool whether page state should be compressed. Defaults to true. |
||
| 1173 | * @since 3.1.6 |
||
| 1174 | */ |
||
| 1175 | public function getEnableStateCompression() |
||
| 1179 | |||
| 1180 | /** |
||
| 1181 | * @param bool $value whether page state should be compressed. |
||
| 1182 | * @since 3.1.6 |
||
| 1183 | */ |
||
| 1184 | public function setEnableStateCompression($value) |
||
| 1188 | |||
| 1189 | /** |
||
| 1190 | * @return string the requested page path for this page |
||
| 1191 | */ |
||
| 1192 | public function getPagePath() |
||
| 1196 | |||
| 1197 | /** |
||
| 1198 | * @param string $value the requested page path for this page |
||
| 1199 | */ |
||
| 1200 | public function setPagePath($value) |
||
| 1204 | |||
| 1205 | /** |
||
| 1206 | * Registers an action associated with the content being cached. |
||
| 1207 | * The registered action will be replayed if the content stored |
||
| 1208 | * in the cache is served to end-users. |
||
| 1209 | * @param string $context context of the action method. This is a property-path |
||
| 1210 | * referring to the context object (e.g. Page, Page.ClientScript). |
||
| 1211 | * @param string $funcName method name of the context object |
||
| 1212 | * @param array $funcParams list of parameters to be passed to the action method |
||
| 1213 | */ |
||
| 1214 | public function registerCachingAction($context, $funcName, $funcParams) |
||
| 1222 | |||
| 1223 | /** |
||
| 1224 | * @return TStack stack of {@link TOutputCache} objects |
||
| 1225 | */ |
||
| 1226 | public function getCachingStack() |
||
| 1233 | |||
| 1234 | /** |
||
| 1235 | * Flushes output |
||
| 1236 | */ |
||
| 1237 | public function flushWriter() |
||
| 1243 | } |
||
| 1244 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..