src/Thumbnail.php
public static function synchronizeThumbnail(array $path): array
    {
        $result = [];

        //TODO rebuild or removed - it was be lite check
//        // remove duplicate files
//        $counts = array_count_values($thumbFiles);
//        $duplicate = array_filter($counts, function ($row) { return $row > 1; });
//        foreach ($duplicate as $item => $count) {
//            $pathInfo = pathinfo($item);
//            $duplicateFinder = Finder::findFiles($pathInfo['filename'] . '*')->in(self::$parameters['thumbPath']);
//            foreach ($duplicateFinder as $duplicateItem) {
//                if (unlink($duplicateItem->getPathname())) {
//                    $result[] = $duplicateItem->getPathname();
//                }
//            }
//        }

        // load thumbnail files
        $thumbFiles = self::getThumbFiles();

        // load path files
        $pathFiles = self::getPathFiles($path);

        // remove different files
        $diff = array_diff($thumbFiles, $pathFiles);
        foreach ($diff as $oldName => $file) {
            if (unlink($oldName)) {
                $result[] = $oldName;
            }
        }
        return $result;
    }
public static function synchronizeThumbnail(array $path): array
    {
        $result = [];

        //TODO rebuild or removed - it was be lite check
//        // remove duplicate files
//        $counts = array_count_values($thumbFiles);
//        $duplicate = array_filter($counts, function ($row) { return $row > 1; });
//        foreach ($duplicate as $item => $count) {
//            $pathInfo = pathinfo($item);
//            $duplicateFinder = Finder::findFiles($pathInfo['filename'] . '*')->in(self::$parameters['thumbPath']);
//            foreach ($duplicateFinder as $duplicateItem) {
//                if (unlink($duplicateItem->getPathname())) {
//                    $result[] = $duplicateItem->getPathname();
//                }
//            }
//        }

        // load thumbnail files
        $thumbFiles = self::getThumbFiles();

        // load path files
        $pathFiles = self::getPathFiles($path);

        // remove different files
        $diff = array_diff($thumbFiles, $pathFiles);
        foreach ($diff as $oldName => $file) {
            if (unlink($oldName)) {
                $result[] = $oldName;
            }
        }
        return $result;
    }
public static function synchronizeThumbnail ( array $ path ) : array { $ result = [ ] ; //TODO rebuild or removed - it was be lite check //        // remove duplicate files //        $counts = array_count_values($thumbFiles); //        $duplicate = array_filter($counts, function ($row) { return $row > 1; }); //        foreach ($duplicate as $item => $count) { //            $pathInfo = pathinfo($item); //            $duplicateFinder = Finder::findFiles($pathInfo['filename'] . '*')->in(self::$parameters['thumbPath']); //            foreach ($duplicateFinder as $duplicateItem) { //                if (unlink($duplicateItem->getPathname())) { //                    $result[] = $duplicateItem->getPathname(); //                } //            } //        } // load thumbnail files $ thumbFiles = self :: getThumbFiles ( ) ; // load path files $ pathFiles = self :: getPathFiles ( $ path ) ; // remove different files $ diff = array_diff ( $ thumbFiles , $ pathFiles ) ; foreach ( $ diff as $ oldName => $ file ) { if ( unlink ( $ oldName ) ) { $ result [ ] = $ oldName ; } } return $ result ; }
Synchronize thumbnail.

@param array $path
@return array
Synchronize thumbnail .