code: public static function getConfigDir()
      {
          if (is_null(static::$configDir)) {
              $configDir = '';
              $dirs = [
                  // path/to/module/test/sandbox/config directories
                  __DIR__.'/../../../../*/sandbox/config',
  
                  // path/to/yawik-standard/config
                  __DIR__.'/../../../config',
              ];
              foreach ($dirs as $dir) {
                  foreach (glob($dir) as $testDir) {
                      $configDir = realpath($testDir);
                      break;
                  }
                  if (is_dir($configDir)) {
                      break;
                  }
              }
  
              if (!is_dir($configDir)) {
                  throw new InvalidArgumentException('Can not determine which config directory to be used.');
              }
  
              static::$configDir = $configDir;
          }
          return static::$configDir;
      }
docs: Get config directory location
  
  @return string Configuration directory