private function resolveDirectories()
    {
        if ($this->scanDirs !== true) {
            return;
        }
        if ($this->rootDir === null) {
            $class     = new ReflectionClass(get_called_class());
            $filePath  = $class->getFileName();
            $this->dir = $rootDir = path_get_directory($filePath);
            $found     = false;
            for ($i = 0; $i < $this->scanDirsMaxLevel; ++$i) {
                if (file_exists($composerPath = path_join($rootDir, 'composer.json'))) {
                    $found = true;
                    break;
                } else {
                    $rootDir = path_get_directory($rootDir); // go 1 up
                }
            }
            if ($found === false) {
                throw new \OutOfBoundsException("Could not determinse composer.json file location in [{$this->dir}] or in {$this->scanDirsMaxLevel} parents of [$this->rootDir}]");
            }
            $this->rootDir = $rootDir;
        }

        $this->dir = $this->dir ?: path_join($this->rootDir, 'src');
    }