-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathHTMLHyperlinkElementUtils.php
More file actions
78 lines (69 loc) · 2.14 KB
/
HTMLHyperlinkElementUtils.php
File metadata and controls
78 lines (69 loc) · 2.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
// AUTOMATICALLY GENERATED. DO NOT EDIT.
// Use `composer build` to regenerate.
namespace Wikimedia\IDLeDOM\Helper;
trait HTMLHyperlinkElementUtils {
// Underscore is used to avoid conflicts with DOM-reserved names
// phpcs:disable PSR2.Methods.MethodDeclaration.Underscore
// phpcs:disable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
/**
* Handle an attempt to get a non-existing property on this
* object. The default implementation raises an exception
* but the implementor can choose a different behavior:
* return null (like JavaScript), dynamically create the
* property, etc.
* @param string $prop the name of the property requested
* @return mixed
*/
protected function _getMissingProp( string $prop ) {
$trace = debug_backtrace();
while (
count( $trace ) > 0 &&
$trace[0]['function'] !== "__get"
) {
array_shift( $trace );
}
trigger_error(
'Undefined property' .
' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $prop .
' in ' . ( $trace[0]['file'] ?? '' ) .
' on line ' . ( $trace[0]['line'] ?? '' ),
E_USER_NOTICE
);
return null;
}
/**
* Handle an attempt to set a non-existing property on this
* object. The default implementation raises an exception
* but the implementor can choose a different behavior:
* ignore the operation (like JavaScript), dynamically create
* the property, etc.
* @param string $prop the name of the property requested
* @param mixed $value the value to set
*/
protected function _setMissingProp( string $prop, $value ): void {
$trace = debug_backtrace();
while (
count( $trace ) > 0 &&
$trace[0]['function'] !== "__set"
) {
array_shift( $trace );
}
trigger_error(
'Undefined property' .
' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $prop .
' in ' . ( $trace[0]['file'] ?? '' ) .
' on line ' . ( $trace[0]['line'] ?? '' ),
E_USER_NOTICE
);
}
// phpcs:enable
/**
* @return string
*/
public function __toString(): string {
'@phan-var \Wikimedia\IDLeDOM\HTMLHyperlinkElementUtils $this';
// @var \Wikimedia\IDLeDOM\HTMLHyperlinkElementUtils $this
return $this->getHref();
}
}