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.
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...
22
if ( $this->hideIf !== null ) {
23
$config['hideIf'] = $this->hideIf;
24
}
25
} );
26
}
27
}
28
29
class HTMLFormFieldLayout extends OOUI\FieldLayout {
30
use HTMLFormElement;
31
32
public function __construct( $fieldWidget, array $config = [] ) {
33
// Parent constructor
34
parent::__construct( $fieldWidget, $config );
35
// Traits
36
$this->initializeHTMLFormElement( $config );
37
}
38
39
protected function getJavaScriptClassName() {
40
return 'mw.htmlform.FieldLayout';
41
}
42
}
43
44
class HTMLFormActionFieldLayout extends OOUI\ActionFieldLayout {
45
use HTMLFormElement;
46
47
public function __construct( $fieldWidget, $buttonWidget = false, array $config = [] ) {
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.