protected function scanDir($dir)
    {
        $result = array();
        $list = $this->scanDirExec($dir);

        foreach ($list as $element) {
            $elementPath = $dir . DIRECTORY_SEPARATOR . $element;

            if (is_file($elementPath)) {
                $fileInfo = pathinfo($element);
                if (in_array($fileInfo['extension'], $this->getAllowedFileExtensions())) {
                    $result[] = $this->getNameSpace() . "\\" . $fileInfo['filename'];
                }
            }
        }
        return $result;
    }