Completed
Push — master ( 78baaf...bab9f0 )
by Simon
02:04
created

SetupSiteConfig::setupSiteConfig()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 7
nc 1
nop 4
1
<?php
2
3
namespace Firesphere\PartialUserforms\Tests;
4
5
use SilverStripe\SiteConfig\SiteConfig;
6
7
/**
8
 * Class SetupSiteConfig is a simple helper for the setting up of tests.
9
 * To avoid having to re-type the siteconfig creation/setup every time
10
 * @package Firesphere\PartialUserforms\Tests
11
 */
12
class SetupSiteConfig
13
{
14
    public static function setupSiteConfig($addresses = null, $from = null, $send = true, $cleanup = true)
0 ignored issues
show
Coding Style Best Practice introduced by
Please use __construct() instead of a PHP4-style constructor that is named after the class.
Loading history...
15
    {
16
        $config = SiteConfig::current_site_config();
17
        $config->SendMailTo = $addresses;
18
        $config->SendDailyEmail= $send;
19
        $config->CleanupAfterSend = $cleanup;
20
        $config->SendMailFrom = $from;
21
        $config->write();
22
    }
23
}
24