Completed
Push — master ( 33a5ea...6cf420 )
by Mehmet
01:22
created

AbstractValueObject   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __destruct() 0 3 1
A getValueObjectName() 0 3 1
1
<?php
2
3
namespace ValueObjects\Common;
4
5
abstract class AbstractValueObject
6
{
7
    protected $observerManager;
8
9
    public static function getValueObjectName(): string
10
    {
11
        return substr(strrchr(static::class, '\\'), 1);
12
    }
13
14
    public function __destruct()
15
    {
16
        $this->observer()->notify('destroy');
0 ignored issues
show
Bug introduced by
The method observer() does not exist on ValueObjects\Common\AbstractValueObject. ( Ignorable by Annotation )

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

16
        $this->/** @scrutinizer ignore-call */ 
17
               observer()->notify('destroy');

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...
17
    }
18
}
19