before params as associative array
This commit is contained in:
parent
d35c3df06d
commit
6946059f07
11 changed files with 154 additions and 8 deletions
26
tests/Classes/ParameterKeyTestClass.php
Normal file
26
tests/Classes/ParameterKeyTestClass.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?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');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue