File tree 4 files changed +31
-1
lines changed
4 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ public function let()
22
22
public function it_is_initializable ()
23
23
{
24
24
$ this ->shouldHaveType ('TH\Lock\FileFactory ' );
25
+ $ this ->shouldImplement ('TH\Lock\Factory ' );
25
26
}
26
27
27
28
public function it_should_create_a_file_lock ()
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace TH \Lock ;
4
+
5
+ interface Factory
6
+ {
7
+ /**
8
+ * Create a Lock for $resource
9
+ *
10
+ * @param string $resource resource identifier
11
+ * @return Lock
12
+ */
13
+ public function create ($ resource );
14
+ }
Original file line number Diff line number Diff line change 5
5
use Psr \Log \LoggerInterface ;
6
6
use Psr \Log \NullLogger ;
7
7
8
- class FileFactory
8
+ class FileFactory implements Factory
9
9
{
10
10
private $ lock_dir ;
11
11
private $ hash_algo ;
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ namespace TH \Lock ;
4
+
5
+ interface TtlFactory extends Factory
6
+ {
7
+ /**
8
+ * Create a Lock for $resource
9
+ *
10
+ * @param string $resource resource identifier
11
+ * @param integer $ttl lock time-to-live in milliseconds
12
+ * @return Lock
13
+ */
14
+ public function create ($ resource , $ ttl = null );
15
+ }
You can’t perform that action at this time.
0 commit comments