protected function getValidator()
    {
        $helper = $this;

        // @codingStandardsIgnoreStart
        return function ($dir) use ($helper) {
            $dir = rtrim($dir, '\\/');
            if (!is_dir($helper->getDotGitDirectory($dir))) {
                throw new LogicException('No information about git directory.');
            }

            return $dir;
        };
        // @codingStandardsIgnoreEnd
    }