Skip to content

Commit 2158b8c

Browse files
committed
Fix property type in ExtendedRouter + Remove old method from DiscoveryEngine
1 parent cb8ddca commit 2158b8c

3 files changed

Lines changed: 3 additions & 37 deletions

File tree

src/Discovery/Domain/Contracts/DiscoveryEngineInterface.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -111,19 +111,4 @@ public function getDiscoveries(): Collection;
111111
* @return Collection<int, DiscoveryLocationInterface> Collection of discovery locations
112112
*/
113113
public function getLocations(): Collection;
114-
115-
/**
116-
* Enable caching for discoveries
117-
*
118-
* @param mixed $cache The cache implementation (for compatibility)
119-
* @return static Returns self for method chaining
120-
*/
121-
public function withCache(mixed $cache): static;
122-
123-
/**
124-
* Clear all discovery caches
125-
*
126-
* @return static Returns self for method chaining
127-
*/
128-
public function clearCache(): static;
129114
}

src/Discovery/Infrastructure/Services/DiscoveryEngine.php

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use Pollora\Discovery\Domain\Models\DiscoveryItems;
1717
use RecursiveDirectoryIterator;
1818
use RecursiveIteratorIterator;
19+
use Spatie\StructureDiscoverer\Cache\LaravelDiscoverCacheDriver;
1920
use Spatie\StructureDiscoverer\Discover;
2021
use SplFileInfo;
2122

@@ -172,26 +173,6 @@ public function getLocations(): Collection
172173
return $this->locations;
173174
}
174175

175-
/**
176-
* {@inheritDoc}
177-
*/
178-
public function withCache($cache): static
179-
{
180-
// Cache is now handled natively by Spatie's Discover class
181-
// This method is kept for interface compatibility but does nothing
182-
return $this;
183-
}
184-
185-
/**
186-
* {@inheritDoc}
187-
*/
188-
public function clearCache(): static
189-
{
190-
// Cache clearing would be handled by Spatie's cache system
191-
// This method is kept for interface compatibility but does nothing
192-
return $this;
193-
}
194-
195176
/**
196177
* Discover items for a single discovery class
197178
*
@@ -235,7 +216,7 @@ private function discoverStructures(DiscoveryInterface $discovery): void
235216
->full()
236217
->withCache(
237218
$cacheId,
238-
new \Spatie\StructureDiscoverer\Cache\NullDiscoverCacheDriver
219+
new LaravelDiscoverCacheDriver
239220
)
240221
->get();
241222

src/Route/Infrastructure/Services/ExtendedRouter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ private function bindWordPressParametersToRoute(Route $route, \ReflectionFunctio
151151
* @param mixed $callable The callable to reflect
152152
* @return \ReflectionFunctionAbstract|null Reflection object or null on failure
153153
*/
154-
protected function getCallableReflection(string $callable): ?\ReflectionFunctionAbstract
154+
protected function getCallableReflection(mixed $callable): ?\ReflectionFunctionAbstract
155155
{
156156
try {
157157
return match (true) {

0 commit comments

Comments
 (0)