1 | <?php |
||
40 | abstract class AbstractMixer implements \RandomLib\Mixer |
||
41 | { |
||
42 | |||
43 | /** |
||
44 | * Get the block size (the size of the individual blocks used for the mixing) |
||
45 | * |
||
46 | * @return int The block size |
||
47 | */ |
||
48 | abstract protected function getPartSize(); |
||
49 | |||
50 | /** |
||
51 | * Mix 2 parts together using one method |
||
52 | * |
||
53 | * @param string $part1 The first part to mix |
||
54 | * @param string $part2 The second part to mix |
||
55 | * |
||
56 | * @return string The mixed data |
||
57 | */ |
||
58 | abstract protected function mixParts1($part1, $part2); |
||
59 | |||
60 | /** |
||
61 | * Mix 2 parts together using another different method |
||
62 | * |
||
63 | * @param string $part1 The first part to mix |
||
64 | * @param string $part2 The second part to mix |
||
65 | * |
||
66 | * @return string The mixed data |
||
67 | */ |
||
68 | abstract protected function mixParts2($part1, $part2); |
||
69 | |||
70 | /** |
||
71 | * Mix the provided array of strings into a single output of the same size |
||
72 | * |
||
73 | * All elements of the array should be the same size. |
||
74 | * |
||
75 | * @param array $parts The parts to be mixed |
||
76 | * |
||
77 | * @return string The mixed result |
||
78 | */ |
||
79 | public function mix(array $parts) |
||
107 | |||
108 | /** |
||
109 | * Normalize the part array and split it block part size. |
||
110 | * |
||
111 | * This will make all parts the same length and a multiple |
||
112 | * of the part size |
||
113 | * |
||
114 | * @param array $parts The parts to normalize |
||
115 | * |
||
116 | * @return array The normalized and split parts |
||
117 | */ |
||
118 | protected function normalizeParts(array $parts) |
||
135 | |||
136 | private function str_pad($string, $size, $character) |
||
146 | |||
147 | private function str_split($string, $size) |
||
158 | } |
||
159 |
This check looks for method names that are not written in camelCase.
In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection seeker becomes
databaseConnectionSeeker
.