public function analyse($file, array &$classes = [])
    {
        $tokens = token_get_all(file_get_contents($file));

        $namespace = '';
        $buildingNs = false;
        $buildingClass = false;
        foreach ($tokens as $token) {
            if ($token[0] == T_NAMESPACE) {
                $buildingNs = true;
                $buildingClass = false;
                $namespace = '';
            }

            if ($buildingNs) {
                if (is_numeric($token[0]) && in_array($token[0], [T_STRING, T_NS_SEPARATOR])) {
                    $namespace .= $token[1];
                }

                if (!is_numeric($token[0]) && in_array($token, [';', '{'])) {
                    $buildingNs = false;
                }
            } elseif ($buildingClass) {
                if ($token[0] === T_STRING) {
                    $classes[] = $namespace.'\\'.$token[1];
                    $buildingClass = false;
                    $buildingNs = false;
                }
            } else {
                if ($token[0] === T_CLASS) {
                    $buildingClass = true;
                    $buildingNs = false;
                }
            }
        }

        return $classes;
    }