| 1 | <?php |
||
| 21 | class FileLoaderResolver |
||
| 22 | { |
||
| 23 | /** |
||
| 24 | * @var LoaderInterface[] |
||
| 25 | */ |
||
| 26 | private $loaders = array(); |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param LoaderInterface $loader The translation loader |
||
| 30 | * @param string $extension The file extension |
||
| 31 | */ |
||
| 32 | 14 | public function registerLoader(LoaderInterface $loader, $extension) |
|
| 36 | |||
| 37 | /** |
||
| 38 | * Checks whether or not a translation loader for a file extension is registered. |
||
| 39 | * |
||
| 40 | * @param string $extension The file extension |
||
| 41 | * |
||
| 42 | * @return boolean True if such a loader is registered, false otherwise |
||
| 43 | */ |
||
| 44 | 14 | public function hasLoader($extension) |
|
| 48 | |||
| 49 | /** |
||
| 50 | * Resolves the translation loader for a file extension. |
||
| 51 | * |
||
| 52 | * @param string $extension The file extension |
||
| 53 | * |
||
| 54 | * @return LoaderInterface The resolved loader or null if no loader is |
||
| 55 | * associated with the given extension |
||
| 56 | */ |
||
| 57 | 14 | public function resolveLoader($extension) |
|
| 65 | } |
||
| 66 |