Skip to content

Commit 4f30546

Browse files
committed
Move qualifier attributes from method-level to parameter-level
Method-level #[CacheDir] and #[CacheNamespace] attributes on the constructor were not resolved by Ray.Di, which only processes parameter-level attributes. This caused the cache directory to always fall back to sys_get_temp_dir() instead of using the bound CacheDir value.
1 parent 7443832 commit 4f30546

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/LocalCacheProvider.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222
{
2323
private string $cacheDir;
2424

25-
#[CacheDir('cacheDir')]
26-
#[CacheNamespace('namespace')]
27-
public function __construct(string $cacheDir = '', private string $namespace = '')
28-
{
25+
public function __construct(
26+
#[CacheDir]
27+
string $cacheDir = '',
28+
#[CacheNamespace]
29+
private string $namespace = '',
30+
) {
2931
$this->cacheDir = $cacheDir ?: sys_get_temp_dir();
3032
}
3133

0 commit comments

Comments
 (0)