add comments to Libs.
This commit is contained in:
@ -1,4 +1,20 @@
|
||||
<?php
|
||||
/*
|
||||
* DuckBrain - Microframework
|
||||
*
|
||||
* Params (nombre temporal, a falta de uno mejor), sirve para
|
||||
* crear un objeto con la característica especial de que al
|
||||
* intentar acceder a un atributo que no está definido devolerá
|
||||
* nulo en lugar de generar un error php notice que indica que
|
||||
* se está intentando acceder a un valor no definido.
|
||||
*
|
||||
* El constructor recibe un objeto o arreglo con los valores que
|
||||
* sí estarán definidos.
|
||||
*
|
||||
* Autor: KJ
|
||||
* Web: https://kj2.me
|
||||
* Licencia: MIT
|
||||
*/
|
||||
|
||||
namespace Libs;
|
||||
|
||||
@ -15,7 +31,8 @@ class Params {
|
||||
}
|
||||
|
||||
public function __get($index){
|
||||
return (isset($this->data[$index]) && $this->data[$index] != '') ? $this->data[$index] : null;
|
||||
return (isset($this->data[$index]) && $this->data[$index] != '')
|
||||
? $this->data[$index] : null;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user