protected function addFunctions($functions, $fileDescriptor)
    {
        foreach ($functions as $function) {
            $functionDescriptor = $this->getBuilder()->buildDescriptor($function);
            if ($functionDescriptor) {
                $functionDescriptor->setLocation($fileDescriptor, $function->getLineNumber());
                if (count($functionDescriptor->getTags()->get('package', new Collection())) == 0) {
                    $functionDescriptor->getTags()
                        ->set('package', $fileDescriptor->getTags()->get('package', new Collection()));
                }

                $fileDescriptor->getFunctions()->set(
                    $functionDescriptor->getFullyQualifiedStructuralElementName(),
                    $functionDescriptor
                );
            }
        }
    }