0

I had things like that

  90 | WARNING | [ ] Use ::class notation instead.
  92 | WARNING | [x] Short array syntax must be used to define arrays
  94 | WARNING | [ ] Use ::class notation instead.
  96 | WARNING | [x] Short array syntax must be used to define arrays
  98 | WARNING | [ ] Use ::class notation instead.
 100 | WARNING | [x] Short array syntax must be used to define arrays
 102 | WARNING | [ ] Use ::class notation instead.

'value' => array(
    array(
        'label' => __('Is New (by a period)'),
        'value' => 'Amasty\Xlanding\Model\Rule\Condition\IsNewByPeriod',
    ),
    array(
        'label' => __('Is New (by \'is_new\' attribute)'),
        'value' => 'Amasty\Xlanding\Model\Rule\Condition\IsNew',
    ),
    array(
        'label' => __('Created (in days)'),
        'value' => 'Amasty\Xlanding\Model\Rule\Condition\Created',
    ),
    array(
        'label' => __('In Stock'),
        'value' => 'Amasty\Xlanding\Model\Rule\Condition\InStock',
    )
);

and modified them like that

[
    'label' => __('Is New (by a period)'),
    'value' => 'Amasty\Xlanding\Model\Rule\Condition\IsNewByPeriod',
],
[
    'label' => __('Is New (by \'is_new\' attribute)'),
    'value' => 'Amasty\Xlanding\Model\Rule\Condition\IsNew',
],
[
    'label' => __('Created (in days)'),
    'value' => 'Amasty\Xlanding\Model\Rule\Condition\Created',
],

but still have those warnings and can't pass pipeline

  88 | WARNING | [ ] Use ::class notation instead.
  92 | WARNING | [ ] Use ::class notation instead.
  96 | WARNING | [ ] Use ::class notation instead.

how can I fix this?

1 Answer 1

1

That's easy, my friend!

[
    'label' => __('Is New (by a period)'),
    'value' => \Amasty\Xlanding\Model\Rule\Condition\IsNewByPeriod::class,
],
[
    'label' => __('Is New (by \'is_new\' attribute)'),
    'value' => \Amasty\Xlanding\Model\Rule\Condition\IsNew::class,
],
[
    'label' => __('Created (in days)'),
    'value' => \Amasty\Xlanding\Model\Rule\Condition\Created::class,
]
1
  • oh god, Yes it was very easy and I forgot it IDK why. Thank you so much for so quick reply Commented Jul 7, 2020 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.