original_string: public function get_categories_with_fields() : array {
          if ($this->categories === null) {
              $this->categories = api::get_categories_with_fields($this->get_component(), $this->get_area(), $this->get_itemid());
          }
          $handler = $this;
          array_walk($this->categories, function(category_controller $c) use ($handler) {
              $c->set_handler($handler);
          });
          return $this->categories;
      }
code: public function get_categories_with_fields() : array {
          if ($this->categories === null) {
              $this->categories = api::get_categories_with_fields($this->get_component(), $this->get_area(), $this->get_itemid());
          }
          $handler = $this;
          array_walk($this->categories, function(category_controller $c) use ($handler) {
              $c->set_handler($handler);
          });
          return $this->categories;
      }
code_tokens: public function get_categories_with_fields ( ) : array { if ( $ this -> categories === null ) { $ this -> categories = api :: get_categories_with_fields ( $ this -> get_component ( ) , $ this -> get_area ( ) , $ this -> get_itemid ( ) ) ; } $ handler = $ this ; array_walk ( $ this -> categories , function ( category_controller $ c ) use ( $ handler ) { $ c -> set_handler ( $ handler ) ; } ) ; return $ this -> categories ; }
docstring: Returns array of categories, each of them contains a list of fields definitions.
  
  @return category_controller[]
docstring_tokens: Returns array of categories each of them contains a list of fields definitions .