original_string: protected function getDimensionsFromAnsicon() : ?array
      {
          if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) {
              return [
                  'width'  => (int) $matches[1],
                  'height' => (int) ($matches[4] ?? $matches[2])
              ];
          }
  
          return null;
      }
code: protected function getDimensionsFromAnsicon() : ?array
      {
          if (preg_match('/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/', trim(getenv('ANSICON')), $matches)) {
              return [
                  'width'  => (int) $matches[1],
                  'height' => (int) ($matches[4] ?? $matches[2])
              ];
          }
  
          return null;
      }
code_tokens: protected function getDimensionsFromAnsicon ( ) : ? array { if ( preg_match ( '/^(\d+)x(\d+)(?: \((\d+)x(\d+)\))?$/' , trim ( getenv ( 'ANSICON' ) ) , $ matches ) ) { return [ 'width' => ( int ) $ matches [ 1 ] , 'height' => ( int ) ( $ matches [ 4 ] ?? $ matches [ 2 ] ) ] ; } return null ; }
docstring: Attempts to determine the Terminal's dimensions based on the 'ANSICON' environmental variables.
  
  @return  array   Either an array containing two keys - 'width' and 'height' or null if the data couldn't
  be parsed to retrieve anything useful.
docstring_tokens: Attempts to determine the Terminal s dimensions based on the ANSICON environmental variables .