Issues (480)

src/Config/ModelObject.php (1 issue)

Labels
Severity
1
<?php
2
/**
3
 *
4
 */
5
6
namespace Mvc5\Config;
7
8
trait ModelObject
9
{
10
    /**
11
     *
12
     */
13
    use Count;
14
    use Iterator;
15
16
    /**
17
     * @var Model
18
     */
19
    protected Model $config;
20
21
    /**
22
     * @param array|Model $config
23
     */
24 499
    function __construct($config = [])
25
    {
26 499
        $this->config = $config instanceof Model ? $config : new \Mvc5\ArrayObject((array) $config);
27 499
    }
28
29
    /**
30
     *
31
     */
32 101
    function __clone()
33
    {
34 101
        $this->config = $this->config instanceof Scopable ? $this->config->withScope($this) : clone $this->config;
0 ignored issues
show
The method withScope() does not exist on Mvc5\Config\Model. It seems like you code against a sub-type of Mvc5\Config\Model such as Mvc5\View\ViewModel or Mvc5\View\ViewLayout or Mvc5\ViewLayout or Mvc5\ViewModel or Mvc5\View\SharedLayout or Mvc5\App or Mvc5\App. ( Ignorable by Annotation )

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

34
        $this->config = $this->config instanceof Scopable ? $this->config->/** @scrutinizer ignore-call */ withScope($this) : clone $this->config;
Loading history...
35 101
    }
36
}
37