public function addNamespacesToRegistry($namespaces)
    {
        collect((array) $namespaces)->each(function ($namespace) {
            // Get path from namespace.
            $path = $this->getPathFromNamespace($namespace);

            if (file_exists($path)) {
                // Register each annotations file found in the namespace.
                foreach (Finder::create()->files()->name('*.php')->in($path) as $file) {
                    $this->addFilesToRegistry($file->getRealPath());
                }
            }
        });

        return $this;
    }