Skip to content

Commit 56cf693

Browse files
committed
Added the ability to retrieve the cache file system from the cache manager
1 parent 4ca6565 commit 56cf693

4 files changed

Lines changed: 32 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## 1.3.0 - 2020-06-14
8+
9+
### Added
10+
- Ability to retrieve the cache file system from the cache manager.
11+
712
## 1.2.1 - 2020-06-09
813

914
### Fixed
@@ -42,7 +47,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4247
- The initial implementation of the package.
4348

4449
# Versions
45-
- [1.2.1 > Unreleased](https://github.com/ulrack/kernel/compare/1.2.1...HEAD)
50+
- [1.3.0 > Unreleased](https://github.com/ulrack/kernel/compare/1.3.0...HEAD)
51+
- [1.2.1 > 1.3.0](https://github.com/ulrack/kernel/compare/1.2.1...1.3.0)
4652
- [1.2.0 > 1.2.1](https://github.com/ulrack/kernel/compare/1.2.0...1.2.1)
4753
- [1.1.2 > 1.2.0](https://github.com/ulrack/kernel/compare/1.1.2...1.2.0)
4854
- [1.1.1 > 1.1.2](https://github.com/ulrack/kernel/compare/1.1.1...1.1.2)

src/Common/Manager/CacheManagerInterface.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,20 @@
88
namespace Ulrack\Kernel\Common\Manager;
99

1010
use GrizzIt\Cache\Common\CacheInterface;
11+
use GrizzIt\Vfs\Common\FileSystemInterface;
1112
use GrizzIt\Storage\Common\StorageInterface;
12-
use Ulrack\Kernel\Common\KernelManagerInterface;
1313
use GrizzIt\Cache\Common\CacheRegistryInterface;
14+
use Ulrack\Kernel\Common\KernelManagerInterface;
1415

1516
interface CacheManagerInterface extends KernelManagerInterface
1617
{
18+
/**
19+
* Retrieves the cache file system.
20+
*
21+
* @return FileSystemInterface
22+
*/
23+
public function getCacheFileSystem(): FileSystemInterface;
24+
1725
/**
1826
* Retrieves the cache registry.
1927
*

src/Component/Kernel/Manager/CacheManager.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,16 @@ public function boot(): void
8787
);
8888
}
8989

90+
/**
91+
* Retrieves the cache file system.
92+
*
93+
* @return FileSystemInterface
94+
*/
95+
public function getCacheFileSystem(): FileSystemInterface
96+
{
97+
return $this->cacheFileSystem;
98+
}
99+
90100
/**
91101
* Retrieves the cache registry.
92102
*

tests/Component/Kernel/Manager/CacheManagerTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class CacheManagerTest extends TestCase
3131
* @covers ::getCache
3232
* @covers ::registerStorageToCache
3333
* @covers ::resetRegisteredCaches
34+
* @covers ::getCacheFileSystem
3435
* @covers ::__destruct
3536
*/
3637
public function testManager(): void
@@ -69,6 +70,11 @@ public function testManager(): void
6970
$subject = new CacheManager($resourceManager);
7071
$subject->boot();
7172

73+
$this->assertEquals(
74+
$cacheFileSystem,
75+
$subject->getCacheFileSystem()
76+
);
77+
7278
$this->assertInstanceOf(
7379
CacheRegistryInterface::class,
7480
$subject->getCacheRegistry()

0 commit comments

Comments
 (0)