Debian Codegraph @

vendor/wikimedia/idle-dom/src/Helper/AbortSignal.php

raw
1 <?php
2
3 // AUTOMATICALLY GENERATED. DO NOT EDIT.
4 // Use `composer build` to regenerate.
5
6 namespace Wikimedia\IDLeDOM\Helper;
7
8 trait AbortSignal {
9
10 // Underscore is used to avoid conflicts with DOM-reserved names
11 // phpcs:disable PSR2.Methods.MethodDeclaration.Underscore
12 // phpcs:disable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
13
14 /**
15 * Handle an attempt to get a non-existing property on this
16 * object. The default implementation raises an exception
17 * but the implementor can choose a different behavior:
18 * return null (like JavaScript), dynamically create the
19 * property, etc.
20 * @param string $prop the name of the property requested
21 * @return mixed
22 */
23 abstract protected function _getMissingProp( string $prop );
24
25 /**
26 * Handle an attempt to set a non-existing property on this
27 * object. The default implementation raises an exception
28 * but the implementor can choose a different behavior:
29 * ignore the operation (like JavaScript), dynamically create
30 * the property, etc.
31 * @param string $prop the name of the property requested
32 * @param mixed $value the value to set
33 */
34 abstract protected function _setMissingProp( string $prop, $value ): void;
35
36 // phpcs:enable
37
38 /**
39 * @param string $name
40 * @return mixed
41 */
42 public function __get( string $name ) {
43 '@phan-var \Wikimedia\IDLeDOM\AbortSignal $this';
44 // @var \Wikimedia\IDLeDOM\AbortSignal $this
45 switch ( $name ) {
46 case "aborted":
47 return $this->getAborted();
48 case "onabort":
49 return $this->getOnabort();
50 default:
51 break;
52 }
53 '@phan-var \Wikimedia\IDLeDOM\Helper\AbortSignal $this';
54 // @var \Wikimedia\IDLeDOM\Helper\AbortSignal $this
55 return $this->_getMissingProp( $name );
56 }
57
58 /**
59 * @param string $name
60 * @return bool
61 */
62 public function __isset( string $name ): bool {
63 '@phan-var \Wikimedia\IDLeDOM\AbortSignal $this';
64 // @var \Wikimedia\IDLeDOM\AbortSignal $this
65 switch ( $name ) {
66 case "aborted":
67 return true;
68 case "onabort":
69 return true;
70 default:
71 break;
72 }
73 return false;
74 }
75
76 /**
77 * @param string $name
78 * @param mixed $value
79 */
80 public function __set( string $name, $value ): void {
81 '@phan-var \Wikimedia\IDLeDOM\AbortSignal $this';
82 // @var \Wikimedia\IDLeDOM\AbortSignal $this
83 switch ( $name ) {
84 case "onabort":
85 $this->setOnabort( $value );
86 return;
87 default:
88 break;
89 }
90 '@phan-var \Wikimedia\IDLeDOM\Helper\AbortSignal $this';
91 // @var \Wikimedia\IDLeDOM\Helper\AbortSignal $this
92 $this->_setMissingProp( $name, $value );
93 }
94
95 /**
96 * @param string $name
97 */
98 public function __unset( string $name ): void {
99 '@phan-var \Wikimedia\IDLeDOM\AbortSignal $this';
100 // @var \Wikimedia\IDLeDOM\AbortSignal $this
101 switch ( $name ) {
102 case "aborted":
103 break;
104 case "onabort":
105 break;
106 default:
107 return;
108 }
109 $trace = debug_backtrace();
110 while (
111 count( $trace ) > 0 &&
112 $trace[0]['function'] !== "__unset"
113 ) {
114 array_shift( $trace );
115 }
116 trigger_error(
117 'Undefined property' .
118 ' via ' . ( $trace[0]['function'] ?? '' ) . '(): ' . $name .
119 ' in ' . ( $trace[0]['file'] ?? '' ) .
120 ' on line ' . ( $trace[0]['line'] ?? '' ),
121 E_USER_NOTICE
122 );
123 }
124
125 }