MaintenanceDownCommand::fire()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
4
class MaintenanceDownCommand extends SilverstripeCommand
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
5
{
6
    /**
7
     * @var string
8
     */
9
    protected $name = 'down';
10
11
    /**
12
     * @var string
13
     */
14
    protected $description = 'Put the application into maintenance mode';
15
16
    public function fire()
17
    {
18
        touch(BASE_PATH.'/mysite/down');
19
20
        $this->comment('Application is now in maintenance mode.');
21
    }
22
}
23