public static function detectClassComponent($mClass): ?Component
    {
        $oReflect  = new \ReflectionClass($mClass);
        $sPath     = $oReflect->getFileName();
        $bIsVendor = (bool) preg_match('/^' . preg_quote(NAILS_APP_PATH . 'vendor', '/') . '/', $sPath);

        if (!$bIsVendor) {
            return static::getApp();
        }

        foreach (static::available() as $oComponent) {

            if ($oComponent->slug === 'app') {
                continue;
            } elseif (preg_match('/^' . preg_quote($oComponent->path, '/') . '/', $sPath)) {
                return $oComponent;
            }
        }

        return null;
    }