code: public static function getIncludedFiles()
      {
          $includedFiles = \get_included_files();
          \usort($includedFiles, function ($valA, $valB) {
              $dirA = \dirname($valA);
              $dirB = \dirname($valB);
              return $dirA == $dirB
                  ? \strnatcasecmp($valA, $valB)
                  : \strnatcasecmp($dirA, $dirB);
          });
          return $includedFiles;
      }
docs: returns required/included files sorted by directory
  
  @return array