original_string: private static function createDirectory($file)
      {
          $basename = is_string($file) ? basename($file) : '';
          $path = str_replace($basename, '', $file);
  
          if (! empty($path) && ! is_dir($path)) {
              if (! mkdir($path, 0755, true)) {
                  $message = 'Could not create directory in';
                  throw new JsonException($message . ' ' . $path);
              }
          }
      }
code: private static function createDirectory($file)
      {
          $basename = is_string($file) ? basename($file) : '';
          $path = str_replace($basename, '', $file);
  
          if (! empty($path) && ! is_dir($path)) {
              if (! mkdir($path, 0755, true)) {
                  $message = 'Could not create directory in';
                  throw new JsonException($message . ' ' . $path);
              }
          }
      }
code_tokens: private static function createDirectory ( $ file ) { $ basename = is_string ( $ file ) ? basename ( $ file ) : '' ; $ path = str_replace ( $ basename , '' , $ file ) ; if ( ! empty ( $ path ) && ! is_dir ( $ path ) ) { if ( ! mkdir ( $ path , 0755 , true ) ) { $ message = 'Could not create directory in' ; throw new JsonException ( $ message . ' ' . $ path ) ; } } }
docstring: Create directory recursively if it doesn't exist.
  
  @since 1.1.3
  
  @param string $file → path to the directory
  
  @throws JsonException → couldn't create directory
docstring_tokens: Create directory recursively if it doesn t exist .