Vendor/phpspreadsheet/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Helper/Sample.php
public function getSamples()
    {
        // Populate samples
        $baseDir = realpath(__DIR__ . '/../../../samples');
        $directory = new RecursiveDirectoryIterator($baseDir);
        $iterator = new RecursiveIteratorIterator($directory);
        $regex = new RegexIterator($iterator, '/^.+\.php$/', RecursiveRegexIterator::GET_MATCH);

        $files = [];
        foreach ($regex as $file) {
            $file = str_replace($baseDir . '/', '', $file[0]);
            $info = pathinfo($file);
            $category = str_replace('_', ' ', $info['dirname']);
            $name = str_replace('_', ' ', preg_replace('/(|\.php)/', '', $info['filename']));
            if (!in_array($category, ['.', 'boostrap', 'templates'])) {
                if (!isset($files[$category])) {
                    $files[$category] = [];
                }
                $files[$category][$name] = $file;
            }
        }

        // Sort everything
        ksort($files);
        foreach ($files as &$f) {
            asort($f);
        }

        return $files;
    }
public function getSamples()
    {
        // Populate samples
        $baseDir = realpath(__DIR__ . '/../../../samples');
        $directory = new RecursiveDirectoryIterator($baseDir);
        $iterator = new RecursiveIteratorIterator($directory);
        $regex = new RegexIterator($iterator, '/^.+\.php$/', RecursiveRegexIterator::GET_MATCH);

        $files = [];
        foreach ($regex as $file) {
            $file = str_replace($baseDir . '/', '', $file[0]);
            $info = pathinfo($file);
            $category = str_replace('_', ' ', $info['dirname']);
            $name = str_replace('_', ' ', preg_replace('/(|\.php)/', '', $info['filename']));
            if (!in_array($category, ['.', 'boostrap', 'templates'])) {
                if (!isset($files[$category])) {
                    $files[$category] = [];
                }
                $files[$category][$name] = $file;
            }
        }

        // Sort everything
        ksort($files);
        foreach ($files as &$f) {
            asort($f);
        }

        return $files;
    }
public function getSamples ( ) { // Populate samples $ baseDir = realpath ( __DIR__ . '/../../../samples' ) ; $ directory = new RecursiveDirectoryIterator ( $ baseDir ) ; $ iterator = new RecursiveIteratorIterator ( $ directory ) ; $ regex = new RegexIterator ( $ iterator , '/^.+\.php$/' , RecursiveRegexIterator :: GET_MATCH ) ; $ files = [ ] ; foreach ( $ regex as $ file ) { $ file = str_replace ( $ baseDir . '/' , '' , $ file [ 0 ] ) ; $ info = pathinfo ( $ file ) ; $ category = str_replace ( '_' , ' ' , $ info [ 'dirname' ] ) ; $ name = str_replace ( '_' , ' ' , preg_replace ( '/(|\.php)/' , '' , $ info [ 'filename' ] ) ) ; if ( ! in_array ( $ category , [ '.' , 'boostrap' , 'templates' ] ) ) { if ( ! isset ( $ files [ $ category ] ) ) { $ files [ $ category ] = [ ] ; } $ files [ $ category ] [ $ name ] = $ file ; } } // Sort everything ksort ( $ files ) ; foreach ( $ files as & $ f ) { asort ( $ f ) ; } return $ files ; }
Returns an array of all known samples.

@return string[] [$name => $path]
Returns an array of all known samples .