Commit 0d3956e4 authored by Alexander Schnitzler's avatar Alexander Schnitzler Committed by Christian Kuhn
Browse files

[CLEANUP] General code cleanup

* Cleaned up wrong PHPDoc
* Removed unused variables
* Added missing fields
* Fixed type incompatibility

Change-Id: I3ecc49ceb25458dda285cc4e005c5c2d44112100
Fixes: #40224
Releases: 6.0
Reviewed-on: http://review.typo3.org/14106
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
parent 58d21c1e
......@@ -100,6 +100,7 @@ class ConfigurationManager implements \TYPO3\CMS\Extbase\Configuration\Configura
* @param string $configurationType The kind of configuration to fetch - must be one of the CONFIGURATION_TYPE_* constants
* @param string $extensionName if specified, the configuration for the given extension will be returned.
* @param string $pluginName if specified, the configuration for the given plugin will be returned.
* @throws Exception\InvalidConfigurationType
* @return array The configuration
*/
public function getConfiguration($configurationType, $extensionName = NULL, $pluginName = NULL) {
......
......@@ -145,7 +145,7 @@ class FrontendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\Abst
/**
* Overrides configuration settings from the plugin typoscript (plugin.tx_myext_pi1.)
*
* @param array the framework configuration
* @param array $frameworkConfiguration the framework configuration
* @return array the framework configuration with overridden data from typoscript
*/
protected function overrideConfigurationFromPlugin(array $frameworkConfiguration) {
......@@ -165,7 +165,7 @@ class FrontendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\Abst
* Overrides configuration settings from flexForms.
* This merges the whole flexForm data, and overrides switchable controller actions.
*
* @param array the framework configuration
* @param array $frameworkConfiguration the framework configuration
* @return array the framework configuration with overridden data from flexForm
*/
protected function overrideConfigurationFromFlexForm(array $frameworkConfiguration) {
......@@ -228,6 +228,7 @@ class FrontendConfigurationManager extends \TYPO3\CMS\Extbase\Configuration\Abst
*
* @param array $frameworkConfiguration The original framework configuration
* @param array $flexFormConfiguration The full flexForm configuration
* @throws Exception\ParseError
* @return array the modified framework configuration, if needed
*/
protected function overrideSwitchableControllerActionsFromFlexForm(array $frameworkConfiguration, array $flexFormConfiguration) {
......
......@@ -81,6 +81,7 @@ class Bootstrap implements \TYPO3\CMS\Extbase\Core\BootstrapInterface {
* the initialization and request handling process. Most other applications just call the run() method.
*
* @param array $configuration The TS configuration array
* @throws \RuntimeException
* @return void
* @see run()
* @api
......@@ -254,6 +255,7 @@ class Bootstrap implements \TYPO3\CMS\Extbase\Core\BootstrapInterface {
* function of TYPO3.
*
* @param string $moduleSignature
* @throws \RuntimeException
* @return boolean TRUE, if the request request could be dispatched
* @see run()
*/
......
......@@ -55,12 +55,12 @@ class BackendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $isDisabled = FALSE;
/**
* @var DateTime|NULL
* @var \DateTime|NULL
*/
protected $startDateAndTime = NULL;
/**
* @var DateTime|NULL
* @var \DateTime|NULL
*/
protected $endDateAndTime = NULL;
......@@ -75,7 +75,7 @@ class BackendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $realName = '';
/**
* @var DateTime|NULL
* @var \DateTime|NULL
*/
protected $lastLoginDateAndTime;
......
......@@ -144,7 +144,7 @@ class Category extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* Returns the items within this category.
*
* @return Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_DomainObject_AbstractEntity> the items, might be empty
* @return \TYPO3\CMS\Extbase\Persistence\Generic\ObjectStorage the items, might be empty
* @api
*/
public function getItems() {
......@@ -154,7 +154,7 @@ class Category extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* Sets the items within this category.
*
* @param Tx_Extbase_Persistence_ObjectStorage<Tx_Extbase_DomainObject_AbstractEntity> $items the items, may be empty
* @param \TYPO3\CMS\Extbase\Persistence\Generic\ObjectStorage $items
* @return void
* @api
*/
......
......@@ -131,12 +131,12 @@ class FrontendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
protected $image = '';
/**
* @var DateTime|NULL
* @var \DateTime|NULL
*/
protected $lastlogin = NULL;
/**
* @var DateTime|NULL
* @var \DateTime|NULL
*/
protected $isOnline = NULL;
......@@ -579,7 +579,7 @@ class FrontendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* Sets the lastlogin value
*
* @param DateTime $lastlogin
* @param \DateTime $lastlogin
* @return void
* @api
*/
......@@ -590,7 +590,7 @@ class FrontendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* Returns the lastlogin value
*
* @return DateTime
* @return \DateTime
* @api
*/
public function getLastlogin() {
......@@ -600,7 +600,7 @@ class FrontendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* Sets the isOnline value
*
* @param DateTime $isOnline
* @param \DateTime $isOnline
* @return void
* @api
*/
......@@ -611,7 +611,7 @@ class FrontendUser extends \TYPO3\CMS\Extbase\DomainObject\AbstractEntity {
/**
* Returns the isOnline value
*
* @return DateTime
* @return \DateTime
* @api
*/
public function getIsOnline() {
......
......@@ -62,7 +62,7 @@ abstract class AbstractDomainObject implements \TYPO3\CMS\Extbase\DomainObject\D
private $_isClone = FALSE;
/**
* @var An array holding the clean property values. Set right after reconstitution of the object
* @var array An array holding the clean property values. Set right after reconstitution of the object
*/
private $_cleanProperties;
......@@ -259,6 +259,7 @@ abstract class AbstractDomainObject implements \TYPO3\CMS\Extbase\DomainObject\D
* Returns TRUE if the properties were modified after reconstitution
*
* @param string $propertyName An optional name of a property to be checked if its value is dirty
* @throws \TYPO3\CMS\Extbase\Persistence\Generic\Exception\TooDirtyException
* @return boolean
*/
public function _isDirty($propertyName = NULL) {
......@@ -284,10 +285,9 @@ abstract class AbstractDomainObject implements \TYPO3\CMS\Extbase\DomainObject\D
*
* @param mixed $previousValue
* @param mixed $currentValue
* @return boolan
* @return boolean
*/
protected function isPropertyDirty($previousValue, $currentValue) {
$result = FALSE;
// In case it is an object and it implements the ObjectMonitoringInterface, we call _isDirty() instead of a simple comparison of objects.
// We do this, because if the object itself contains a lazy loaded property, the comparison of the objects might fail even if the object didn't change
if (is_object($currentValue)) {
......
......@@ -68,6 +68,7 @@ class Command {
*
* @param string $controllerClassName Class name of the controller providing the command
* @param string $controllerCommandName Command name, i.e. the method name of the command, without the "Command" suffix
* @throws \InvalidArgumentException
* @author Robert Lemke <robert@typo3.org>
*/
public function __construct($controllerClassName, $controllerCommandName) {
......
......@@ -194,6 +194,7 @@ class Request implements \TYPO3\CMS\Extbase\Mvc\RequestInterface {
*
* @param string $argumentName Name of the argument to set
* @param mixed $value The new value
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentNameException
* @return void
*/
public function setArgument($argumentName, $value) {
......
......@@ -114,6 +114,7 @@ class RequestBuilder {
* @param array $rawCommandLineArguments The unparsed command parts (such as "--foo") as an array
* @param string $controllerObjectName Object name of the designated command controller
* @param string $controllerCommandName Command name of the recognized command (ie. method name without "Command" suffix)
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentMixingException
* @return array All and exceeding command line arguments
* @author Robert Lemke <robert@typo3.org>
*/
......
......@@ -41,6 +41,7 @@ class Response extends \TYPO3\CMS\Extbase\Mvc\Response {
* Sets the numerical exit code which should be returned when exiting this application.
*
* @param integer $exitCode
* @throws \InvalidArgumentException
* @return void
* @api
*/
......
......@@ -397,6 +397,7 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
/**
* Maps arguments delivered by the request object to the local controller arguments.
*
* @throws Exception\RequiredArgumentMissingException
* @return void
*/
protected function mapRequestArgumentsToControllerArguments() {
......@@ -418,6 +419,7 @@ abstract class AbstractController implements \TYPO3\CMS\Extbase\Mvc\Controller\C
$optionalPropertyNames[] = $propertyName;
}
}
/** @var $validator ArgumentsValidator */
$validator = $this->objectManager->create('TYPO3\\CMS\\Extbase\\Mvc\\Controller\\ArgumentsValidator');
$this->deprecatedPropertyMapper->mapAndValidate($allPropertyNames, $this->request->getArguments(), $this->arguments, $optionalPropertyNames, $validator);
$this->argumentsMappingResults = $this->deprecatedPropertyMapper->getMappingResults();
......
......@@ -134,6 +134,7 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
* @return void
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response) {
......@@ -172,6 +173,7 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
*
* Don't override this method - use initializeAction() instead.
*
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentTypeException
* @return void
* @see initializeArguments()
*/
......@@ -287,7 +289,6 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
}
} else {
// @deprecated since Extbase 1.4.0, will be removed with Extbase 6.0
$argumentsAreValid = TRUE;
$preparedArguments = array();
foreach ($this->arguments as $argument) {
$preparedArguments[] = $argument->getValue();
......@@ -318,6 +319,7 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
protected function resolveView() {
$viewObjectName = $this->resolveViewObjectName();
if ($viewObjectName !== FALSE) {
/** @var $view \TYPO3\CMS\Extbase\Mvc\View\ViewInterface */
$view = $this->objectManager->create($viewObjectName);
$this->setViewConfiguration($view);
if ($view->canRender($this->controllerContext) === FALSE) {
......@@ -325,6 +327,7 @@ class ActionController extends \TYPO3\CMS\Extbase\Mvc\Controller\AbstractControl
}
}
if (!isset($view) && $this->defaultViewObjectName != '') {
/** @var $view \TYPO3\CMS\Extbase\Mvc\View\ViewInterface */
$view = $this->objectManager->create($this->defaultViewObjectName);
$this->setViewConfiguration($view);
if ($view->canRender($this->controllerContext) === FALSE) {
......
......@@ -179,7 +179,7 @@ class Argument {
*
* @param string $name Name of this argument
* @param string $dataType The data type of this argument
* @throws InvalidArgumentException if $name is not a string or empty
* @throws \InvalidArgumentException if $name is not a string or empty
* @api
*/
public function __construct($name, $dataType) {
......@@ -296,8 +296,8 @@ class Argument {
* Sets the short name of this argument.
*
* @param string $shortName A "short name" - a single character
* @throws \InvalidArgumentException if $shortName is not a character
* @return \TYPO3\CMS\Extbase\Mvc\Controller\Argument $this
* @throws InvalidArgumentException if $shortName is not a character
* @api
*/
public function setShortName($shortName) {
......@@ -482,6 +482,7 @@ class Argument {
* Additionally, it maps arrays to objects in case it is a normal object.
*
* @param mixed $value The value of an argument
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentValueException
* @return mixed
* @deprecated since Extbase 1.4, will be removed in Extbase 6.0
*/
......
......@@ -74,8 +74,8 @@ class Arguments extends \ArrayObject {
*
* @param mixed $offset Offset - not used here
* @param mixed $value The argument
* @throws \InvalidArgumentException if the argument is not a valid Controller Argument object
* @return void
* @throws InvalidArgumentException if the argument is not a valid Controller Argument object
*/
public function offsetSet($offset, $value) {
if (!$value instanceof \TYPO3\CMS\Extbase\Mvc\Controller\Argument) {
......@@ -90,8 +90,8 @@ class Arguments extends \ArrayObject {
* Sets an argument, aliased to offsetSet()
*
* @param mixed $value The value
* @throws \InvalidArgumentException if the argument is not a valid Controller Argument object
* @return void
* @throws InvalidArgumentException if the argument is not a valid Controller Argument object
*/
public function append($value) {
if (!$value instanceof \TYPO3\CMS\Extbase\Mvc\Controller\Argument) {
......@@ -228,6 +228,7 @@ class Arguments extends \ArrayObject {
*
* @param string $methodName Name of the method
* @param array $arguments Method arguments
* @throws \LogicException
* @return void
*/
public function __call($methodName, array $arguments) {
......
......@@ -44,6 +44,7 @@ class ArgumentsValidator extends \TYPO3\CMS\Extbase\Validation\Validator\Abstrac
* be retrieved through the getErrors() method.
*
* @param object $arguments The arguments object that should be validated
* @throws \InvalidArgumentException
* @return boolean TRUE if all arguments are valid, FALSE if an error occured
*/
public function isValid($arguments) {
......@@ -79,6 +80,7 @@ class ArgumentsValidator extends \TYPO3\CMS\Extbase\Validation\Validator\Abstrac
*
* @param object $arguments The arguments object containing the property (argument) to validate
* @param string $argumentName Name of the property (ie. name of the argument) to validate
* @throws \InvalidArgumentException
* @return boolean TRUE if the argument is valid, FALSE if an error occured
*/
public function isPropertyValid($arguments, $argumentName) {
......
......@@ -97,8 +97,8 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this controller
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
* @return void
* @throws Tx_Extbase_MVC_Exception_UnsupportedRequestTypeException if the controller doesn't support the current request type
* @author Robert Lemke <robert@typo3.org>
* @api
*/
......@@ -121,6 +121,7 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont
* Note: The resulting command method name might not have the correct case, which isn't a problem because PHP is
* case insensitive regarding method names.
*
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\NoSuchCommandException
* @return string Method name of the current command
* @author Robert Lemke <robert@typo3.org>
*/
......@@ -136,6 +137,7 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont
* Initializes the arguments array of this controller by creating an empty argument object for each of the
* method arguments found in the designated command method.
*
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\InvalidArgumentTypeException
* @return void
* @author Robert Lemke <robert@typo3.org>
*/
......@@ -184,6 +186,7 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont
* @param string $commandName
* @param string $controllerObjectName
* @param array $arguments
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @return void
*/
protected function forward($commandName, $controllerObjectName = NULL, array $arguments = array()) {
......@@ -227,7 +230,7 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont
* @see http://www.php.net/sprintf
* @param string $text Text to output
* @param array $arguments Optional arguments to use for sprintf
* @return void
* @return string
*/
protected function output($text, array $arguments = array()) {
if ($arguments !== array()) {
......@@ -253,6 +256,7 @@ class CommandController implements \TYPO3\CMS\Extbase\Mvc\Controller\CommandCont
* An exit status code can be specified @see http://www.php.net/exit
*
* @param integer $exitCode Exit code to return on exit
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
* @return void
*/
protected function quit($exitCode = 0) {
......
......@@ -49,6 +49,7 @@ class FlashMessages implements \TYPO3\CMS\Core\SingletonInterface {
* @param string $message
* @param string $title optional message title
* @param integer $severity optional severity code. One of the t3lib_FlashMessage constants
* @throws \InvalidArgumentException
* @return void
* @api
*/
......
......@@ -85,6 +85,7 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface {
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request to dispatch
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, to be modified by the controller
* @throws Exception\InfiniteLoopException
* @return void
*/
public function dispatch(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response) {
......@@ -108,6 +109,7 @@ class Dispatcher implements \TYPO3\CMS\Core\SingletonInterface {
* If no controller can be found, an instance of NotFoundControllerInterface is returned.
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request to dispatch
* @throws Exception\InvalidControllerException
* @return \TYPO3\CMS\Extbase\Mvc\Controller\ControllerInterface
* @author Bastian Waidelich <bastian@typo3.org>
* @author Robert Lemke <robert@typo3.org>
......
......@@ -43,8 +43,8 @@ class AmbiguousCommandIdentifierException extends \TYPO3\CMS\Extbase\Mvc\Excepti
*
* @param string $message
* @param integer $code
* @param Exception $previousException
* @param array<Tx_Extbase_MVC_CLI_Command> $matchingCommands Commands that matched the command identifier
* @param \Exception|NULL $previousException
* @param array $matchingCommands <Tx_Extbase_MVC_CLI_Command> $matchingCommands Commands that matched the command identifier
* @see Exception
* @author Bastian Waidelich <bastian@typo3.org>
*/
......
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