3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * CakePHP(tm) : Rapid Development Framework (http://cakephp.org) * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * * Licensed under The MIT License * For full copyright and license information, please see the LICENSE.txt * Redistributions of files must retain the above copyright notice. * * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org) * @link http://cakephp.org CakePHP(tm) Project * @since 3.0.0 * @license http://www.opensource.org/licenses/mit-license.php MIT License */ /** * Cell base. * */ class Cell { /** * Instance of the View created during rendering. Won't be set until after * Cell::__toString() is called. * * @var \Cake\View\View */ public $View; /** * Name of the action that was invoked. * * Action name will be inflected to get the template name when rendering. * * @var string */ public $action; /** * Automatically set to the name of a plugin. * * @var string */ public $plugin = null; /** * An instance of a Cake\Network\Request object that contains information about the current request. * This object contains all the information about a request and several methods for reading * additional information about the request. * * @var \Cake\Network\Request */ public $request; /** * An instance of a Response object that contains information about the impending response * * @var \Cake\Network\Response */ public $response; /** * The name of the View class this cell sends output to. * * @var string */ public $viewClass = 'Cake\View\View'; /** * Instance of the Cake\Event\EventManager this cell is using * to dispatch inner events. * * @var \Cake\Event\EventManager */ protected $_eventManager = null; /** * These properties are settable directly on Cell and passed to the View as options. * * @var array * @see \Cake\View\View */ protected $_validViewOptions = [ 'viewVars', 'helpers', 'viewPath', 'plugin', ]; /** * List of valid options (constructor's fourth arguments) * * @var array */ protected $_validCellOptions = []; /** * Constructor. * * @param \Cake\Network\Request $request * @param \Cake\Network\Response $response * @param \Cake\Event\EventManager $eventManager * @param array $cellOptions */ public function __construct(Request $request = null, Response $response = null, EventManager $eventManager = null, array $cellOptions = []) { $this->_eventManager = $eventManager; $this->request = $request; $this->response = $response; $this->modelFactory('Table', ['Cake\ORM\TableRegistry', 'get']); foreach ($this->_validCellOptions as $var) { if (isset($cellOptions[$var])) { $this->{$var} = $cellOptions[$var]; } } } /** * Rendering method. * * @param string $action Custom template name to render. If not provided (null), the last * value will be used. This value is automatically set by `CellTrait::cell()`. * @return void */ public function render($action = null) { if ($action !== null) { $this->action = $action; } return $this->__toString(); } /** * Magic method. * * Starts the rendering process when Cell is echoed. * * @return string Rendered cell */ public function __toString() { $this->View = $this->createView(); $this->View->layout = false; $className = explode('\\', get_class($this)); $className = array_pop($className); $this->View->subDir = 'Cell' . DS . substr($className, 0, strpos($className, 'Cell')); try { return $this->View->render(Inflector::underscore($this->action)); } catch (\Exception $e) { return ''; } } /** * Debug info. * * @return void */ public function __debugInfo() { return [ 'plugin' => $this->plugin, 'action' => $this->action, 'viewClass' => $this->viewClass, 'request' => $this->request, 'response' => $this->response, ]; } /** * Returns the Cake\Event\EventManager manager instance for this cell. * * You can use this instance to register any new listeners or callbacks to the * cell events, or create your own events and trigger them at will. * * @return \Cake\Event\EventManager */ public function getEventManager() { if (empty($this->_eventManager)) { $this->_eventManager = new EventManager(); } return $this->_eventManager; } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4YrC3
function name:  (null)
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   DECLARE_CLASS                                            'cell'
  183     1      > RETURN                                                   1

Class Cell:
Function __construct:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 16, Position 2 = 23
Branch analysis from position: 16
2 jumps found. (Code = 78) Position 1 = 17, Position 2 = 23
Branch analysis from position: 17
2 jumps found. (Code = 43) Position 1 = 19, Position 2 = 22
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 16
Branch analysis from position: 16
Branch analysis from position: 22
Branch analysis from position: 23
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 23
filename:       /in/4YrC3
function name:  __construct
number of ops:  25
compiled vars:  !0 = $request, !1 = $response, !2 = $eventManager, !3 = $cellOptions, !4 = $var
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  102     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      null
          2        RECV_INIT                                        !2      null
          3        RECV_INIT                                        !3      <array>
  104     4        ASSIGN_OBJ                                               '_eventManager'
          5        OP_DATA                                                  !2
  105     6        ASSIGN_OBJ                                               'request'
          7        OP_DATA                                                  !0
  106     8        ASSIGN_OBJ                                               'response'
          9        OP_DATA                                                  !1
  107    10        INIT_METHOD_CALL                                         'modelFactory'
         11        SEND_VAL_EX                                              'Table'
         12        SEND_VAL_EX                                              <array>
         13        DO_FCALL                                      0          
  109    14        FETCH_OBJ_R                                      ~9      '_validCellOptions'
         15      > FE_RESET_R                                       $10     ~9, ->23
         16    > > FE_FETCH_R                                               $10, !4, ->23
  110    17    >   ISSET_ISEMPTY_DIM_OBJ                         0          !3, !4
         18      > JMPZ                                                     ~11, ->22
  111    19    >   FETCH_DIM_R                                      ~13     !3, !4
         20        ASSIGN_OBJ                                               !4
         21        OP_DATA                                                  ~13
  109    22    > > JMP                                                      ->16
         23    >   FE_FREE                                                  $10
  114    24      > RETURN                                                   null

End of function __construct

Function render:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 5
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 5
filename:       /in/4YrC3
function name:  render
number of ops:  9
compiled vars:  !0 = $action
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  123     0  E >   RECV_INIT                                        !0      null
  124     1        TYPE_CHECK                                  1020          !0
          2      > JMPZ                                                     ~1, ->5
  125     3    >   ASSIGN_OBJ                                               'action'
          4        OP_DATA                                                  !0
  128     5    >   INIT_METHOD_CALL                                         '__toString'
          6        DO_FCALL                                      0  $3      
          7      > RETURN                                                   $3
  129     8*     > RETURN                                                   null

End of function render

Function __tostring:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
Found catch point at position: 45
Branch analysis from position: 45
2 jumps found. (Code = 107) Position 1 = 46, Position 2 = -2
Branch analysis from position: 46
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4YrC3
function name:  __toString
number of ops:  49
compiled vars:  !0 = $className, !1 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  139     0  E >   INIT_METHOD_CALL                                         'createView'
          1        DO_FCALL                                      0  $3      
          2        ASSIGN_OBJ                                               'View'
          3        OP_DATA                                                  $3
  141     4        FETCH_OBJ_W                                      $4      'View'
          5        ASSIGN_OBJ                                               $4, 'layout'
          6        OP_DATA                                                  <false>
  142     7        INIT_FCALL                                               'explode'
          8        SEND_VAL                                                 '%5C'
          9        FETCH_THIS                                       ~6      
         10        GET_CLASS                                        ~7      ~6
         11        SEND_VAL                                                 ~7
         12        DO_ICALL                                         $8      
         13        ASSIGN                                                   !0, $8
  143    14        INIT_FCALL                                               'array_pop'
         15        SEND_REF                                                 !0
         16        DO_ICALL                                         $10     
         17        ASSIGN                                                   !0, $10
  144    18        FETCH_CONSTANT                                   ~14     'DS'
         19        CONCAT                                           ~15     'Cell', ~14
         20        INIT_FCALL                                               'substr'
         21        SEND_VAR                                                 !0
         22        SEND_VAL                                                 0
         23        INIT_FCALL                                               'strpos'
         24        SEND_VAR                                                 !0
         25        SEND_VAL                                                 'Cell'
         26        DO_ICALL                                         $16     
         27        SEND_VAR                                                 $16
         28        DO_ICALL                                         $17     
         29        CONCAT                                           ~18     ~15, $17
         30        FETCH_OBJ_W                                      $12     'View'
         31        ASSIGN_OBJ                                               $12, 'subDir'
         32        OP_DATA                                                  ~18
  147    33        FETCH_OBJ_R                                      ~19     'View'
         34        INIT_METHOD_CALL                                         ~19, 'render'
         35        INIT_STATIC_METHOD_CALL                                  'Inflector', 'underscore'
         36        CHECK_FUNC_ARG                                           
         37        FETCH_OBJ_FUNC_ARG                               $20     'action'
         38        SEND_FUNC_ARG                                            $20
         39        DO_FCALL                                      0  $21     
         40        SEND_VAR_NO_REF_EX                                       $21
         41        DO_FCALL                                      0  $22     
         42        VERIFY_RETURN_TYPE                                       $22
         43      > RETURN                                                   $22
         44*       JMP                                                      ->47
  148    45  E > > CATCH                                       last         'Exception'
  149    46    > > RETURN                                                   ''
  151    47*       VERIFY_RETURN_TYPE                                       
         48*     > RETURN                                                   null

End of function __tostring

Function __debuginfo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/4YrC3
function name:  __debugInfo
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  160     0  E >   FETCH_OBJ_R                                      ~0      'plugin'
          1        INIT_ARRAY                                       ~1      ~0, 'plugin'
  161     2        FETCH_OBJ_R                                      ~2      'action'
          3        ADD_ARRAY_ELEMENT                                ~1      ~2, 'action'
  162     4        FETCH_OBJ_R                                      ~3      'viewClass'
          5        ADD_ARRAY_ELEMENT                                ~1      ~3, 'viewClass'
  163     6        FETCH_OBJ_R                                      ~4      'request'
          7        ADD_ARRAY_ELEMENT                                ~1      ~4, 'request'
  164     8        FETCH_OBJ_R                                      ~5      'response'
          9        ADD_ARRAY_ELEMENT                                ~1      ~5, 'response'
         10      > RETURN                                                   ~1
  166    11*     > RETURN                                                   null

End of function __debuginfo

Function geteventmanager:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 6
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 6
filename:       /in/4YrC3
function name:  getEventManager
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
  177     0  E >   ISSET_ISEMPTY_PROP_OBJ                                   '_eventManager'
          1      > JMPZ                                                     ~0, ->6
  178     2    >   NEW                                              $2      'EventManager'
          3        DO_FCALL                                      0          
          4        ASSIGN_OBJ                                               '_eventManager'
          5        OP_DATA                                                  $2
  180     6    >   FETCH_OBJ_R                                      ~4      '_eventManager'
          7      > RETURN                                                   ~4
  181     8*     > RETURN                                                   null

End of function geteventmanager

End of class Cell.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.13 ms | 1408 KiB | 21 Q