Commit eb049dba authored by Wouter Wolters's avatar Wouter Wolters Committed by Benni Mack
Browse files

[TASK] Streamline return tags in phpdocs

The TYPO3 Core currently has no guidline how to handle phpdoc
comments regarding @return annoations related to "void" and "null".

In practice, these annotations have no additional value if no additional
documentation is given.

With this change, the php-cs-fixer will remove any unnecessary linebreaks
within the comments above the @return annotation, as well as remove completely
empty phpdoc comments because the @return annotation is removed.

Please be aware, that once PSR-5 is accepted, this coding standard
within the TYPO3 Core will change again, where there are currently
some further proposal details like inheritance information.

Resolves: #80454
Releases: master
Change-Id: Ie969d720684c0a75919fe5addd1c36ef5b12eb04
Reviewed-on: https://review.typo3.org/51686

Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 7415d7d0
......@@ -74,6 +74,9 @@ return PhpCsFixer\Config::create()
'native_function_casing' => true,
'self_accessor' => true,
'no_short_bool_cast' => true,
'no_unneeded_control_parentheses' => true
'no_unneeded_control_parentheses' => true,
'phpdoc_no_empty_return' => true,
'no_blank_lines_after_phpdoc' => true,
'phpdoc_trim' => true
])
->setFinder($finder);
......@@ -267,8 +267,6 @@ class AcceptanceCoreEnvironment extends Extension
/**
* Method executed after each test
*
* @return void
*/
public function cleanupTypo3Environment()
{
......
......@@ -54,8 +54,6 @@ interface AccessibleObjectInterface
*
* @param string $propertyName name of property to set value for, must not be empty
* @param mixed $value the new value for the property defined in $propertyName
*
* @return void
*/
public function _set($propertyName, $value);
......@@ -64,8 +62,6 @@ interface AccessibleObjectInterface
*
* @param string $propertyName name of property to set value for, must not be empty
* @param mixed &$value the new value for the property defined in $propertyName
*
* @return void
*/
public function _setRef($propertyName, &$value);
......@@ -74,8 +70,6 @@ interface AccessibleObjectInterface
*
* @param string $propertyName name of property to set value for, must not be empty
* @param mixed $value the new value for the property defined in $propertyName
*
* @return void
*/
public function _setStatic($propertyName, $value);
......
......@@ -19,7 +19,6 @@ namespace TYPO3\TestingFramework\Core;
*
* Don't sub class this test case but rather choose a more specialized base test case,
* such as UnitTestCase or FunctionalTestCase
*
*/
abstract class BaseTestCase extends \PHPUnit_Framework_TestCase
{
......@@ -97,7 +96,6 @@ abstract class BaseTestCase extends \PHPUnit_Framework_TestCase
* @throws \InvalidArgumentException
*
* @return \PHPUnit_Framework_MockObject_MockObject|\TYPO3\TestingFramework\Core\AccessibleObjectInterface
*
*/
protected function getAccessibleMockForAbstractClass(
$originalClassName, array $arguments = [], $mockClassName = '',
......@@ -252,7 +250,6 @@ abstract class BaseTestCase extends \PHPUnit_Framework_TestCase
* @param object $target The instance which needs the dependency
* @param string $name Name of the property to be injected
* @param mixed $dependency The dependency to inject – usually an object but can also be any other type
* @return void
* @throws \RuntimeException
* @throws \InvalidArgumentException
*/
......
......@@ -92,7 +92,6 @@ class FileStreamWrapper
* Initialize the stream wrapper with a root path and register itself
*
* @param $rootPath
* @return void
*/
public static function init($rootPath)
{
......@@ -102,7 +101,6 @@ class FileStreamWrapper
/**
* Unregister the stream wrapper and reset all static members to their default values
* @return void
*/
public static function destroy()
{
......@@ -119,7 +117,6 @@ class FileStreamWrapper
* @param string $overlay Relative path to the root folder
* @param string $replace The path that should replace the overlay path
* @param bool $createFolder TRUE of the folder should be created (mkdir)
* @return void
*/
public static function registerOverlayPath($overlay, $replace, $createFolder = true)
{
......@@ -165,7 +162,6 @@ class FileStreamWrapper
* file:// scheme a \BadFunctionCallException will be thrown.
*
* @throws \BadFunctionCallException
* @return void
*/
protected static function register()
{
......@@ -185,8 +181,6 @@ class FileStreamWrapper
/**
* Restore the file handler
*
* @return void
*/
protected static function restore()
{
......@@ -341,7 +335,6 @@ class FileStreamWrapper
/**
* Close a file
*
*/
public function stream_close()
{
......
......@@ -125,7 +125,6 @@ class Collector implements \TYPO3\CMS\Core\SingletonInterface
/**
* @param string $content
* @param NULL|array $configuration
* @return void
*/
public function attachSection($content, array $configuration = null)
{
......@@ -189,8 +188,6 @@ class Collector implements \TYPO3\CMS\Core\SingletonInterface
/**
* Collector needs to be reset after attaching a section, otherwise records will pile up.
*
* @return void
*/
protected function reset()
{
......
......@@ -27,7 +27,6 @@ class Renderer implements \TYPO3\CMS\Core\SingletonInterface
/**
* @param string $content
* @param NULL|array $configuration
* @return void
*/
public function parseValues($content, array $configuration = null)
{
......
......@@ -24,7 +24,6 @@ class RequestBootstrap
* to start clean for a functional test.
*
* @param array $requestArguments usually JSON encoded arguments, should include "documentRoot" and "requestUrl"
* @return void
*/
public static function setGlobalVariables(array $requestArguments = null)
{
......
......@@ -205,7 +205,6 @@ abstract class FunctionalTestCase extends BaseTestCase
*
* This method should be called with parent::setUp() in your test cases!
*
* @return void
* @throws \Doctrine\DBAL\DBALException
*/
protected function setUp()
......@@ -354,7 +353,6 @@ abstract class FunctionalTestCase extends BaseTestCase
* Imports a data set represented as XML into the test database,
*
* @param string $path Absolute path to the XML file containing the data set to load
* @return void
* @throws Exception
*/
protected function importDataSet($path)
......
......@@ -52,8 +52,6 @@ class Testbase
/**
* Makes sure error messages during the tests get displayed no matter what is set in php.ini.
*
* @return void
*/
public function enableDisplayErrors()
{
......@@ -65,7 +63,6 @@ class Testbase
* helpers during tests setup. Those are sanitized in SystemEnvironmentBuilder
* to be not defined again.
*
* @return void
* @see SystemEnvironmentBuilder::defineBaseConstants()
*/
public function defineBaseConstants()
......@@ -92,8 +89,6 @@ class Testbase
/**
* Defines the PATH_site and PATH_thisScript constant and sets $_SERVER['SCRIPT_NAME'].
* For unit tests only
*
* @return void
*/
public function defineSitePath()
{
......@@ -110,8 +105,6 @@ class Testbase
* Defines the constant ORIGINAL_ROOT for the path to the original TYPO3 document root.
* For functional / acceptance tests only
* If ORIGINAL_ROOT already is defined, this method is a no-op.
*
* @return void
*/
public function defineOriginalRootPath()
{
......@@ -126,8 +119,6 @@ class Testbase
/**
* Define TYPO3_MODE to BE
*
* @return void
*/
public function defineTypo3ModeBe()
{
......@@ -136,8 +127,6 @@ class Testbase
/**
* Sets the environment variable TYPO3_CONTEXT to testing.
*
* @return void
*/
public function setTypo3TestingContext()
{
......@@ -148,7 +137,6 @@ class Testbase
* Creates directories, recursively if required.
*
* @param string $directory Absolute path to directories to create
* @return void
* @throws Exception
*/
public function createDirectory($directory)
......@@ -185,7 +173,6 @@ class Testbase
* This may happen if a functional test before threw a fatal or is too old
*
* @param string $instancePath Absolute path to test instance
* @return void
* @throws Exception
*/
public function removeOldInstanceIfExists($instancePath)
......@@ -206,7 +193,6 @@ class Testbase
* Used in functional tests to reuse an instance for multiple tests in one test case.
*
* @param string $instancePath Absolute path to test instance
* @return void
*/
public function createLastRunTextfile($instancePath)
{
......@@ -220,7 +206,6 @@ class Testbase
*
* @param string $instancePath Absolute path to test instance
* @throws Exception
* @return void
*/
public function setUpInstanceCoreLinks($instancePath)
{
......@@ -246,7 +231,6 @@ class Testbase
* @param string $instancePath Absolute path to test instance
* @param array $extensionPaths Contains paths to extensions relative to document root
* @throws Exception
* @return void
*/
public function linkTestExtensionsToInstance($instancePath, array $extensionPaths)
{
......@@ -277,7 +261,6 @@ class Testbase
* @param string $instancePath Absolute path to test instance
* @param array $pathsToLinkInTestInstance Contains paths as array of source => destination in key => value pairs of folders relative to test instance root
* @throws Exception if a source path could not be found and on failing creating the symlink
* @return void
*/
public function linkPathsInTestInstance($instancePath, array $pathsToLinkInTestInstance)
{
......@@ -396,7 +379,6 @@ class Testbase
* @param array $configuration Base configuration array
* @param array $overruleConfiguration Overrule factory and base configuration
* @throws Exception
* @return void
*/
public function setUpLocalConfiguration($instancePath, array $configuration, array $overruleConfiguration)
{
......@@ -485,7 +467,6 @@ class Testbase
* @param string $databaseName Database name of this test instance
* @param string $originalDatabaseName Original database name before suffix was added
* @throws \TYPO3\TestingFramework\Core\Exception
* @return void
*/
public function setUpTestDatabase($databaseName, $originalDatabaseName)
{
......@@ -521,7 +502,6 @@ class Testbase
* For functional and acceptance tests.
*
* @param string $instancePath Absolute path to test instance
* @return void
*/
public function setUpBasicTypo3Bootstrap($instancePath)
{
......@@ -545,7 +525,6 @@ class Testbase
* For functional and acceptance tests.
*
* @throws Exception
* @return void
*/
public function initializeTestDatabaseAndTruncateTables()
{
......@@ -564,8 +543,6 @@ class Testbase
/**
* Load ext_tables.php files.
* For functional and acceptance tests.
*
* @return void
*/
public function loadExtensionTables()
{
......@@ -575,8 +552,6 @@ class Testbase
/**
* Create tables and import static rows.
* For functional and acceptance tests.
*
* @return void
*/
public function createDatabaseStructure()
{
......@@ -596,7 +571,6 @@ class Testbase
* Imports a data set represented as XML into the test database,
*
* @param string $path Absolute path to the XML file containing the data set to load
* @return void
* @throws \Doctrine\DBAL\DBALException
* @throws \InvalidArgumentException
* @throws \RuntimeException
......
......@@ -25,7 +25,6 @@ use TYPO3\TestingFramework\Core\BaseTestCase;
* to extend this class for unit test cases instead of the base test case because if,
* at some point, specific behavior needs to be implemented for unit tests, your test cases
* will profit from it automatically.
*
*/
abstract class UnitTestCase extends BaseTestCase
{
......@@ -55,7 +54,6 @@ abstract class UnitTestCase extends BaseTestCase
* is not needed this way.
*
* @throws \RuntimeException
* @return void
*/
protected function tearDown()
{
......
......@@ -75,7 +75,6 @@ abstract class ViewHelperBaseTestcase extends \TYPO3\TestingFramework\Core\Unit\
/**
* Sets up all properties of a viewhelper needed to test a viewhelper
* @return void
*/
protected function setUp()
{
......@@ -110,7 +109,6 @@ abstract class ViewHelperBaseTestcase extends \TYPO3\TestingFramework\Core\Unit\
/**
* @param ViewHelperInterface $viewHelper
* @return void
*/
protected function injectDependenciesIntoViewHelper(ViewHelperInterface $viewHelper)
{
......
......@@ -57,8 +57,6 @@ class AboutController extends ActionController
/**
* Main action: Show standard information
*
* @return void
*/
public function indexAction()
{
......
......@@ -68,8 +68,6 @@ class ModulesController extends ActionController
/**
* Show general information and the installed modules
*
* @return void
*/
public function indexAction()
{
......
......@@ -129,7 +129,6 @@ class Avatar
/**
* Validates the registered avatar providers
*
* @return void
* @throws \RuntimeException
*/
protected function validateSortAndInitiateAvatarProviders()
......
......@@ -150,8 +150,6 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
/**
* Gets the PHP version
*
* @return void
*/
protected function getPhpVersion()
{
......@@ -164,8 +162,6 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
/**
* Get the database info
*
* @return void
*/
protected function getDatabase()
{
......@@ -184,8 +180,6 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
/**
* Gets the application context
*
* @return void
*/
protected function getApplicationContext()
{
......@@ -217,8 +211,6 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
/**
* Gets the current GIT revision and branch
*
* @return void
*/
protected function getGitRevision()
{
......@@ -245,8 +237,6 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
/**
* Gets the system kernel and version
*
* @return void
*/
protected function getOperatingSystem()
{
......@@ -294,8 +284,6 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
/**
* Emits the "getSystemInformation" signal
*
* @return void
*/
protected function emitGetSystemInformation()
{
......@@ -304,8 +292,6 @@ class SystemInformationToolbarItem implements ToolbarItemInterface
/**
* Emits the "loadMessages" signal
*
* @return void
*/
protected function emitLoadMessages()
{
......
......@@ -109,8 +109,6 @@ class Clipboard
****************************************/
/**
* Initialize the clipboard from the be_user session
*
* @return void
*/
public function initializeClipboard()
{
......@@ -134,8 +132,6 @@ class Clipboard
* Call this method after initialization if you want to lock the clipboard to operate on the normal pad only.
* Trying to switch pad through ->setCmd will not work.
* This is used by the clickmenu since it only allows operation on single elements at a time (that is the "normal" pad)
*
* @return void
*/
public function lockToNormal()
{
......@@ -153,7 +149,6 @@ class Clipboard
* Selecting elements for 'copy' should be done by simultaneously setting setCopyMode.
*
* @param array $cmd Array of actions, see function description
* @return void
*/
public function setCmd($cmd)
{
......@@ -195,7 +190,6 @@ class Clipboard
* Setting the current pad on clipboard
*
* @param string $padIdent Key in the array $this->clipData
* @return void
*/
public function setCurrentPad($padIdent)
{
......@@ -215,8 +209,6 @@ class Clipboard
/**
* Call this after initialization and setCmd in order to save the clipboard to the user session.
* The function will check if the internal flag ->changed has been set and if so, save the clipboard. Else not.
*
* @return void
*/
public function endClipboard()
{
......@@ -803,7 +795,6 @@ class Clipboard
* Removes element on clipboard
*
* @param string $el Key of element in ->clipData array
* @return void
*/
public function removeElement($el)
{
......@@ -816,7 +807,6 @@ class Clipboard
* Use ->endClipboard normally (as it checks if changes has been done so saving is necessary)
*
* @access private
* @return void
*/
public function saveClipboard()
{
......@@ -836,8 +826,6 @@ class Clipboard
/**
* This traverses the elements on the current clipboard pane
* and unsets elements which does not exist anymore or are disabled.
*
* @return void
*/
public function cleanCurrent()
{
......
......@@ -44,7 +44,6 @@ class LockBackendCommand extends Command
*
* @param InputInterface $input
* @param OutputInterface $output
* @return void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
......
......@@ -46,7 +46,6 @@ class ReferenceIndexUpdateCommand extends Command
*
* @param InputInterface $input
* @param OutputInterface $output
* @return void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
......
......@@ -36,7 +36,6 @@ class UnlockBackendCommand extends Command
*
* @param InputInterface $input
* @param OutputInterface $output
* @return void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
......
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