[TASK] Refactor code to match new structure
[Packages/TYPO3.CMS.git] / typo3 / sysext / linkvalidator / Classes / Linktype / LinktypeInterface.php
1 <?php
2 namespace TYPO3\CMS\Linkvalidator\Linktype;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2010 - 2013 Michael Miousse (michael.miousse@infoglobe.ca)
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26
27 /**
28 * This class provides interface implementation.
29 *
30 * @author Michael Miousse <michael.miousse@infoglobe.ca>
31 */
32 interface LinktypeInterface {
33 /**
34 * Checks a given link for validity
35 *
36 * @param string $url Url to check
37 * @param array $softRefEntry The soft reference entry which builds the context of that url
38 * @param \TYPO3\CMS\Linkvalidator\LinkAnalyzer $reference Parent instance
39 * @return string Validation error message or success code
40 */
41 public function checkLink($url, $softRefEntry, $reference);
42
43 /**
44 * Base type fetching method, based on the type that softRefParserObj returns.
45 *
46 * @param array $value Reference properties
47 * @param string $type Current type
48 * @param string $key Validator hook name
49 * @return string Fetched type
50 */
51 public function fetchType($value, $type, $key);
52
53 /**
54 * Get the value of the private property errorParams.
55 *
56 * @return array All parameters needed for the rendering of the error message
57 */
58 public function getErrorParams();
59
60 /**
61 * Construct a valid Url for browser output
62 *
63 * @param array $row Broken link record
64 * @return string Parsed broken url
65 */
66 public function getBrokenUrl($row);
67
68 /**
69 * Generate the localized error message from the error params saved from the parsing
70 *
71 * @param array $errorParams All parameters needed for the rendering of the error message
72 * @return string Validation error message
73 */
74 public function getErrorMessage($errorParams);
75
76 }
77 ?>