public static function calculateArrayDepth(array $array, $deReference = false)
    {
        if ($deReference === true) {
            /** @var array $array */
            $array = unserialize(serialize($array));
        }

        $maxDepth = 1;
        foreach ($array as $value) {
            if (is_array($value)) {
                $depth = static::calculateArrayDepth($value) + 1;
                if ($depth > $maxDepth) {
                    $maxDepth = $depth;
                }
            }
        }

        return $maxDepth;
    }