original_string: protected function getURLData(string $driveUrl): array
      {
          /*
           * Known URL types:
           * https://drive.google.com/file/d/0B5q9i2h-vGaCc1ZBVnFhRzN2a3c/view?ths=true A Word file from Google Drive
           * https://docs.google.com/document/d/1-phrJPVDf1SpQYU5SzJY00Ke0c6QJmILHrtm_pcQk4w/edit A Google Docs file
           * https://drive.google.com/drive/u/0/folders/0B5q9i2h-vGaCQXhLZFNLT2JyV0U A Google Drive folder
           * https://drive.google.com/open?id=0B5q9i2h-vGaCYUE0ZTM4MDhseTQ A Google Drive shared file
           * https://docs.google.com/spreadsheets/d/13QGip-d_Z88Xru64pEFRyFVDKujDOUjciy35Qytw-Qc/edit A Google Sheets file
           * https://docs.google.com/presentation/d/1R1oF7zmnSDX3w3FBpyCTJnjvOu68C7Q2MH4kI4xMFWc/edit A Google Slides file
           */
  
          // Is it a Google Drive|Docs URL?
          if (preg_match(
              '~^(https?://)?(drive|docs)\.google\.[a-z]+/.*(/d/|/folders/|[\?&]id=)([a-z0-9\-_]{20,})([/?&#]|$)~i',
              $driveUrl,
              $matches
          )) {
              // Any Google Drive item can be obtained using a single API method: https://developers.google.com/drive/api/v3/reference/files/get
              return [
                  'type' => 'google-drive',
                  'id' => $matches[4]
              ];
          }
  
          // Is it a URL?
          if (preg_match('~^(https?://)?[a-z0-9.@\-_\x{0080}-\x{FFFF}]+(:[0-9]+)?(/|$)~iu', $driveUrl, $matches)) {
              return [
                  'type' => 'http',
                  'driveUrl' => ($matches[1] ? '' : 'http://').$driveUrl
              ];
          }
  
          return ['type' => 'unknown'];
      }
code: protected function getURLData(string $driveUrl): array
      {
          /*
           * Known URL types:
           * https://drive.google.com/file/d/0B5q9i2h-vGaCc1ZBVnFhRzN2a3c/view?ths=true A Word file from Google Drive
           * https://docs.google.com/document/d/1-phrJPVDf1SpQYU5SzJY00Ke0c6QJmILHrtm_pcQk4w/edit A Google Docs file
           * https://drive.google.com/drive/u/0/folders/0B5q9i2h-vGaCQXhLZFNLT2JyV0U A Google Drive folder
           * https://drive.google.com/open?id=0B5q9i2h-vGaCYUE0ZTM4MDhseTQ A Google Drive shared file
           * https://docs.google.com/spreadsheets/d/13QGip-d_Z88Xru64pEFRyFVDKujDOUjciy35Qytw-Qc/edit A Google Sheets file
           * https://docs.google.com/presentation/d/1R1oF7zmnSDX3w3FBpyCTJnjvOu68C7Q2MH4kI4xMFWc/edit A Google Slides file
           */
  
          // Is it a Google Drive|Docs URL?
          if (preg_match(
              '~^(https?://)?(drive|docs)\.google\.[a-z]+/.*(/d/|/folders/|[\?&]id=)([a-z0-9\-_]{20,})([/?&#]|$)~i',
              $driveUrl,
              $matches
          )) {
              // Any Google Drive item can be obtained using a single API method: https://developers.google.com/drive/api/v3/reference/files/get
              return [
                  'type' => 'google-drive',
                  'id' => $matches[4]
              ];
          }
  
          // Is it a URL?
          if (preg_match('~^(https?://)?[a-z0-9.@\-_\x{0080}-\x{FFFF}]+(:[0-9]+)?(/|$)~iu', $driveUrl, $matches)) {
              return [
                  'type' => 'http',
                  'driveUrl' => ($matches[1] ? '' : 'http://').$driveUrl
              ];
          }
  
          return ['type' => 'unknown'];
      }
code_tokens: protected function getURLData ( string $ driveUrl ) : array { /*
           * Known URL types:
           * https://drive.google.com/file/d/0B5q9i2h-vGaCc1ZBVnFhRzN2a3c/view?ths=true A Word file from Google Drive
           * https://docs.google.com/document/d/1-phrJPVDf1SpQYU5SzJY00Ke0c6QJmILHrtm_pcQk4w/edit A Google Docs file
           * https://drive.google.com/drive/u/0/folders/0B5q9i2h-vGaCQXhLZFNLT2JyV0U A Google Drive folder
           * https://drive.google.com/open?id=0B5q9i2h-vGaCYUE0ZTM4MDhseTQ A Google Drive shared file
           * https://docs.google.com/spreadsheets/d/13QGip-d_Z88Xru64pEFRyFVDKujDOUjciy35Qytw-Qc/edit A Google Sheets file
           * https://docs.google.com/presentation/d/1R1oF7zmnSDX3w3FBpyCTJnjvOu68C7Q2MH4kI4xMFWc/edit A Google Slides file
           */ // Is it a Google Drive|Docs URL? if ( preg_match ( '~^(https?://)?(drive|docs)\.google\.[a-z]+/.*(/d/|/folders/|[\?&]id=)([a-z0-9\-_]{20,})([/?&#]|$)~i' , $ driveUrl , $ matches ) ) { // Any Google Drive item can be obtained using a single API method: https://developers.google.com/drive/api/v3/reference/files/get return [ 'type' => 'google-drive' , 'id' => $ matches [ 4 ] ] ; } // Is it a URL? if ( preg_match ( '~^(https?://)?[a-z0-9.@\-_\x{0080}-\x{FFFF}]+(:[0-9]+)?(/|$)~iu' , $ driveUrl , $ matches ) ) { return [ 'type' => 'http' , 'driveUrl' => ( $ matches [ 1 ] ? '' : 'http://' ) . $ driveUrl ] ; } return [ 'type' => 'unknown' ] ; }
docstring: Gets a URL type and data
  
  @param string $driveUrl The driveUrl
  @return array The `type` key contains the type name. Other keys depend on the type.
docstring_tokens: Gets a URL type and data