Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F2753706
PropGuard.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
531 B
Referenced Files
None
Subscribers
None
PropGuard.php
View Options
<?php
namespace
Wikimedia\RemexHtml
;
use
InvalidArgumentException
;
/**
* This is a statically configurable mechanism for preventing the setting of
* undeclared properties on objects. The point of it is to detect programmer
* errors.
*/
trait
PropGuard
{
public
static
$armed
=
true
;
public
function
__set
(
$name
,
$value
)
{
if
(
self
::
$armed
)
{
throw
new
InvalidArgumentException
(
"Property
\"
$name
\"
on object of class "
.
get_class
(
$this
)
.
" is undeclared"
);
}
else
{
$this
->
$name
=
$value
;
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Fri, Jul 3, 21:38 (20 h, 4 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
f4/18/3d6a1759007a1efc9ea0e21dbed2
Default Alt Text
PropGuard.php (531 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment