ReStructured Text InfrastructureTYPO3 CMS - What's Newwiki.typo3.orgTYPO3 CMS Documentation

Task #53113

Use short version of type names

Added by Stefano Kowalke almost 2 years ago. Updated over 1 year ago.

Status:Resolved Start date:2013-10-24
Priority:Should have Due date:
Assigned To:Chris topher % Done:

100%

Category:-
Target version:-

Description

In the cgl there is a doc block comment example

/**
 * Initializes the plugin.
 *
 * Checks the configuration and substitutes defaults for missing values.
 *
 * @param array $conf Plugin configuration from TypoScript
 * @return bool TRUE if initialization was successful, FALSE otherwise 
 * @see tx_myext_class:anotherFunc()
 */
protected function initialize(array $conf) {
// Do something
}

In this example the long types are used (bool instead of boolean).

See #54265.


Related issues

related to Core - Task #54265: Use (int) instead of intval() or (integer) Resolved 2013-12-07
blocks PHP_CodeSniffer - Feature #38688: Create sniff for function / method doc comment long types Closed 2012-07-05

Associated revisions

Revision 55c7c9b1
Added by Chris topher over 1 year ago

[TASK] Use short version of type names

It was decided that the Core should use the short versions of type names
in phpDoc comment blocks (int, bool, string, array, mixed). Adjust the
CGL accordingly.

Change-Id: Iaf57404254a4980a6c900dd4783ae89930cc7b47
Resolves: #53113
Reviewed-on: https://review.typo3.org/28564
Reviewed-by: Chris topher
Tested-by: Chris topher

History

#1 Updated by Chris topher over 1 year ago

  • Subject changed from bool or boolean to Use long version of type names

This is not only a question for "bool" vs "boolean" in comments, but also for other type names like "int" vs "integer" all throughout the code. The current state uses both, which is inconsistent and should be cleaned up. I personally would use the long form as it is more readable. There also was a discussion at https://notes.typo3.org/p/CGL-decisions and according to that long forms are the way to go. A first patch for this has been pushed with #54265 and others are to come.

The CGL should then be adapted accordingly so that it only uses the long forms; consistently in comments and in code.

#2 Updated by Jo Hasenau over 1 year ago

Since the decisions have been made based on the document on notes.typo3.org, this task should be renamed.

b) For doc comments, the short versions must be used as well:

*Examples:*
- @var int $mynumber
- @var bool $mycheck
- @var string $mycheck

#3 Updated by Stefano Kowalke over 1 year ago

  • Subject changed from Use long version of type names to Use short version of type names

#4 Updated by Chris topher over 1 year ago

  • Assigned To set to Chris topher

The short names are int, bool, string, array, mixed 1.

#5 Updated by Gerrit Code Review over 1 year ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Documentation/TYPO3/Reference/CodingGuidelines has been pushed to the review server.
It is available at https://review.typo3.org/28564

#6 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Documentation/TYPO3/Reference/CodingGuidelines has been pushed to the review server.
It is available at https://review.typo3.org/28564

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Documentation/TYPO3/Reference/CodingGuidelines has been pushed to the review server.
It is available at https://review.typo3.org/28564

#8 Updated by Chris topher over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF