aspect/tests/Classes/ParameterKeyTestClass.php
2026-01-07 12:06:14 -03:00

26 lines
639 B
PHP

<?php
namespace Tests\Classes;
use Tests\Aspects\ParameterKeyAspect;
class ParameterKeyTestClass
{
#[ParameterKeyAspect]
public function methodWithNamedParams(string $firstName, string $lastName, int $age): string
{
return "$firstName $lastName is $age years old";
}
#[ParameterKeyAspect]
public function methodWithSingleParam(array $data): array
{
return $data;
}
#[ParameterKeyAspect]
public function methodWithMixedTypes(int $id, string $name, bool $active, ?object $metadata): string
{
return "ID: $id, Name: $name, Active: " . ($active ? 'yes' : 'no');
}
}