The trait Idable provides a method equalsId that in turn relies on the
method getId(). If this method does not exist on a class mixing in this
trait, the method will fail.
Adding the getId() as an abstract method to the trait will make sure it
is available.
Loading history...
28
if (!isset($blast['configuration']) && isset($blast['configuration']['templates'])) {
29
return $this;
30
}
31
32
$mapping = [
33
'ShowMapper' => 'show',
34
'ListMapper' => 'list',
35
];
36
$rc = new \ReflectionClass($mapper);
37
if (!isset($mapping[$rc->getShortName()])) {
38
return $this;
39
}
40
41
$mapType = $mapping[$rc->getShortName()];
42
if (!isset($blast['configuration']['templates'][$mapType])) {
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idableprovides a methodequalsIdthat in turn relies on the methodgetId(). If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()as an abstract method to the trait will make sure it is available.