protected function find($paths, $file, $isGlob = false)
    {
        $paths = (array)$paths;
        $file = ltrim($file, "\\/");

        foreach ($paths as $path) {
            $fullPath = $this->clean($path . '/' . $file);

            if ($isGlob) {
                $paths = glob($fullPath, GLOB_BRACE);
                $paths = array_filter((array)$paths);
                return $paths ?: [];
            }

            if (file_exists($fullPath) || is_dir($fullPath)) {
                return $fullPath;
            }
        }

        return null;
    }