protected function determineLanguages(OutputInterface $output, $srcdir, $filter = array())
    {
        if (!is_dir($srcdir)) {
            throw new \InvalidArgumentException(sprintf('The path %s does not exist.', $srcdir));
        }

        $this->writelnVerbose($output, sprintf('<info>scanning for languages in: %s</info>', $srcdir));
        $matches  = array();
        $iterator = new \DirectoryIterator($srcdir);
        do {
            $item = $iterator->getFilename();

            if ((!$iterator->isDot()) && (strlen($item) == 2) && ((!$filter) || in_array($item, $filter))) {
                $matches[] = $item;
                $this->writelnVerbose($output, sprintf('<info>using: %s</info>', $item));
            } elseif (!$iterator->isDot()) {
                $this->writelnVerbose($output, sprintf('<info>not using: %s</info>', $item));
            }
            $iterator->next();
        } while ($iterator->valid());

        $this->languages = $matches;
    }
protected function determineLanguages(OutputInterface $output, $srcdir, $filter = array())
    {
        if (!is_dir($srcdir)) {
            throw new \InvalidArgumentException(sprintf('The path %s does not exist.', $srcdir));
        }

        $this->writelnVerbose($output, sprintf('<info>scanning for languages in: %s</info>', $srcdir));
        $matches  = array();
        $iterator = new \DirectoryIterator($srcdir);
        do {
            $item = $iterator->getFilename();

            if ((!$iterator->isDot()) && (strlen($item) == 2) && ((!$filter) || in_array($item, $filter))) {
                $matches[] = $item;
                $this->writelnVerbose($output, sprintf('<info>using: %s</info>', $item));
            } elseif (!$iterator->isDot()) {
                $this->writelnVerbose($output, sprintf('<info>not using: %s</info>', $item));
            }
            $iterator->next();
        } while ($iterator->valid());

        $this->languages = $matches;
    }
protected function determineLanguages ( OutputInterface $ output , $ srcdir , $ filter = array ( ) ) { if ( ! is_dir ( $ srcdir ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The path %s does not exist.' , $ srcdir ) ) ; } $ this -> writelnVerbose ( $ output , sprintf ( '<info>scanning for languages in: %s</info>' , $ srcdir ) ) ; $ matches = array ( ) ; $ iterator = new \ DirectoryIterator ( $ srcdir ) ; do { $ item = $ iterator -> getFilename ( ) ; if ( ( ! $ iterator -> isDot ( ) ) && ( strlen ( $ item ) == 2 ) && ( ( ! $ filter ) || in_array ( $ item , $ filter ) ) ) { $ matches [ ] = $ item ; $ this -> writelnVerbose ( $ output , sprintf ( '<info>using: %s</info>' , $ item ) ) ; } elseif ( ! $ iterator -> isDot ( ) ) { $ this -> writelnVerbose ( $ output , sprintf ( '<info>not using: %s</info>' , $ item ) ) ; } $ iterator -> next ( ) ; } while ( $ iterator -> valid ( ) ) ; $ this -> languages = $ matches ; }
Determine the list of languages.

@param OutputInterface $output The output interface to receive log messages.

@param string          $srcdir The source directory to be examined.

@param array           $filter The files to be filtered away (to be ignored).

@return void

@throws \InvalidArgumentException When the given source directory does not exist, an exception is thrown.
Determine the list of languages .