protected function getErrorCounter(ProjectDescriptor $project)
    {
        $errorCounter = 0;

        /* @var FileDescriptor $fileDescriptor */
        foreach ($project->getFiles()->getAll() as $fileDescriptor) {
            $errorCounter += count($fileDescriptor->getAllErrors()->getAll());
        }

        return $errorCounter;
    }