!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 

uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 

uid=33(www-data) gid=33(www-data) groups=33(www-data) 

Safe-mode: OFF (not secure)

/uploads/script/vendor/maatwebsite/excel/src/Imports/   drwxr-xr-x
Free 13.26 GB of 57.97 GB (22.88%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     HeadingRowFormatter.php (2.22 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Maatwebsite\Excel\Imports;

use 
Illuminate\Support\Collection;
use 
Illuminate\Support\Str;
use 
InvalidArgumentException;

class 
HeadingRowFormatter
{
    
/**
     * @const string
     */
    
const FORMATTER_NONE 'none';

    
/**
     * @const string
     */
    
const FORMATTER_SLUG 'slug';

    
/**
     * @var string
     */
    
protected static $formatter;

    
/**
     * @var callable[]
     */
    
protected static $customFormatters = [];

    
/**
     * @var array
     */
    
protected static $defaultFormatters = [
        
self::FORMATTER_NONE,
        
self::FORMATTER_SLUG,
    ];

    
/**
     * @param array $headings
     *
     * @return array
     */
    
public static function format(array $headings): array
    {
        return (new 
Collection($headings))->map(function ($value) {
            return static::
callFormatter($value);
        })->
toArray();
    }

    
/**
     * @param string $name
     */
    
public static function default(string $name null)
    {
        if (
null !== $name && !isset(static::$customFormatters[$name]) && !in_array($name, static::$defaultFormatterstrue)) {
            throw new 
InvalidArgumentException(sprintf('Formatter "%s" does not exist'$name));
        }

        static::
$formatter $name;
    }

    
/**
     * @param string   $name
     * @param callable $formatter
     */
    
public static function extend(string $name, callable $formatter)
    {
        static::
$customFormatters[$name] = $formatter;
    }

    
/**
     * Reset the formatter.
     */
    
public static function reset()
    {
        static::default();
    }

    
/**
     * @param mixed $value
     *
     * @return mixed
     */
    
protected static function callFormatter($value)
    {
        static::
$formatter = static::$formatter ?? config('excel.imports.heading_row.formatter'self::FORMATTER_SLUG);

        
// Call custom formatter
        
if (isset(static::$customFormatters[static::$formatter])) {
            
$formatter = static::$customFormatters[static::$formatter];

            return 
$formatter($value);
        }

        if (static::
$formatter === self::FORMATTER_SLUG) {
            return 
Str::slug($value'_');
        }

        
// No formatter (FORMATTER_NONE)
        
return $value;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0054 ]--