Issues (81)

legacy/Behaviors/OldAccessingPatternsTrait.php (3 issues)

Labels
Severity
1
<?php
2
3
namespace ByTIC\DataObjects\Legacy\Behaviors;
4
5
use ByTIC\DataObjects\Behaviors\PropertyOverloading\PropertyOverloadingTrait;
6
7
/**
8
 * Trait OldAccessingPatternsTrait
9
 * @package ByTIC\DataObjects\Legacy\Behaviors
10
 */
11
trait OldAccessingPatternsTrait
12
{
13
    /**
14
     * @param bool $data
15
     * @return \ByTIC\DataObjects\BaseDto|PropertyOverloadingTrait
16
     * @deprecated use fill($data)
17
     */
18
    public function writeData($data = false)
19
    {
20
        return $this->fill($data);
0 ignored issues
show
It seems like fill() 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

20
        return $this->/** @scrutinizer ignore-call */ fill($data);
Loading history...
21
    }
22
23
    /**
24
     * @deprecated use
25
     * @param $key
26
     * @param $value
27
     * @return mixed
28
     */
29
    protected function setDataValue($key, $value)
30
    {
31
        return $this->setPropertyValue($key, $value);
0 ignored issues
show
It seems like setPropertyValue() 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

31
        return $this->/** @scrutinizer ignore-call */ setPropertyValue($key, $value);
Loading history...
32
    }
33
34
    /**
35
     * Get an attribute from the $attributes array.
36
     *
37
     * @param string $key
38
     * @return mixed
39
     */
40
    protected function getAttributeFromArray(string $key)
41
    {
42
        return $this->getPropertyRaw($key);
0 ignored issues
show
It seems like getPropertyRaw() 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

42
        return $this->/** @scrutinizer ignore-call */ getPropertyRaw($key);
Loading history...
43
    }
44
}
45