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

m210817_230853_announcement_v3_4   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 11
c 1
b 0
f 0
dl 0
loc 27
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A safeUp() 0 12 1
A safeDown() 0 4 1
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