Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for the Spoofchecker::setRestrictionLevel method #2792

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions reference/intl/spoofchecker/setrestrictionlevel.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xml:id="spoofchecker.setrestrictionlevel" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>Spoofchecker::setRestrictionLevel</refname>
<refpurpose>Set the restriction level</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="Spoofchecker">
<modifier>public</modifier> <type>void</type><methodname>Spoofchecker::setRestrictionLevel</methodname>
<methodparam><type>int</type><parameter>level</parameter></methodparam>
</methodsynopsis>
<para>
Set the restriction level that will be performed by <methodname>SpoofChecker::isSuspicious</methodname>.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>level</parameter></term>
<listitem>
<para>
The restriction level that will be performed by <methodname>SpoofChecker::isSuspicious</methodname>.
One of
<constant>Spoofchecker::ASCII</constant>,
<constant>Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE</constant>,
<constant>Spoofchecker::SINGLE_HIGHLY_RESTRICTIVE</constant>,
<constant>Spoofchecker::SINGLE_MODERATELY_RESTRICTIVE</constant>,
<constant>Spoofchecker::SINGLE_MINIMALLY_RESTRICTIVE</constant>, or
<constant>Spoofchecker::UNRESTRICTIVE</constant>.
Default is <constant>SINGLE_HIGHLY_RESTRICTIVE</constant>.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>Spoofchecker::setRestrictionLevel</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$checker = new Spoofchecker();

$checker->setRestrictionLevel(Spoofchecker::ASCII);
]]>
</programlisting>
</example>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
1 change: 1 addition & 0 deletions reference/intl/versions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@
<function name="spoofchecker::issuspicious" from="PHP 5 &gt;= 5.4.0, PHP 7, PHP 8, PECL intl &gt;= 2.0.0"/>
<function name="spoofchecker::setallowedlocales" from="PHP 5 &gt;= 5.4.0, PHP 7, PHP 8, PECL intl &gt;= 2.0.0"/>
<function name="spoofchecker::setchecks" from="PHP 5 &gt;= 5.4.0, PHP 7, PHP 8, PECL intl &gt;= 2.0.0"/>
<function name="spoofchecker::setrestrictionlevel" from="PHP 7 &gt;= 7.3, PHP 8, PECL intl &gt;= 2.0.0"/>
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure for PECL intl &gt;= 2.0.0, where can I know that ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could check the https://github.com/cataphract/PECL-intl source code.

But this is not going to be present in the PECL version, as it has been bundled for a while.

<function name="transliterator" from="PHP 5 &gt;= 5.4.0, PHP 7, PHP 8, PECL intl &gt;= 2.0.0"/>
<function name="transliterator::__construct" from="PHP 5 &gt;= 5.4.0, PHP 7, PHP 8, PECL intl &gt;= 2.0.0"/>
<function name="transliterator::create" from="PHP 5 &gt;= 5.4.0, PHP 7, PHP 8, PECL intl &gt;= 2.0.0"/>
Expand Down