Page MenuHomeWickedGov Phorge

PasswordDef.php
No OneTemporary

Size
956 B
Referenced Files
None
Subscribers
None

PasswordDef.php

<?php
namespace Wikimedia\ParamValidator\TypeDef;
use Wikimedia\ParamValidator\ParamValidator;
/**
* Type definition for "password" types
*
* This is a string type that forces PARAM_SENSITIVE = true.
*
* @see StringDef
* @since 1.34
* @unstable
*/
class PasswordDef extends StringDef {
/** @inheritDoc */
public function normalizeSettings( array $settings ) {
$settings[ParamValidator::PARAM_SENSITIVE] = true;
return parent::normalizeSettings( $settings );
}
/** @inheritDoc */
public function checkSettings( string $name, $settings, array $options, array $ret ): array {
$ret = parent::checkSettings( $name, $settings, $options, $ret );
if ( ( $settings[ParamValidator::PARAM_SENSITIVE] ?? true ) !== true &&
!isset( $ret['issues'][ParamValidator::PARAM_SENSITIVE] )
) {
$ret['issues'][ParamValidator::PARAM_SENSITIVE] =
'Cannot set PARAM_SENSITIVE to false for password-type parameters';
}
return $ret;
}
}

File Metadata

Mime Type
text/x-php
Expires
Sat, May 16, 18:47 (5 h, 36 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
02/e3/2ef7b818ef3363ecdd2776babdbb
Default Alt Text
PasswordDef.php (956 B)

Event Timeline