Server IP : 172.67.158.161 / Your IP : 3.128.198.49 Web Server : LiteSpeed System : Linux business53.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64 User : giankuin ( 1871) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/thread-self/root/home/giankuin/sieuthiweb.com.vn/wp-content/plugins/duplicator-pro/aws/Guzzle/Inflection/ |
Upload File : |
<?php namespace DuplicatorPro\Guzzle\Inflection; defined("ABSPATH") or die(""); /** * Decorator used to add pre-computed inflection mappings to an inflector */ class PreComputedInflector implements InflectorInterface { /** @var array Array of pre-computed inflections */ protected $mapping = array( 'snake' => array(), 'camel' => array() ); /** @var InflectorInterface Decorated inflector */ protected $decoratedInflector; /** * @param InflectorInterface $inflector Inflector being decorated * @param array $snake Hash of pre-computed camel to snake * @param array $camel Hash of pre-computed snake to camel * @param bool $mirror Mirror snake and camel reflections */ public function __construct(InflectorInterface $inflector, array $snake = array(), array $camel = array(), $mirror = false) { if ($mirror) { $camel = array_merge(array_flip($snake), $camel); $snake = array_merge(array_flip($camel), $snake); } $this->decoratedInflector = $inflector; $this->mapping = array( 'snake' => $snake, 'camel' => $camel ); } public function snake($word) { return isset($this->mapping['snake'][$word]) ? $this->mapping['snake'][$word] : $this->decoratedInflector->snake($word); } /** * Converts strings from snake_case to upper CamelCase * * @param string $word Value to convert into upper CamelCase * * @return string */ public function camel($word) { return isset($this->mapping['camel'][$word]) ? $this->mapping['camel'][$word] : $this->decoratedInflector->camel($word); } }