docs: Improve documentation and translate comments to English

This commit is contained in:
kj
2025-10-10 21:18:22 -03:00
parent 674c9d5ff4
commit 7f62e06ff9
8 changed files with 369 additions and 307 deletions

View File

@@ -7,25 +7,25 @@ use AllowDynamicProperties;
/**
* Neuron - DuckBrain
*
* Neuron, sirve para crear un objeto que alojará valores.
* Además, tiene la característica especial de que al intentar
* acceder a una propiedad no definida, devolverá null en
* lugar de generar un aviso (PHP notice) por variable o propiedad no definida.
* Neuron, serves to create an object that will hold values.
* In addition, it has the special characteristic that when trying
* to access an undefined property, it will return null instead
* of generating a notice (PHP notice) for an undefined variable or property.
*
* El constructor acepta un objeto o un arreglo que contiene los
* valores que estarán definidos.
* The constructor accepts an object or an array containing the
* values that will be defined.
*
* @author KJ
* @website https://kj2.me
* @licence MIT
* @license MIT
*/
#[AllowDynamicProperties]
class Neuron
{
/**
* __construct
* Constructor
*
* @param array $data
* @param array $data Data to initialize the Neuron with. Can be an array or an object.
*/
public function __construct(...$data)
{
@@ -44,10 +44,13 @@ class Neuron
}
/**
* __get
* Magic method __get
*
* @param string $index
* @return null
* This method is called when an undefined property is accessed.
* It returns null instead of triggering an E_NOTICE.
*
* @param string $index The name of the property being accessed.
* @return null Always returns null for undefined properties.
*/
public function __get(string $index): null
{