Passed
Push — develop ( 240d18...629593 )
by Andrew
09:42
created

m210817_230853_announcement_v3_4::safeUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 8
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 12
rs 10
1
<?php
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace nystudio107\seomatic\migrations;
4
5
use Craft;
6
use craft\db\Migration;
7
8
/**
9
 * m210817_230853_announcement_v3_4 migration.
0 ignored issues
show
Coding Style introduced by
Doc comment short description must start with a capital letter
Loading history...
10
 */
0 ignored issues
show
Coding Style introduced by
Missing @author tag in class comment
Loading history...
Coding Style introduced by
Missing @package tag in class comment
Loading history...
11
class m210817_230853_announcement_v3_4 extends Migration
0 ignored issues
show
Coding Style introduced by
Class name is not valid; consider M210817_230853_Announcement_V3_4 instead
Loading history...
Coding Style introduced by
Class name must begin with a capital letter
Loading history...
12
{
13
    /**
14
     * @inheritdoc
15
     */
16
    public function safeUp()
17
    {
18
        Craft::$app->announcements->push(
0 ignored issues
show
Bug introduced by
The method push() does not exist on null. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

18
        Craft::$app->announcements->/** @scrutinizer ignore-call */ 
19
                                    push(

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
19
            function($language) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
20
                return Craft::t('seomatic', 'SEOmatic - SEO Settings fields', [], $language);
21
            },
22
            function($language) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
23
                return Craft::t('seomatic', 'The [SEO Settings]({url}) fields in SEOmatic now feature **Override** light switches next to each setting, to improve the content authoring experience.', [
24
                    'url' => 'https://nystudio107.com/docs/seomatic/fields.html',
25
                ], $language);
26
            },
27
            'seomatic'
28
        );
29
    }
30
31
    /**
32
     * @inheritdoc
33
     */
34
    public function safeDown()
35
    {
36
        echo "m210817_230853_announcement_v3_4 cannot be reverted.\n";
37
        return false;
38
    }
39
}
40