@param array $arrayToSet
@param string $key
@param array|string $value

@return array<string,string>
960552
private function setValue(array $arrayToSet, $key, $value) {
        if ($value <> '') {
            return array_merge($arrayToSet, [$key => $value]);
        }
        return $arrayToSet;
    }
567672
public static function set(array &$array, $key, $value)
    {
        $keys = explode('.', $key);
        foreach($keys as $key) {
            if(!isset($array[$key])) {
                $array[$key] = [];
            }
            $array = &$array[$key];
        }

        $array = $value;
    }
223088
protected function insertInArray($array, $key, $value, $beforeKey)
    {
        // Find the position of the array
        $position = array_search($beforeKey, array_keys($array));

        // Safeguard: silently append if injected position could not be found
        if (false === $position) {
            // @codeCoverageIgnoreStart
            $array[ $key ] = $value;
            return $array;
            // @codeCoverageIgnoreEnd
        }

        if (0 === $position) {
            return [ $key => $value ] + $array;
        }

        // Slice the array up with the new entry in between
        return array_slice($array, 0, $position, true)
             + [ $key => $value ]
             + array_slice($array, $position, count($array) - $position, true);
    }
338792
public static function arrayList(array $array, $key, $value)
    {
        $result = array();

        foreach ($array as $row) {
            if (array_key_exists($key, $row) && array_key_exists($value, $row)) {
                // References
                $name =& $row[$key];
                $text =& $row[$value];

                $result[$name] = $text;

            } else {
                trigger_error(sprintf('Nested arrays must contain both %s and %s', $key, $value));
            }
        }

        return $result;
    }
107535
private function parseRawToArray(&$value, &$key)
    {
        
        // parse a json string to an array
        if (is_string($value)) {
            
            $pos = substr($value,0,1);
            if ($pos == '[' || $pos == '(' || $pos == '{') {
                $json = json_decode($value);
            } else {
                $json = $value;
            }
            

            $pos = substr($value,0,1);
            if ($pos == '[' || $pos == '(' || $pos == '{') {
                $json = json_decode($value);
            } else {
                $json = $value;
            }
            
            if ($json) {                
                $value = $json;
            }
        }

        // if the value is an object, parse it to an array
        if (is_object($value)) {
            $value = (array)$value;
        }

        // call the recursive function to all keys of array
        if (is_array($value)) {
            array_walk_recursive($value, array($this, 'parseRawToArray'));
        }
  }
1140048
public static function arrayPick(array &$array, $key, $value = null)
    {
        if (array_key_exists($key, $array)) {
            $value = $array[$key] ?? $value;
            unset($array[$key]);
        }

        return $value;
    }
847253
public function setArray($key, $value)
    {
        if (!$key)
        {
            throw new Exception('key may not be null.');
        }
        if (!is_array($value))
        {
            throw new Exception('Must use set() for non-array values.');
        }
        $this->_performOperation($key, new SetOperation($value));
    }
953053
public static function get($array, $key, $default = null)
	{
		if (!static::accessible($array))
			return value($default);

		if (is_null($key))
			return $array;

		if (static::exists($array, $key))
			return $array[(string) $key];


		foreach (static::toKey($key) as $segment) {
			if (static::accessible($array) && static::exists($array, $segment)) {
				$array = $array[$segment];
			} else {
				return value($default);
			}
		}

		return $array;
	}
402832
public static function &set(array &$array, string $dottedKey, $value)
    {
        if ($dottedKey === null) {
            return $array = $value;
        }

        if (isset($array[$dottedKey])) {
            $array[$dottedKey] = $value;

            return $array;
        }

        $keyParts = explode('.', $dottedKey, 2);
        if ( ! isset($array[$keyParts[0]])) {
            $array[$keyParts[0]] = [];
        }

        $array[$keyParts[0]] = count($keyParts) === 2
            ? self::set($array[$keyParts[0]], $keyParts[1], $value)
            : $value;

        return $array;
    }
1202297
public static function columnToKey(array $array, $keyColumn, $valueColumn = null): array
    {
        $keys = array_column($array, $keyColumn);
        $values = null === $valueColumn ? $array : array_column($array, $valueColumn);

        return array_combine($keys, $values);
    }
312481
protected function setValue($key, $value, array &$array = array())
    {
        $keys = $this->parseKey($key, $this->separator);
        $pointer = &$array;

        while (count($keys) > 0) {
            $key = array_shift($keys);
            $pointer[$key] = (isset($pointer[$key]) ? $pointer[$key] : array());
            $pointer = &$pointer[$key];
        }

        $pointer = $value;
        return $array;
    }
196014
public function checarValorArrayMultidimensional($key, $value, array $array)
    {
        foreach ($array as $a) {
            if (isset($a[$key]) && $a[$key] == $value) {
                return true;
            }
        }
        return false;
    }
754483
public static function set( &$array, $keys , $value ){
		$kArr = explode(".", $keys);
		$cursor = &$array;
		for( $i=0;$i<count( $kArr);$i++ ){
			$k = $kArr[$i];
			if( !isset($cursor[$k] )){
				//throw new \Exception("Undefined index '" . $k . "'");
				$cursor = null;
				break;
			}
			else{
				$cursor= &$cursor[$k];
			}
		}
		if( $cursor != null ){
			$cursor = $value;
			 
		}
		return $array;
	}
782330
public static function arrayRecovery(array $array, array $keys, $value)
    {
        foreach ($keys as $key) {
            if (!isset($array[$key])) {
                $array[$key] = $value;
            }
        }

        return $array;
    }
271559
public static function arraySortUsingKeys($arrayToSort, $arrayKeysInOrder)
    {
        $result = array();
        foreach($arrayKeysInOrder as $key)
            if(array_key_exists($key, $arrayToSort))
                $result[] = $arrayToSort[$key];

        return $result;
    }
948870
public static function set(array &$array, string $key, $value)
    {
        foreach (\explode('.', $key) as $k) {
            if (!isset($array[$k]) || !\is_array($array[$k])) {
                $array[$k] = [];
            }
            $array = &$array[$k];
        }

        $array = $value;
    }
892943
public static function arrayPluck($array, $key)
    {
        return array_map(function($value) use ($key) {
            return is_object($value) ? $value->$key : $value[$key];
        }, $array);
    }