Skip to content
Merged
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
10 changes: 2 additions & 8 deletions language/functions.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 4c352e683436649edba35a3272210d8ca4cae611 Maintainer: PhilDaiguille Status: ready -->
<!-- EN-Revision: efd61ff6a9416f6255318fd8906dbcc35d28b235 Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: no -->
<chapter xml:id="language.functions" xmlns="http://docbook.org/ns/docbook" annotations="interactive">
<title>Functions</title>
Expand Down Expand Up @@ -1260,13 +1260,7 @@ class Cart

public function add($product, $quantity)
{
$this->products[$product] = $quantity;
}

public function getQuantity($product)
{
return isset($this->products[$product]) ? $this->products[$product] :
FALSE;
$this->products[$product] = ($this->products[$product] ?? 0) + $quantity;
}

public function getTotal($tax)
Expand Down
14 changes: 12 additions & 2 deletions language/predefined/weakmap/offsetexists.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: d27fdfe8f990c14955354176a615e6e8daeb0525 Maintainer: PhilDaiguille Status: ready -->
<!-- EN-Revision: 069aa704c59a1862dc92fe7d8ffce80a37801735 Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="weakmap.offsetexists" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
Expand Down Expand Up @@ -40,6 +39,17 @@
Devuelve &true; si el objeto está contenido en el diccionario, &false; en caso contrario.
</para>
</refsect1>

<refsect1 role="notes">
&reftitle.notes;
<note>
<simpara>
Al igual que <function>isset</function>, este método devuelve &false; si el
valor asociado a <parameter>object</parameter> es &null;, aunque el objeto
siga estando contenido en el diccionario.
</simpara>
</note>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
Expand Down
25 changes: 16 additions & 9 deletions reference/errorfunc/functions/error-reporting.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 9caac4c5cce859b4ae5d497972442fcfaa840d81 Maintainer: PhilDaiguille Status: ready -->
<!-- EN-Revision: 960c68f48487243d05d2733f6df44a7b2672504e Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="function.error-reporting" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
Expand Down Expand Up @@ -56,7 +55,7 @@
&reftitle.returnvalues;
<para>
Retorna el nivel de <link linkend="ini.error-reporting">error_reporting</link>
<emphasis>antes</emphasis> de que sea cambiado a <parameter>error_level</parameter>
<emphasis>antes</emphasis> de que sea cambiado a <parameter>error_level</parameter>.
</para>
<note>
<simpara>
Expand Down Expand Up @@ -107,14 +106,13 @@ error_reporting(E_ERROR | E_WARNING | E_PARSE);
// (variables no inicializadas, variables mal escritas..)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

// Reportar todas las errores excepto E_NOTICE
// Esta es la configuración por omisión de php.ini
// Reportar todos los errores excepto E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);

// Reportar todas las errores PHP
// Reportar todos los errores PHP
error_reporting(E_ALL);

// Reportar todas las errores PHP
// Reportar todos los errores PHP
error_reporting(-1);

// Igual que error_reporting(E_ALL);
Expand All @@ -131,12 +129,21 @@ ini_set('error_reporting', E_ALL);
&reftitle.notes;
<tip>
<simpara>
Al pasar el valor <literal>-1</literal>, todas las errores posibles
serán mostradas, incluso al agregar nuevos niveles y constantes
Al pasar el valor <literal>-1</literal>, todos los errores posibles
serán mostrados, incluso al agregar nuevos niveles y constantes
en las futuras versiones de PHP. Este comportamiento
es equivalente a proporcionar la constante <constant>E_ALL</constant>.
</simpara>
</tip>
<note>
<simpara>
Un gestor de errores personalizado establecido con
<function>set_error_handler</function> se invoca independientemente del
nivel de <function>error_reporting</function>.
El gestor puede comprobar el nivel actual con
<function>error_reporting</function> y decidir qué hacer.
</simpara>
</note>
</refsect1>

<refsect1 role="seealso">
Expand Down
21 changes: 12 additions & 9 deletions reference/reflection/reflectionattribute.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 51fc0eaf8ecc894bb567fb7de2de789bec74e257 Maintainer: PhilDaiguille Status: ready -->
<!-- EN-Revision: a330e2e2d30b14662ead3c060b31101934097bb2 Maintainer: PhilDaiguille Status: ready -->
<reference xml:id="class.reflectionattribute" role="class" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">

<title>La clase ReflectionAttribute</title>
Expand Down Expand Up @@ -47,12 +47,8 @@
</fieldsynopsis>

<classsynopsisinfo role="comment">&Methods;</classsynopsisinfo>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.reflectionattribute')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='ReflectionAttribute'])">
<xi:fallback/>
</xi:include>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.reflectionattribute')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='ReflectionAttribute'])">
<xi:fallback/>
</xi:include>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.reflectionattribute')/db:refentry/db:refsect1[@role='description']/descendant::db:constructorsynopsis[@role='ReflectionAttribute'])"/>
<xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.reflectionattribute')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[@role='ReflectionAttribute'])"/>
</classsynopsis>
<!-- }}} -->

Expand Down Expand Up @@ -85,10 +81,17 @@
<type>int</type>
</term>
<listitem>
<para>
<simpara>
Devuelve los atributos con una
verificación <parameter>instanceof</parameter>.
</para>
Se utiliza como argumento <parameter>flags</parameter> de
<methodname>ReflectionClass::getAttributes</methodname> y de los
métodos equivalentes de las demás clases de reflexión. Cuando está
activada, el argumento <parameter>name</parameter> coincide con los
atributos cuya clase es la clase indicada o una subclase de esta, o que
implementa la interfaz indicada, en lugar de coincidir únicamente con
el nombre exacto de la clase.
</simpara>
</listitem>
</varlistentry>

Expand Down
11 changes: 10 additions & 1 deletion reference/reflection/reflectionproperty/getdefaultvalue.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 525aa5f198d482c0d03be54ddee5af13b376ab99 Maintainer: PhilDaiguille Status: ready -->
<!-- EN-Revision: 38a3e5bd089cd0cd79fa2c4887c1a9177b4bf2ec Maintainer: PhilDaiguille Status: ready -->
<!-- Reviewed: yes -->
<refentry xml:id="reflectionproperty.getdefaultvalue" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
Expand Down Expand Up @@ -31,6 +31,15 @@
un &null; por defecto de una propiedad tipada no inicializada.
Utilizar <methodname>ReflectionProperty::hasDefaultValue</methodname> para detectar la diferencia.
</simpara>
<note>
<simpara>
Para las <link linkend="language.oop5.decon.constructor.promotion">propiedades promovidas</link>,
el valor por defecto se aplica únicamente al argumento del constructor, no a la propiedad en sí,
por lo que este método devuelve &null; y <methodname>ReflectionProperty::hasDefaultValue</methodname>
devuelve &false;. Utilizar <methodname>ReflectionParameter::getDefaultValue</methodname>
en el argumento correspondiente del constructor para obtenerlo.
</simpara>
</note>
</refsect1>

<refsect1 role="changelog">
Expand Down
Loading