|
| 1 | +<?php |
| 2 | + |
| 3 | + /*******************************************************************\ |
| 4 | + |* Author: Djordje Jocic *| |
| 5 | + |* Year: 2019 *| |
| 6 | + |* License: MIT License (MIT) *| |
| 7 | + |* =============================================================== *| |
| 8 | + |* Personal Website: http://www.djordjejocic.com/ *| |
| 9 | + |* =============================================================== *| |
| 10 | + |* Permission is hereby granted, free of charge, to any person *| |
| 11 | + |* obtaining a copy of this software and associated documentation *| |
| 12 | + |* files (the "Software"), to deal in the Software without *| |
| 13 | + |* restriction, including without limitation the rights to use, *| |
| 14 | + |* copy, modify, merge, publish, distribute, sublicense, and/or *| |
| 15 | + |* sell copies of the Software, and to permit persons to whom the *| |
| 16 | + |* Software is furnished to do so, subject to the following *| |
| 17 | + |* conditions. *| |
| 18 | + |* --------------------------------------------------------------- *| |
| 19 | + |* The above copyright notice and this permission notice shall be *| |
| 20 | + |* included in all copies or substantial portions of the Software. *| |
| 21 | + |* --------------------------------------------------------------- *| |
| 22 | + |* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *| |
| 23 | + |* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *| |
| 24 | + |* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *| |
| 25 | + |* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *| |
| 26 | + |* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, *| |
| 27 | + |* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, RISING *| |
| 28 | + |* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *| |
| 29 | + |* OTHER DEALINGS IN THE SOFTWARE. *| |
| 30 | + \*******************************************************************/ |
| 31 | + |
| 32 | + namespace Jocic\Encoders\Base; |
| 33 | + |
| 34 | + /** |
| 35 | + * <i>DefaultInterface</i> is an interface used to enforce implementation of |
| 36 | + * core default encoder's methods. |
| 37 | + * |
| 38 | + * @author Djordje Jocic <[email protected]> |
| 39 | + * @copyright 2019 All Rights Reserved |
| 40 | + * @version 1.0.0 |
| 41 | + */ |
| 42 | + |
| 43 | + interface DefaultInterface |
| 44 | + { |
| 45 | + /***************\ |
| 46 | + |* GET METHODS *| |
| 47 | + \***************/ |
| 48 | + |
| 49 | + // GET METHODS GO HERE |
| 50 | + |
| 51 | + /***************\ |
| 52 | + |* SET METHODS *| |
| 53 | + \***************/ |
| 54 | + |
| 55 | + // SET METHODS GO HERE |
| 56 | + |
| 57 | + /****************\ |
| 58 | + |* CORE METHODS *| |
| 59 | + \****************/ |
| 60 | + |
| 61 | + /** |
| 62 | + * Encodes a provided string to a desired <i>Base</i> encoding. |
| 63 | + * |
| 64 | + * @author Djordje Jocic <[email protected]> |
| 65 | + * @copyright 2019 All Rights Reserved |
| 66 | + * @version 1.0.0 |
| 67 | + * |
| 68 | + * @param string $input |
| 69 | + * Input string that needs to be encoded. |
| 70 | + */ |
| 71 | + |
| 72 | + public function encode($input); |
| 73 | + |
| 74 | + /** |
| 75 | + * Encodes a provided string to a desired <i>Base</i> decoding. |
| 76 | + * |
| 77 | + * @author Djordje Jocic <[email protected]> |
| 78 | + * @copyright 2019 All Rights Reserved |
| 79 | + * @version 1.0.0 |
| 80 | + * |
| 81 | + * @param string $input |
| 82 | + * Input string that needs to be decoding. |
| 83 | + */ |
| 84 | + |
| 85 | + public function decode($input); |
| 86 | + |
| 87 | + /*****************\ |
| 88 | + |* CHECK METHODS *| |
| 89 | + \*****************/ |
| 90 | + |
| 91 | + /** |
| 92 | + * Checks if a provided encoding is valid or not. |
| 93 | + * |
| 94 | + * @author Djordje Jocic <[email protected]> |
| 95 | + * @copyright 2019 All Rights Reserved |
| 96 | + * @version 1.0.0 |
| 97 | + * |
| 98 | + * @param string $encoding |
| 99 | + * Encoding that needs to be checked. |
| 100 | + */ |
| 101 | + |
| 102 | + public function isEncodingValid($encoding); |
| 103 | + |
| 104 | + /*****************\ |
| 105 | + |* OTHER METHODS *| |
| 106 | + \*****************/ |
| 107 | + |
| 108 | + // OTHER METHODS GO HERE |
| 109 | + } |
| 110 | + |
| 111 | +?> |
0 commit comments