From c932d7e7fbcc11d3248e53f319964b474a36e6a5 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Mon, 21 Dec 2020 22:23:23 +0100 Subject: [PATCH] Fix the phpdoc blocks --- src/Control/CLIRequestBuilder.php | 1 + src/Control/Controller.php | 2 +- src/Control/HTTPResponse_Exception.php | 2 +- .../ConfirmationMiddleware/GetParameter.php | 3 +- .../HttpMethodBypass.php | 2 +- .../Middleware/ConfirmationMiddleware/Url.php | 3 +- src/Control/RSS/RSSFeed.php | 2 +- src/Control/Util/IPUtils.php | 2 +- src/Core/Config/Config_ForClass.php | 2 +- src/Core/Convert.php | 4 +-- src/Core/Injector/Injector.php | 2 +- .../Manifest/ClassManifestErrorHandler.php | 2 +- src/Core/Startup/RequestFlushDiscoverer.php | 1 - src/Dev/BuildTask.php | 2 +- src/Dev/CSSContentParser.php | 6 ++-- src/Dev/CSVParser.php | 6 ++-- src/Dev/FixtureBlueprint.php | 4 +-- src/Dev/FixtureFactory.php | 2 +- src/Dev/Tasks/i18nTextCollectorTask.php | 2 +- src/Forms/CompositeField.php | 16 +++++---- src/Forms/DatetimeField.php | 2 +- src/Forms/FieldList.php | 2 +- src/Forms/Form.php | 16 ++++----- src/Forms/FormAction.php | 4 +-- src/Forms/FormField.php | 6 ++-- src/Forms/GridField/GridFieldConfig.php | 2 +- src/Forms/GridField/GridFieldDataColumns.php | 2 +- src/Forms/GridField/GridFieldFilterHeader.php | 2 ++ src/Forms/GridField/GridFieldPrintButton.php | 10 +++--- .../GridField/GridField_ActionProvider.php | 2 +- src/Forms/HTMLEditor/HTMLEditorSanitiser.php | 6 ++-- src/Forms/HTMLEditor/TinyMCEConfig.php | 26 +++++++------- src/Forms/SelectField.php | 2 +- src/Forms/SelectionGroup_Item.php | 4 +-- src/Forms/TabSet.php | 2 ++ src/Forms/UploadReceiver.php | 2 +- src/ORM/ArrayList.php | 2 +- src/ORM/Connect/DBSchemaManager.php | 8 +++-- src/ORM/Connect/Database.php | 8 ++--- src/ORM/Connect/MySQLiConnector.php | 4 +-- src/ORM/DB.php | 2 +- src/ORM/DataExtension.php | 4 --- src/ORM/DataList.php | 4 +-- src/ORM/DataObject.php | 18 +++++----- src/ORM/FieldType/DBEnum.php | 2 +- src/ORM/FieldType/DBIndexable.php | 4 +-- src/ORM/FieldType/DBMoney.php | 2 +- src/ORM/FieldType/DBString.php | 2 +- src/ORM/Filterable.php | 4 ++- src/ORM/Filters/SearchFilter.php | 4 +-- src/ORM/HasManyList.php | 2 +- src/ORM/Hierarchy/Hierarchy.php | 3 +- src/ORM/Limitable.php | 4 ++- src/ORM/ManyManyList.php | 2 +- src/ORM/PaginatedList.php | 6 ++-- src/ORM/Queries/SQLConditionalExpression.php | 36 +++++++++---------- src/ORM/Queries/SQLInsert.php | 2 +- src/ORM/Queries/SQLSelect.php | 6 ++-- src/ORM/Sortable.php | 4 ++- src/ORM/UnsavedRelationList.php | 1 - src/Security/Confirmation/Storage.php | 4 +-- src/Security/Group.php | 2 +- src/Security/InheritedPermissionFlusher.php | 2 +- src/Security/Member.php | 2 +- src/Security/NullSecurityToken.php | 14 ++++---- src/Security/PasswordEncryptor.php | 6 ++-- src/Security/PasswordExpirationMiddleware.php | 1 - src/Security/PasswordValidator.php | 2 +- src/Security/Permission.php | 2 +- src/Security/PermissionCheckboxSetField.php | 8 ++--- src/Security/Security.php | 2 +- src/View/ArrayData.php | 4 +-- src/View/Embed/EmbedResource.php | 2 +- src/View/Parsers/HTMLCleaner.php | 2 +- src/View/Parsers/URLSegmentFilter.php | 2 +- src/View/Requirements.php | 4 +-- src/View/Requirements_Backend.php | 6 ++-- src/View/SSTemplateParser.php | 19 +++++----- src/View/SSViewer.php | 2 +- src/View/SSViewer_Scope.php | 2 +- src/i18n/TextCollection/i18nTextCollector.php | 2 +- src/i18n/i18n.php | 2 +- src/i18n/i18nEntityProvider.php | 2 +- src/includes/functions.php | 2 +- tests/php/ORM/MarkedSetTest.php | 8 ++--- 85 files changed, 199 insertions(+), 195 deletions(-) diff --git a/src/Control/CLIRequestBuilder.php b/src/Control/CLIRequestBuilder.php index 4de863a63..a5ec492e9 100644 --- a/src/Control/CLIRequestBuilder.php +++ b/src/Control/CLIRequestBuilder.php @@ -72,6 +72,7 @@ class CLIRequestBuilder extends HTTPRequestBuilder /** * @param array $variables * @param string $input + * @param string|null $url * @return HTTPRequest */ public static function createFromVariables(array $variables, $input, $url = null) diff --git a/src/Control/Controller.php b/src/Control/Controller.php index 29c802a95..09e8e7e1a 100644 --- a/src/Control/Controller.php +++ b/src/Control/Controller.php @@ -663,7 +663,7 @@ class Controller extends RequestHandler implements TemplateGlobalProvider * * Caution: All parameters are expected to be URI-encoded already. * - * @param string|array $arg,.. One or more link segments, or list of link segments as an array + * @param string|array $arg One or more link segments, or list of link segments as an array * @return string */ public static function join_links($arg = null) diff --git a/src/Control/HTTPResponse_Exception.php b/src/Control/HTTPResponse_Exception.php index 2205c1bab..507576517 100644 --- a/src/Control/HTTPResponse_Exception.php +++ b/src/Control/HTTPResponse_Exception.php @@ -26,7 +26,7 @@ class HTTPResponse_Exception extends Exception * response. * @param int $statusCode * @param string $statusDescription - * @see HTTPResponse::__construct(); + * @see HTTPResponse::__construct() */ public function __construct($body = null, $statusCode = null, $statusDescription = null) { diff --git a/src/Control/Middleware/ConfirmationMiddleware/GetParameter.php b/src/Control/Middleware/ConfirmationMiddleware/GetParameter.php index 44ceaf1a2..1d5204f48 100644 --- a/src/Control/Middleware/ConfirmationMiddleware/GetParameter.php +++ b/src/Control/Middleware/ConfirmationMiddleware/GetParameter.php @@ -54,6 +54,7 @@ class GetParameter implements Rule, Bypass * Generates the confirmation item * * @param string $token + * @param string $value * * @return Confirmation\Item */ @@ -70,7 +71,7 @@ class GetParameter implements Rule, Bypass * Generates the unique token depending on the path and the parameter * * @param string $path URL path - * @param string $param The parameter value + * @param string $value The parameter value * * @return string */ diff --git a/src/Control/Middleware/ConfirmationMiddleware/HttpMethodBypass.php b/src/Control/Middleware/ConfirmationMiddleware/HttpMethodBypass.php index bc41ea1e4..6a2f501fc 100644 --- a/src/Control/Middleware/ConfirmationMiddleware/HttpMethodBypass.php +++ b/src/Control/Middleware/ConfirmationMiddleware/HttpMethodBypass.php @@ -19,7 +19,7 @@ class HttpMethodBypass implements Bypass /** * Initialize the bypass with HTTP methods * - * @param string[] ...$method + * @param string[] ...$methods */ public function __construct(...$methods) { diff --git a/src/Control/Middleware/ConfirmationMiddleware/Url.php b/src/Control/Middleware/ConfirmationMiddleware/Url.php index 0e1cf0075..7076541bb 100644 --- a/src/Control/Middleware/ConfirmationMiddleware/Url.php +++ b/src/Control/Middleware/ConfirmationMiddleware/Url.php @@ -80,7 +80,7 @@ class Url implements Rule, Bypass * against parameter values accordingly. Null * as a value in the array matches any parameter values. * - * @param string|null $httpMethods + * @param string|null $params * * @return $this */ @@ -186,6 +186,7 @@ class Url implements Rule, Bypass /** * Generates the unique token depending on the path * + * @param string $httpMethod HTTP method * @param string $path URL path * * @return string diff --git a/src/Control/RSS/RSSFeed.php b/src/Control/RSS/RSSFeed.php index 49f20e20a..4372b7bb2 100644 --- a/src/Control/RSS/RSSFeed.php +++ b/src/Control/RSS/RSSFeed.php @@ -244,7 +244,7 @@ class RSSFeed extends ViewableData * Set the name of the template to use. Actual template will be resolved * via the standard template inclusion process. * - * @param string + * @param string $template */ public function setTemplate($template) { diff --git a/src/Control/Util/IPUtils.php b/src/Control/Util/IPUtils.php index 7cdd97a32..eb523d7b5 100644 --- a/src/Control/Util/IPUtils.php +++ b/src/Control/Util/IPUtils.php @@ -85,7 +85,7 @@ class IPUtils * Compares two IPv6 addresses. * In case a subnet is given, it checks if it contains the request IP. * - * @author David Soria Parra + * @author David Soria Parra * * @see https://github.com/dsp/v6tools * diff --git a/src/Core/Config/Config_ForClass.php b/src/Core/Config/Config_ForClass.php index b89e5007b..8eb95c750 100644 --- a/src/Core/Config/Config_ForClass.php +++ b/src/Core/Config/Config_ForClass.php @@ -109,7 +109,7 @@ class Config_ForClass } /** - * @param string + * @param string $class * * @return Config_ForClass */ diff --git a/src/Core/Convert.php b/src/Core/Convert.php index 5cd41dba7..872c3fe5e 100644 --- a/src/Core/Convert.php +++ b/src/Core/Convert.php @@ -336,7 +336,7 @@ class Convert * Convert a XML string to a PHP array recursively. Do not * call this function directly, Please use {@link Convert::xml2array()} * - * @param SimpleXMLElement + * @param SimpleXMLElement $xml * * @return mixed */ @@ -491,7 +491,7 @@ class Convert * Convert a string (normally a title) to a string suitable for using in * urls and other html attributes. Uses {@link URLSegmentFilter}. * - * @param string + * @param string $title * @return string */ public static function raw2url($title) diff --git a/src/Core/Injector/Injector.php b/src/Core/Injector/Injector.php index 566a20490..74984cb7b 100644 --- a/src/Core/Injector/Injector.php +++ b/src/Core/Injector/Injector.php @@ -1103,7 +1103,7 @@ class Injector implements ContainerInterface * Additional parameters are passed through as * * @param string $name - * @param mixed $argument,... arguments to pass to the constructor + * @param mixed ...$argument arguments to pass to the constructor * @return mixed A new instance of the specified object */ public function create($name, $argument = null) diff --git a/src/Core/Manifest/ClassManifestErrorHandler.php b/src/Core/Manifest/ClassManifestErrorHandler.php index b5faf50da..d077daa93 100644 --- a/src/Core/Manifest/ClassManifestErrorHandler.php +++ b/src/Core/Manifest/ClassManifestErrorHandler.php @@ -17,7 +17,7 @@ class ClassManifestErrorHandler implements ErrorHandler protected $pathname; /** - * @param String $pathname + * @param string $pathname */ public function __construct($pathname) { diff --git a/src/Core/Startup/RequestFlushDiscoverer.php b/src/Core/Startup/RequestFlushDiscoverer.php index 5c7cd0edb..73f2bb7d5 100644 --- a/src/Core/Startup/RequestFlushDiscoverer.php +++ b/src/Core/Startup/RequestFlushDiscoverer.php @@ -44,7 +44,6 @@ class RequestFlushDiscoverer implements FlushDiscoverer /** * Checks whether the request contains any flush indicators * - * @param HTTPRequest $request active request * * @return null|bool flush or don't care */ diff --git a/src/Dev/BuildTask.php b/src/Dev/BuildTask.php index 26a86d139..6f6423ccd 100644 --- a/src/Dev/BuildTask.php +++ b/src/Dev/BuildTask.php @@ -55,7 +55,7 @@ abstract class BuildTask * execute via the TaskRunner * * @param HTTPRequest $request - * @return + * @return void */ abstract public function run($request); diff --git a/src/Dev/CSSContentParser.php b/src/Dev/CSSContentParser.php index 3ebd9576b..6074ad81a 100644 --- a/src/Dev/CSSContentParser.php +++ b/src/Dev/CSSContentParser.php @@ -68,7 +68,7 @@ class CSSContentParser * Currently the selector engine only supports querying by tag, id, and class. * See {@link getByXpath()} for a more direct selector syntax. * - * @param String $selector + * @param string $selector * @return SimpleXMLElement[] */ public function getBySelector($selector) @@ -80,7 +80,7 @@ class CSSContentParser /** * Allows querying the content through XPATH selectors. * - * @param String $xpath SimpleXML compatible XPATH statement + * @param string $xpath SimpleXML compatible XPATH statement * @return SimpleXMLElement[] */ public function getByXpath($xpath) @@ -92,7 +92,7 @@ class CSSContentParser * Converts a CSS selector into an equivalent xpath expression. * Currently the selector engine only supports querying by tag, id, and class. * - * @param String $selector See {@link getBySelector()} + * @param string $selector See {@link getBySelector()} * @return String XPath expression */ public function selector2xpath($selector) diff --git a/src/Dev/CSVParser.php b/src/Dev/CSVParser.php index 91ba742fe..25bdc4a24 100644 --- a/src/Dev/CSVParser.php +++ b/src/Dev/CSVParser.php @@ -134,7 +134,7 @@ class CSVParser implements Iterator * )); * * - * @param array + * @param array $columnMap */ public function mapColumns($columnMap) { @@ -156,7 +156,7 @@ class CSVParser implements Iterator * If you call this function, then the first row of the CSV will be * included in the data returned. * - * @param array + * @param array $headerRow */ public function provideHeaderRow($headerRow) { @@ -210,7 +210,7 @@ class CSVParser implements Iterator /** * Map the contents of a header array using $this->mappedColumns. * - * @param array + * @param array $header * * @return array */ diff --git a/src/Dev/FixtureBlueprint.php b/src/Dev/FixtureBlueprint.php index c36a26fbd..604c7bd65 100644 --- a/src/Dev/FixtureBlueprint.php +++ b/src/Dev/FixtureBlueprint.php @@ -48,8 +48,8 @@ class FixtureBlueprint ]; /** - * @param String $name - * @param String $class Defaults to $name + * @param string $name + * @param string $class Defaults to $name * @param array $defaults */ public function __construct($name, $class = null, $defaults = []) diff --git a/src/Dev/FixtureFactory.php b/src/Dev/FixtureFactory.php index e5cae99cb..a29c0b2b8 100644 --- a/src/Dev/FixtureFactory.php +++ b/src/Dev/FixtureFactory.php @@ -239,7 +239,7 @@ class FixtureFactory } /** - * @param String $name + * @param string $name * @return FixtureBlueprint|false */ public function getBlueprint($name) diff --git a/src/Dev/Tasks/i18nTextCollectorTask.php b/src/Dev/Tasks/i18nTextCollectorTask.php index ea58aef4d..c552268ac 100644 --- a/src/Dev/Tasks/i18nTextCollectorTask.php +++ b/src/Dev/Tasks/i18nTextCollectorTask.php @@ -35,7 +35,7 @@ class i18nTextCollectorTask extends BuildTask * It will search for existent modules that use the i18n feature, parse the _t() calls * and write the resultant files in the lang folder of each module. * - * @uses DataObject->collectI18nStatics() + * @uses DataObject::collectI18nStatics() * * @param HTTPRequest $request */ diff --git a/src/Forms/CompositeField.php b/src/Forms/CompositeField.php index 8a4bb5b42..5ea266af6 100644 --- a/src/Forms/CompositeField.php +++ b/src/Forms/CompositeField.php @@ -324,7 +324,7 @@ class CompositeField extends FormField /** * Add a new child field to the end of the set. * - * @param FormField + * @param FormField $field */ public function push(FormField $field) { @@ -334,7 +334,7 @@ class CompositeField extends FormField /** * Add a new child field to the beginning of the set. * - * @param FormField + * @param FormField $field */ public function unshift(FormField $field) { @@ -342,10 +342,11 @@ class CompositeField extends FormField } /** - * @uses FieldList->insertBefore() + * @uses FieldList::insertBefore() * * @param string $insertBefore * @param FormField $field + * @param bool $appendIfMissing * @return false|FormField */ public function insertBefore($insertBefore, $field, $appendIfMissing = true) @@ -354,9 +355,10 @@ class CompositeField extends FormField } /** - * @uses FieldList->insertAfter() + * @uses FieldList::insertAfter() * @param string $insertAfter * @param FormField $field + * @param bool $appendIfMissing * @return false|FormField */ public function insertAfter($insertAfter, $field, $appendIfMissing = true) @@ -470,7 +472,7 @@ class CompositeField extends FormField * Find the numerical position of a field within * the children collection. Doesn't work recursively. * - * @param string|FormField + * @param string|FormField $field * @return int Position in children collection (first position starts with 0). Returns FALSE if the field can't * be found. */ @@ -496,9 +498,9 @@ class CompositeField extends FormField } /** - * Transform the named field into a readonly feld. + * Transform the named field into a readonly field. * - * @param string|FormField + * @param string|FormField $field * @return bool */ public function makeFieldReadonly($field) diff --git a/src/Forms/DatetimeField.php b/src/Forms/DatetimeField.php index 03c4bf6c0..eab9d37c0 100644 --- a/src/Forms/DatetimeField.php +++ b/src/Forms/DatetimeField.php @@ -288,7 +288,7 @@ class DatetimeField extends TextField /** * Get a date formatter for the ISO 8601 format * - * @param String $timezone Optional timezone identifier (defaults to server timezone) + * @param string $timezone Optional timezone identifier (defaults to server timezone) * @return IntlDateFormatter */ protected function getInternalFormatter($timezone = null) diff --git a/src/Forms/FieldList.php b/src/Forms/FieldList.php index c1d117c50..5ec25798a 100644 --- a/src/Forms/FieldList.php +++ b/src/Forms/FieldList.php @@ -881,7 +881,7 @@ class FieldList extends ArrayList * Find the numerical position of a field within * the children collection. Doesn't work recursively. * - * @param string|FormField + * @param string|FormField $field * @return int Position in children collection (first position starts with 0). * Returns FALSE if the field can't be found. */ diff --git a/src/Forms/Form.php b/src/Forms/Form.php index 8ab457d40..1d3516954 100644 --- a/src/Forms/Form.php +++ b/src/Forms/Form.php @@ -170,9 +170,9 @@ class Form extends ViewableData implements HasRequestHandler /** * The SS template to render this form HTML into. * Default is "Form", but this can be changed to - * another template for customisation. + * another template for customization. * - * @see Form->setTemplate() + * @see Form::setTemplate() * @var string|array|null */ protected $template; @@ -326,7 +326,7 @@ class Form extends ViewableData implements HasRequestHandler } /** - * @param bool + * @param bool $flag */ public function setNotifyUnsavedChanges($flag) { @@ -664,7 +664,7 @@ class Form extends ViewableData implements HasRequestHandler /** * Set actions that are exempt from validation * - * @param array + * @param array $actions * @return $this */ public function setValidationExemptActions($actions) @@ -916,7 +916,7 @@ class Form extends ViewableData implements HasRequestHandler * Set the target of this form to any value - useful for opening the form contents in a new window or refreshing * another frame * - * @param string|FormTemplateHelper + * @param string|FormTemplateHelper $helper */ public function setTemplateHelper($helper) { @@ -1371,9 +1371,9 @@ class Form extends ViewableData implements HasRequestHandler * Escaping happens automatically on saving the data through * {@link saveInto()}. * - * @uses FieldList->dataFields() - * @uses FormField->setSubmittedValue() - * @uses FormField->setValue() + * @uses FieldList::dataFields() + * @uses FormField::setSubmittedValue() + * @uses FormField::setValue() * * @param array|DataObject $data * @param int $mergeStrategy diff --git a/src/Forms/FormAction.php b/src/Forms/FormAction.php index fa31ce96c..ae9b32627 100644 --- a/src/Forms/FormAction.php +++ b/src/Forms/FormAction.php @@ -75,7 +75,7 @@ class FormAction extends FormField * * @param string $action The method to call when the button is clicked * @param string $title The label on the button. This should be plain text, not escaped as HTML. - * @param Form form The parent form, auto-set when the field is placed inside a form + * @param Form $form The parent form, auto-set when the field is placed inside a form */ public function __construct($action, $title = "", $form = null) { @@ -225,7 +225,7 @@ class FormAction extends FormField /** * Enable or disable the rendering of this action as a