MCPcopy Create free account
hub / github.com/ShivaBhattacharjee/KeyZen / __construct

Method __construct

data/php/03_classes.php:3–6  ·  view source on GitHub ↗
(
        private string $name,
        private int $score = 0
    )

Source from the content-addressed store, hash-verified

1<?php
2class User {
3 public function __construct(
4 private string $name,
5 private int $score = 0
6 ) {}
7
8 public function addScore(int $pts): void {
9 $this->score += $pts;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected