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...
27
if (!isset($blast['configuration']) && isset($blast['configuration']['templates'])) {
28
return $this;
29
}
30
31
$mapping = [
32
'ShowMapper' => 'show',
33
'ListMapper' => 'list',
34
];
35
$rc = new \ReflectionClass($mapper);
36
if (!isset($mapping[$rc->getShortName()])) {
37
return $this;
38
}
39
40
$mapType = $mapping[$rc->getShortName()];
41
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.