1: <?php
2: /**
3: * Chippyash Digest Authentication Manager
4: *
5: * @copyright Ashley Kitson, UK, 2014
6: * @license GPL 3.0+
7: */
8: namespace Chippyash\Authentication\Manager\Digest;
9:
10: use Chippyash\Type\String\StringType;
11: use Chippyash\Type\Number\IntType;
12:
13: /**
14: * Interface for a Digest Collection
15: */
16: interface DigestCollectionInterface
17: {
18: /**
19: * Return index into collection for a digest given its uid
20: *
21: * @param StringType $uid user id
22: *
23: * @return IntType|BoolType=false
24: */
25: public function findByUid(StringType $uid);
26:
27: /**
28: * Read the digest into the collection from file
29: *
30: * @return Chippyash\Type\BoolType true on success else false
31: */
32: public function read();
33:
34: /**
35: * Write the collection to file
36: *
37: * @return Chippyash\Type\BoolType true on success else false
38: */
39: public function write();
40:
41: /**
42: * Add a digest line to the collection
43: *
44: * @param StringType $uid user id
45: * @param StringType $pwd password
46: *
47: * @return Chippyash\Type\BoolType true on success else false
48: */
49: public function add(StringType $uid, StringType $pwd);
50:
51: /**
52: * Get digest item
53: *
54: * @param IntType $index
55: *
56: * @return array Digest item
57: */
58: public function get(IntType $index);
59:
60: /**
61: * Delete digest item
62: *
63: * @param IntType $index
64: *
65: * @return Chippyash\Type\BoolType true on success else false
66: */
67: public function del(IntType $index);
68:
69: /**
70: * Return the collection item as a raw digest string
71: *
72: * @param IntType $index Index into collection
73: *
74: * @return StringType
75: *
76: * @throws chippyash\Authezntication\Manager\Exceptions\AuthManagerException
77: */
78: public function asString(IntType $index);
79: }
80: