henrik/component

2.3 2024-07-07 06:27 UTC

This package is auto-updated.

Last update: 2024-10-07 07:00:29 UTC


README

Here is the example hpw to use component

use Henrik\Component\Component;

require "../vendor/autoload.php";

class Simple extends Component{
    private int $x;

    /**
     * @return int
     */
    public function getX(): int
    {
        return $this->x;
    }

    /**
     * @param int $x
     */
    public function setX(int $x): void
    {
        $this->x = $x;
    }
}

$simple = new Simple();
$simple->x = 45;  //accessing the private property of `Simple` class by getter and setter
echo $simple->x;