Skip to content

Commit 4d0f55a

Browse files
committed
hint class-string
1 parent aaf78f7 commit 4d0f55a

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/Interfaces/ObjectParameterInterface.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,19 @@ interface ObjectParameterInterface extends ParameterInterface
2323
*/
2424
public function __invoke(object $value): object;
2525

26+
/**
27+
* @return class-string
28+
*/
2629
public function className(): string;
2730

31+
/**
32+
* Return an instance with the specified class name.
33+
*
34+
* This method MUST retain the state of the current instance, and return
35+
* an instance that contains the specified class name.
36+
*
37+
* @param class-string $className
38+
*/
2839
public function withClassName(string $className): self;
2940

3041
public function withDefault(object $default): self;

src/ObjectParameter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ final class ObjectParameter implements ObjectParameterInterface
2626
use ParameterTrait;
2727
use SchemaTrait;
2828

29+
/**
30+
* @var class-string
31+
*/
2932
private string $className;
3033

3134
private ?object $default = null;

src/functions-null.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ function nullArrayString(
106106
);
107107
}
108108

109+
/**
110+
* @param class-string $className
111+
*/
109112
function nullObject(
110113
string $className,
111114
string $description = '',

src/functions.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@ function mixed(
108108
return $parameter;
109109
}
110110

111+
/**
112+
* @param class-string $className
113+
*/
111114
function object(
112115
string $className,
113116
string $description = '',

0 commit comments

Comments
 (0)