Skip to content

Commit d94db3f

Browse files
authored
Merge pull request #7 from bitwise-operators/fix-cache-with-custom-attributes
fix: Make caching work with custom attributes
2 parents a987a9f + 5de4944 commit d94db3f

3 files changed

Lines changed: 8 additions & 3 deletions

File tree

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
## [1.4.1]
10+
- Custom attributes now work with caching
11+
912
## [1.4.0]
1013
- Add option to use custom attribute classes
1114

src/Console/AutowireCacheCommand.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
use Illuminate\Console\Command;
66
use Illuminate\Support\Facades\App;
77
use Illuminate\Support\Facades\File;
8+
use JeroenG\Autowire\Attribute\Autowire as AutowireAttribute;
9+
use JeroenG\Autowire\Attribute\Configure as ConfigureAttribute;
810
use JeroenG\Autowire\Crawler;
911
use JeroenG\Autowire\Electrician;
1012

@@ -17,7 +19,9 @@ class AutowireCacheCommand extends Command
1719
public function handle(): int
1820
{
1921
$crawler = Crawler::in(config('autowire.directories'));
20-
$electrician = new Electrician($crawler);
22+
$autowireAttribute = config('autowire.autowire_attribute', AutowireAttribute::class);
23+
$configureAttribute = config('autowire.configure_attribute', ConfigureAttribute::class);
24+
$electrician = new Electrician($crawler, $autowireAttribute, $configureAttribute);
2125

2226
$autowires = $crawler->filter(fn(string $name) => $electrician->canAutowire($name))->classNames();
2327
$configures = $crawler->filter(fn(string $name) => $electrician->canConfigure($name))->classNames();

src/Console/AutowireClearCommand.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
use Illuminate\Console\Command;
66
use Illuminate\Support\Facades\App;
77
use Illuminate\Support\Facades\File;
8-
use JeroenG\Autowire\Crawler;
9-
use JeroenG\Autowire\Electrician;
108

119
class AutowireClearCommand extends Command
1210
{

0 commit comments

Comments
 (0)