Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 9 |
|
0.00% |
0 / 5 |
CRAP | |
0.00% |
0 / 1 |
| tao_helpers_translation_TranslationExtractor | |
0.00% |
0 / 9 |
|
0.00% |
0 / 5 |
30 | |
0.00% |
0 / 1 |
| __construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| extract | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | |||||
| setPaths | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| getPaths | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| getTranslationUnits | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
| setTranslationUnits | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | /** |
| 4 | * This program is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU General Public License |
| 6 | * as published by the Free Software Foundation; under version 2 |
| 7 | * of the License (non-upgradable). |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU General Public License |
| 15 | * along with this program; if not, write to the Free Software |
| 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 | * |
| 18 | * Copyright (c) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung |
| 19 | * (under the project TAO-TRANSFER); |
| 20 | * 2009-2012 (update and modification) Public Research Centre Henri Tudor |
| 21 | * (under the project TAO-SUSTAIN & TAO-DEV); |
| 22 | * |
| 23 | */ |
| 24 | |
| 25 | /** |
| 26 | * A TranslationExtractor instance extracts TranslationUnits from a given source |
| 27 | * as an Item, source code, ... |
| 28 | * |
| 29 | * @abstract |
| 30 | * @access public |
| 31 | * @author Jerome Bogaerts |
| 32 | * @package tao |
| 33 | * @since 2.2 |
| 34 | |
| 35 | * @version 1.0 |
| 36 | */ |
| 37 | abstract class tao_helpers_translation_TranslationExtractor |
| 38 | { |
| 39 | // --- ASSOCIATIONS --- |
| 40 | |
| 41 | |
| 42 | // --- ATTRIBUTES --- |
| 43 | |
| 44 | /** |
| 45 | * Short description of attribute paths |
| 46 | * |
| 47 | * @access private |
| 48 | * @var array |
| 49 | */ |
| 50 | private $paths = []; |
| 51 | |
| 52 | /** |
| 53 | * Short description of attribute translationUnits |
| 54 | * |
| 55 | * @access private |
| 56 | * @var array |
| 57 | */ |
| 58 | private $translationUnits = []; |
| 59 | |
| 60 | // --- OPERATIONS --- |
| 61 | |
| 62 | /** |
| 63 | * Creates a new Instance of TranslationExtractor. |
| 64 | * |
| 65 | * @access public |
| 66 | * @author firstname and lastname of author, <author@example.org> |
| 67 | * @param array paths |
| 68 | * @return mixed |
| 69 | */ |
| 70 | public function __construct($paths) |
| 71 | { |
| 72 | |
| 73 | $this->setPaths($paths); |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Any subclass of TranslationExtractor must implement this method aiming at |
| 78 | * TranslationUnits from a given source and set the translationUnit member |
| 79 | * the class. |
| 80 | * |
| 81 | * @abstract |
| 82 | * @access public |
| 83 | * @author firstname and lastname of author, <author@example.org> |
| 84 | * @return mixed |
| 85 | */ |
| 86 | abstract public function extract(); |
| 87 | |
| 88 | /** |
| 89 | * Sets an array of paths where the translations have to be extracted. |
| 90 | * |
| 91 | * @access public |
| 92 | * @author firstname and lastname of author, <author@example.org> |
| 93 | * @param array paths |
| 94 | * @return mixed |
| 95 | */ |
| 96 | public function setPaths($paths) |
| 97 | { |
| 98 | |
| 99 | $this->paths = $paths; |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Gets an array of paths where the translations have to be extracted |
| 104 | * |
| 105 | * @access public |
| 106 | * @author firstname and lastname of author, <author@example.org> |
| 107 | * @return array |
| 108 | */ |
| 109 | public function getPaths() |
| 110 | { |
| 111 | $returnValue = []; |
| 112 | |
| 113 | |
| 114 | $returnValue = $this->paths; |
| 115 | |
| 116 | |
| 117 | return (array) $returnValue; |
| 118 | } |
| 119 | |
| 120 | /** |
| 121 | * Gets an array of TranslationUnit instances that were generated during the |
| 122 | * of the TranslationExtractor::extract method. |
| 123 | * |
| 124 | * @access public |
| 125 | * @author firstname and lastname of author, <author@example.org> |
| 126 | * @return array |
| 127 | */ |
| 128 | public function getTranslationUnits() |
| 129 | { |
| 130 | $returnValue = []; |
| 131 | |
| 132 | |
| 133 | $returnValue = $this->translationUnits; |
| 134 | |
| 135 | |
| 136 | return (array) $returnValue; |
| 137 | } |
| 138 | |
| 139 | /** |
| 140 | * Sets an array of TranslationUnit instances that will be generated during |
| 141 | * invokation of the TranslationExtractor::extract method. |
| 142 | * |
| 143 | * @access protected |
| 144 | * @author firstname and lastname of author, <author@example.org> |
| 145 | * @param array translationUnits |
| 146 | * @return mixed |
| 147 | */ |
| 148 | protected function setTranslationUnits($translationUnits) |
| 149 | { |
| 150 | |
| 151 | $this->translationUnits = $translationUnits; |
| 152 | } |
| 153 | } |