Issues (3)

src/SaveRelationsTrait.php (2 issues)

1
<?php
2
3
namespace lhs\Yii2SaveRelationsBehavior;
4
5
trait SaveRelationsTrait
6
{
7
8
    public function load($data, $formName = null)
9
    {
10
        $loaded = parent::load($data, $formName);
11
        if ($loaded && $this->hasMethod('loadRelations')) {
0 ignored issues
show
It seems like hasMethod() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

11
        if ($loaded && $this->/** @scrutinizer ignore-call */ hasMethod('loadRelations')) {
Loading history...
12
            $this->loadRelations($data);
0 ignored issues
show
It seems like loadRelations() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

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

12
            $this->/** @scrutinizer ignore-call */ 
13
                   loadRelations($data);
Loading history...
13
        }
14
        return $loaded;
15
    }
16
}