1 | <?php |
||
32 | trait StorageTrait |
||
33 | { |
||
34 | |||
35 | /** |
||
36 | * (non-PHPdoc) |
||
37 | * |
||
38 | * @return void |
||
39 | * @see \AppserverIo\Storage\StorageInterface::flush() |
||
40 | */ |
||
41 | public function flush() |
||
49 | |||
50 | /** |
||
51 | * (non-PHPdoc) |
||
52 | * |
||
53 | * @param string $tag The tag the entries must have |
||
54 | * |
||
55 | * @return void |
||
56 | * @see \AppserverIo\Storage\StorageInterface::flushByTag() |
||
57 | */ |
||
58 | public function flushByTag($tag) |
||
68 | |||
69 | /** |
||
70 | * (non-PHPdoc) |
||
71 | * |
||
72 | * @param string $tag A tag to be checked for validity |
||
73 | * |
||
74 | * @return boolean |
||
75 | * @see \AppserverIo\Storage\StorageInterface::isValidTag() |
||
76 | */ |
||
77 | public function isValidTag($tag) |
||
81 | |||
82 | /** |
||
83 | * (non-PHPdoc) |
||
84 | * |
||
85 | * @param string $identifier An identifier to be checked for validity |
||
86 | * |
||
87 | * @return boolean |
||
88 | * @see \AppserverIo\Storage\StorageInterface::isValidEntryIdentifier() |
||
89 | */ |
||
90 | public function isValidEntryIdentifier($identifier) |
||
97 | } |
||
98 |
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idable
provides a methodequalsId
that in turn relies on the methodgetId()
. If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()
as an abstract method to the trait will make sure it is available.