Tradução em reference/reflection/reflectiontype (#630)

* inclusão dos arquivos originais com revisão atualizada

* Tradução em reference/reflection/reflectiontype
This commit is contained in:
Fernando Wobeto
2024-05-09 18:56:25 -03:00
committed by GitHub
parent 4b33f620d5
commit e91db60332
2 changed files with 210 additions and 0 deletions

View File

@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 6d29533483657c036e49edb5ea88c7103d126681 Maintainer: fernandowobeto Status: ready --><!-- CREDITS: fernandowobeto -->
<refentry xml:id="reflectiontype.allowsnull" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionType::allowsNull</refname>
<refpurpose>Verifica se nulo é permitido</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="ReflectionType">
<modifier>public</modifier> <type>bool</type><methodname>ReflectionType::allowsNull</methodname>
<void/>
</methodsynopsis>
<para>
Verifica se o parâmetro permite &null;.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&true; se &null; é permitido, caso contrário &false;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Exemplo de <methodname>ReflectionType::allowsNull</methodname></title>
<programlisting role="php">
<![CDATA[
<?php
function someFunction(string $param, stdClass $param2 = null) {}
$reflectionFunc = new ReflectionFunction('someFunction');
$reflectionParams = $reflectionFunc->getParameters();
var_dump($reflectionParams[0]->getType()->allowsNull());
var_dump($reflectionParams[1]->getType()->allowsNull());
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(false)
bool(true)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>ReflectionNamedType::isBuiltin</methodname></member>
<member><methodname>ReflectionType::__toString</methodname></member>
<member><methodname>ReflectionParameter::getType</methodname></member>
</simplelist>
</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
-->

View File

@@ -0,0 +1,119 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: a02e0daac60dc75b4a894245250cdec12ce9cb58 Maintainer: fernandowobeto Status: ready --><!-- CREDITS: fernandowobeto -->
<refentry xml:id="reflectiontype.tostring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>ReflectionType::__toString</refname>
<refpurpose>Para string</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis role="ReflectionType">
<modifier>public</modifier> <type>string</type><methodname>ReflectionType::__toString</methodname>
<void/>
</methodsynopsis>
<para>
Obtém o nome do tipo de parâmetro.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Retorna o tipo do parâmetro.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
<methodname>ReflectionType::__toString</methodname> foi retornado.
</entry>
</row>
<row>
<entry>7.1.0</entry>
<entry>
<methodname>ReflectionType::__toString</methodname> foi descontinuado.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Exemplo de <methodname>ReflectionType::__toString</methodname></title>
<programlisting role="php">
<![CDATA[
<?php
function someFunction(string $param) {}
$reflectionFunc = new ReflectionFunction('someFunction');
$reflectionParam = $reflectionFunc->getParameters()[0];
echo $reflectionParam->getType();
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
string
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><methodname>ReflectionNamedType::getName</methodname></member>
<member><methodname>ReflectionNamedType::isBuiltin</methodname></member>
<member><methodname>ReflectionType::allowsNull</methodname></member>
<member><methodname>ReflectionUnionType::getTypes</methodname></member>
<member><methodname>ReflectionParameter::getType</methodname></member>
</simplelist>
</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
-->