Commit cd9a6e9d authored by Wouter Wolters's avatar Wouter Wolters Committed by Stefan Neufeind
Browse files

[CLEANUP] Cleanup ext:core

* Add phpDoc to properties
* Add phpDoc to functions
* Shorten class names where possible

Resolves: #62707
Releases: master
Change-Id: I763595103127d79af8abcb3ebcfb6b3767df9451
Reviewed-on: http://review.typo3.org/33804


Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
parent dbde3aa8
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\DataHandling;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Interface for classes which hook into TCEmain and do additional processing
* after the upload of a file.
......@@ -20,6 +21,7 @@ namespace TYPO3\CMS\Core\DataHandling;
* @author Xavier Perseguers <typo3@perseguers.ch>
*/
interface DataHandlerProcessUploadHookInterface {
/**
* Post-process a file upload.
*
......
......@@ -19,6 +19,7 @@ namespace TYPO3\CMS\Core\DataHandling;
* @package TYPO3\CMS\Core
*/
class TableColumnSubType extends \TYPO3\CMS\Core\Type\Enumeration {
const __default = self::DEFAULT_TYPE;
/**
......
......@@ -19,6 +19,7 @@ namespace TYPO3\CMS\Core\DataHandling;
* @package TYPO3\CMS\Core
*/
class TableColumnType extends \TYPO3\CMS\Core\Type\Enumeration {
const __default = self::INPUT;
/**
......
......@@ -13,12 +13,14 @@ namespace TYPO3\CMS\Core\ElementBrowser;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Interface for classes which hook into browse_links
*
* @author Ingo Renner <ingo@typo3.org>
*/
interface ElementBrowserHookInterface {
/**
* Initializes the hook object
*
......
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Encoder;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Adopted from OWASP Enterprise Security API (ESAPI) reference implementation for the JavaScript Codec.
* Original Author: Mike Boberski
......
......@@ -13,12 +13,13 @@ namespace TYPO3\CMS\Core\Error;
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* An abstract exception handler
*
* This file is a backport from FLOW3
* This file is a backport from TYPO3 Flow
*
* @author Ingo Renner <ingo@typo3.org>
*/
......
......@@ -13,16 +13,17 @@ namespace TYPO3\CMS\Core\Error;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* A basic but solid exception handler which catches everything which
* falls through the other exception handlers and provides useful debugging
* information.
*
* This file is a backport from FLOW3
* This file is a backport from TYPO3 Flow
*
* @author Ingo Renner <ingo@typo3.org>
*/
class DebugExceptionHandler extends \TYPO3\CMS\Core\Error\AbstractExceptionHandler {
class DebugExceptionHandler extends AbstractExceptionHandler {
/**
* Constructs this exception handler - registers itself as the default exception handler.
......
......@@ -13,12 +13,13 @@ namespace TYPO3\CMS\Core\Error;
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Global error handler for TYPO3
*
* This file is a backport from FLOW3
* This file is a backport from TYPO3 Flow
*
* @author Rupert Germann <rupi@gmx.li>
*/
......@@ -102,12 +103,10 @@ class ErrorHandler implements ErrorHandlerInterface {
} else {
switch ($errorLevel) {
case E_USER_ERROR:
case E_RECOVERABLE_ERROR:
$severity = 2;
break;
case E_USER_WARNING:
case E_WARNING:
$severity = 1;
break;
......
......@@ -13,14 +13,16 @@ namespace TYPO3\CMS\Core\Error;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Error handler interface for TYPO3
*
* This file is a backport from FLOW3
* This file is a backport from TYPO3 Flow
*
* @author Ingo Renner <ingo@typo3.org>
*/
interface ErrorHandlerInterface {
/**
* Registers this class as default error handler
*
......
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Error;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* An exception which represents a PHP error.
*
......@@ -22,5 +23,4 @@ namespace TYPO3\CMS\Core\Error;
*/
class Exception extends \TYPO3\CMS\Core\Exception {
}
......@@ -13,15 +13,16 @@ namespace TYPO3\CMS\Core\Error;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Contract for an exception handler
*
* This file is a backport from FLOW3
* This file is a backport from TYPO3 Flow
*
* @author Ingo Renner <ingo@typo3.org>
*/
interface ExceptionHandlerInterface
{
interface ExceptionHandlerInterface {
/**
* Constructs this exception handler - registers itself as the default exception handler.
*/
......
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Error\Http;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* HTTP Client Error Exception (Error 4xx)
*
......@@ -20,5 +21,4 @@ namespace TYPO3\CMS\Core\Error\Http;
*/
abstract class AbstractClientErrorException extends StatusException {
}
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Error\Http;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* HTTP Server Error Exception (Error 5xx)
*
......@@ -20,5 +21,4 @@ namespace TYPO3\CMS\Core\Error\Http;
*/
abstract class AbstractServerErrorException extends StatusException {
}
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Error\Http;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Exception for Error 400 - Bad Request
*
......
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Error\Http;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Exception for Error 403 - Forbidden
*
......
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Error\Http;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Exception for Error 404 - Page Not Found
*
......
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Error\Http;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Exception for Error 503 - Service Unavailable
*
......
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Error\Http;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* HTTP Status Exception
*
......
......@@ -13,6 +13,7 @@ namespace TYPO3\CMS\Core\Error\Http;
*
* The TYPO3 project - inspiring people to share!
*/
/**
* Exception for Error 401 - Unauthorized
*
......
......@@ -13,6 +13,9 @@ namespace TYPO3\CMS\Core\ExtDirect;
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Ext Direct API Generator
*
......@@ -104,7 +107,7 @@ class ExtDirectApi {
}
if (is_array($configuration)) {
$className = $configuration['callbackClass'];
$serverObject = \TYPO3\CMS\Core\Utility\GeneralUtility::getUserObj($className, FALSE);
$serverObject = GeneralUtility::getUserObj($className, FALSE);
$javascriptNamespaces[$javascriptNamespace]['actions'][$javascriptObjectName] = array();
foreach (get_class_methods($serverObject) as $methodName) {
$reflectionMethod = new \ReflectionMethod($serverObject, $methodName);
......@@ -132,9 +135,9 @@ class ExtDirectApi {
public function getRoutingUrl($namespace) {
$url = '';
if (TYPO3_MODE === 'FE') {
$url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl('?eID=ExtDirect&action=route&namespace=');
$url = GeneralUtility::locationHeaderUrl('?eID=ExtDirect&action=route&namespace=');
} else {
$url = \TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'ajax.php?ajaxID=ExtDirect::route&namespace=');
$url = GeneralUtility::locationHeaderUrl(GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir . 'ajax.php?ajaxID=ExtDirect::route&namespace=');
}
$url .= rawurlencode($namespace);
return $url;
......@@ -148,10 +151,10 @@ class ExtDirectApi {
* @return string $javascriptNamespaces
*/
protected function getExtDirectApi(array $filterNamespaces) {
$noCache = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET('no_cache') ? TRUE : FALSE;
$noCache = GeneralUtility::_GET('no_cache') ? TRUE : FALSE;
// Look up into the cache
$cacheIdentifier = 'ExtDirectApi';
$cacheHash = md5($cacheIdentifier . implode(',', $filterNamespaces) . \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SSL') . serialize($this->settings) . TYPO3_MODE . \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_HOST'));
$cacheHash = md5($cacheIdentifier . implode(',', $filterNamespaces) . GeneralUtility::getIndpEnv('TYPO3_SSL') . serialize($this->settings) . TYPO3_MODE . GeneralUtility::getIndpEnv('HTTP_HOST'));
// With no_cache always generate the javascript content
// Generate the javascript content if it wasn't found inside the cache and cache it!
if ($noCache || !is_array(($javascriptNamespaces = \TYPO3\CMS\Frontend\Page\PageRepository::getHash($cacheHash)))) {
......@@ -193,7 +196,7 @@ class ExtDirectApi {
}
$found = FALSE;
foreach ($filterNamespaces as $filter) {
if (\TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr($filter, $namespace)) {
if (GeneralUtility::isFirstPartOfStr($filter, $namespace)) {
$found = TRUE;
break;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment