protected static function chmodPathRecursive($path, $dirMode, $fileMode)
    {
        $result = false;

        $dirMode = self::valueToOct($dirMode);
        $fileMode = self::valueToOct($fileMode);

        $finder = new Finder();
        // Folders first
        foreach ($finder->directories()->in($path) as $item) {
            $result = chmod($item->getRealPath(), $dirMode);
        }
        // Files next
        foreach ($finder->files()->in($path) as $item) {
            $result = chmod($item->getRealPath(), $fileMode);
        }

        return $result;
    }