original_string: private function get_axis($type, $index, $createifnotexists) {
          $isx = $type === 'x';
          if ($isx) {
              $axis = isset($this->xaxes[$index]) ? $this->xaxes[$index] : null;
          } else {
              $axis = isset($this->yaxes[$index]) ? $this->yaxes[$index] : null;
          }
  
          if ($axis === null) {
              if (!$createifnotexists) {
                  throw new coding_exception('Unknown axis.');
              }
  
              $axis = new chart_axis();
              if ($isx) {
                  $this->set_xaxis($axis, $index);
              } else {
                  $this->set_yaxis($axis, $index);
              }
          }
  
          return $axis;
      }
code: private function get_axis($type, $index, $createifnotexists) {
          $isx = $type === 'x';
          if ($isx) {
              $axis = isset($this->xaxes[$index]) ? $this->xaxes[$index] : null;
          } else {
              $axis = isset($this->yaxes[$index]) ? $this->yaxes[$index] : null;
          }
  
          if ($axis === null) {
              if (!$createifnotexists) {
                  throw new coding_exception('Unknown axis.');
              }
  
              $axis = new chart_axis();
              if ($isx) {
                  $this->set_xaxis($axis, $index);
              } else {
                  $this->set_yaxis($axis, $index);
              }
          }
  
          return $axis;
      }
code_tokens: private function get_axis ( $ type , $ index , $ createifnotexists ) { $ isx = $ type === 'x' ; if ( $ isx ) { $ axis = isset ( $ this -> xaxes [ $ index ] ) ? $ this -> xaxes [ $ index ] : null ; } else { $ axis = isset ( $ this -> yaxes [ $ index ] ) ? $ this -> yaxes [ $ index ] : null ; } if ( $ axis === null ) { if ( ! $ createifnotexists ) { throw new coding_exception ( 'Unknown axis.' ) ; } $ axis = new chart_axis ( ) ; if ( $ isx ) { $ this -> set_xaxis ( $ axis , $ index ) ; } else { $ this -> set_yaxis ( $ axis , $ index ) ; } } return $ axis ; }
docstring: Get an axis.
  
  @param string $type Accepts values 'x' or 'y'.
  @param int $index The index of this axis.
  @param bool $createifnotexists Whether to create the axis if not found.
  @return chart_axis
docstring_tokens: Get an axis .