Completed
Push — master ( d1c926...bb455e )
by Damien
08:00
created

SerializeHelper::isBase64String()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 */
6
7
namespace flipbox\saml\core\helpers;
8
9
use craft\web\Response;
10
11
class SerializeHelper
12
{
13
14
    /**
15
     * set proper headers to present xml correctly
16
     */
17
    public static function xmlContentType()
18
    {
19
        \Craft::$app->getResponse()->format = Response::FORMAT_RAW;
20
        \Craft::$app->getResponse()->getHeaders()->add('Content-Type', 'text/xml');
21
    }
22
23
    /**
24
     * @param string $location
25
     * @param array $parameters
26
     * @return string
27
     */
28
    public static function redirectUrl(string $location, array $parameters)
29
    {
30
31
        return $location .
32
            (strpos($location, '?') === false ? '?' : '&') .
33
            http_build_query($parameters);
34
    }
35
}
36