git subrepo commit mailcow/src/mailcow-dockerized
subrepo: subdir: "mailcow/src/mailcow-dockerized"
merged: "308860af"
upstream: origin: "https://github.com/mailcow/mailcow-dockerized.git"
branch: "master"
commit: "3f1a5af8"
git-subrepo: version: "0.4.5"
origin: "???"
commit: "???"
Change-Id: I5d51c14b45db54fe706be40a591ddbfcea50d4b0
diff --git a/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/helpers.php b/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/helpers.php
index d7f9e0e..886a141 100644
--- a/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/helpers.php
+++ b/mailcow/src/mailcow-dockerized/data/web/inc/lib/vendor/tightenco/collect/src/Collect/Support/helpers.php
@@ -6,19 +6,6 @@
use Symfony\Component\VarDumper\VarDumper;
if (! class_exists(Illuminate\Support\Collection::class)) {
- if (! function_exists('array_wrap')) {
- /**
- * If the given value is not an array, wrap it in one.
- *
- * @param mixed $value
- * @return array
- */
- function array_wrap($value)
- {
- return ! is_array($value) ? [$value] : $value;
- }
- }
-
if (! function_exists('collect')) {
/**
* Create a collection from the given value.
@@ -39,9 +26,9 @@
* @param mixed $value
* @return mixed
*/
- function value($value)
+ function value($value, ...$args)
{
- return $value instanceof Closure ? $value() : $value;
+ return $value instanceof Closure ? $value(...$args) : $value;
}
}
@@ -49,9 +36,9 @@
/**
* Get an item from an array or object using "dot" notation.
*
- * @param mixed $target
- * @param string|array $key
- * @param mixed $default
+ * @param mixed $target
+ * @param string|array|int|null $key
+ * @param mixed $default
* @return mixed
*/
function data_get($target, $key, $default = null)
@@ -62,7 +49,13 @@
$key = is_array($key) ? $key : explode('.', $key);
- while (($segment = array_shift($key)) !== null) {
+ foreach ($key as $i => $segment) {
+ unset($key[$i]);
+
+ if (is_null($segment)) {
+ return $target;
+ }
+
if ($segment === '*') {
if ($target instanceof Collection) {
$target = $target->all();
@@ -70,7 +63,11 @@
return value($default);
}
- $result = Arr::pluck($target, $key);
+ $result = [];
+
+ foreach ($target as $item) {
+ $result[] = data_get($item, $key);
+ }
return in_array('*', $key) ? Arr::collapse($result) : $result;
}
@@ -108,32 +105,18 @@
}
}
- if (! function_exists('with')) {
+ if (! function_exists('class_basename')) {
/**
- * Return the given object. Useful for chaining.
+ * Get the class "basename" of the given object / class.
*
- * @param mixed $object
- * @return mixed
+ * @param string|object $class
+ * @return string
*/
- function with($object)
+ function class_basename($class)
{
- return $object;
- }
- }
+ $class = is_object($class) ? get_class($class) : $class;
- if (! function_exists('dd')) {
- /**
- * Dump the passed variables and end the script.
- *
- * @param mixed
- * @return void
- */
- function dd(...$args)
- {
- foreach ($args as $x) {
- VarDumper::dump($x);
- }
- die(1);
+ return basename(str_replace('\\', '/', $class));
}
}
}