ENH update some docblock types (#11168)

This commit is contained in:
Thomas Portelange 2024-03-12 22:08:56 +01:00 committed by GitHub
parent dba87348f9
commit b031ade73a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 12 deletions

View File

@ -463,9 +463,9 @@ class HTTPRequest implements ArrayAccess
* <code>$this->setResponse(HTTPRequest::send_file('the content', 'filename.txt'));</code> * <code>$this->setResponse(HTTPRequest::send_file('the content', 'filename.txt'));</code>
* *
* @static * @static
* @param $fileData * @param string $fileData
* @param $fileName * @param string $fileName
* @param null $mimeType * @param string|null $mimeType
* @return HTTPResponse * @return HTTPResponse
*/ */
public static function send_file($fileData, $fileName, $mimeType = null) public static function send_file($fileData, $fileName, $mimeType = null)
@ -497,7 +497,7 @@ class HTTPRequest implements ArrayAccess
* The pattern can optionally start with an HTTP method and a space. For example, "POST $Controller/$Action". * The pattern can optionally start with an HTTP method and a space. For example, "POST $Controller/$Action".
* This is used to define a rule that only matches on a specific HTTP method. * This is used to define a rule that only matches on a specific HTTP method.
* *
* @param $pattern * @param string $pattern
* @param bool $shiftOnSuccess * @param bool $shiftOnSuccess
* @return array|bool * @return array|bool
*/ */
@ -679,7 +679,7 @@ class HTTPRequest implements ArrayAccess
} }
/** /**
* @param $params * @param array $params
* @return HTTPRequest $this * @return HTTPRequest $this
*/ */
public function setRouteParams($params) public function setRouteParams($params)
@ -805,7 +805,7 @@ class HTTPRequest implements ArrayAccess
* Sets the client IP address which originated this request. * Sets the client IP address which originated this request.
* Use setIPFromHeaderValue if assigning from header value. * Use setIPFromHeaderValue if assigning from header value.
* *
* @param $ip string * @param string $ip
* @return $this * @return $this
*/ */
public function setIP($ip) public function setIP($ip)

View File

@ -46,7 +46,7 @@ trait FileUploadReceiver
/** /**
* Parent data record. Will be inferred from parent form or controller if blank. * Parent data record. Will be inferred from parent form or controller if blank.
* *
* @var DataObject * @var ?DataObject
*/ */
protected $record; protected $record;
@ -78,7 +78,7 @@ trait FileUploadReceiver
* Get the record to use as "Parent" for uploaded Files (eg a Page with a has_one to File) If none is set, it will * Get the record to use as "Parent" for uploaded Files (eg a Page with a has_one to File) If none is set, it will
* use Form->getRecord() or Form->Controller()->data() * use Form->getRecord() or Form->Controller()->data()
* *
* @return DataObject * @return ?DataObject
*/ */
public function getRecord() public function getRecord()
{ {

View File

@ -371,7 +371,7 @@ class Form extends ViewableData implements HasRequestHandler
/** /**
* Helper to get current request for this form * Helper to get current request for this form
* *
* @return HTTPRequest * @return HTTPRequest|null
*/ */
protected function getRequest() protected function getRequest()
{ {
@ -426,7 +426,7 @@ class Form extends ViewableData implements HasRequestHandler
/** /**
* Return any ValidationResult instance stored for this object * Return any ValidationResult instance stored for this object
* *
* @return ValidationResult The ValidationResult object stored in the session * @return ValidationResult|null The ValidationResult object stored in the session
*/ */
public function getSessionValidationResult() public function getSessionValidationResult()
{ {
@ -1612,7 +1612,7 @@ class Form extends ViewableData implements HasRequestHandler
* Return the default button that should be clicked when another one isn't * Return the default button that should be clicked when another one isn't
* available. * available.
* *
* @return FormAction * @return FormAction|null
*/ */
public function defaultAction() public function defaultAction()
{ {

View File

@ -350,7 +350,7 @@ class DataList extends ViewableData implements SS_List, Filterable, Sortable, Li
* *
* Raw SQL is not accepted, only actual field names can be passed * Raw SQL is not accepted, only actual field names can be passed
* *
* @param string|array $args * @param string|array|null $args
* @example $list = $list->sort('Name'); // default ASC sorting * @example $list = $list->sort('Name'); // default ASC sorting
* @example $list = $list->sort('"Name"'); // field names can have double quotes around them * @example $list = $list->sort('"Name"'); // field names can have double quotes around them
* @example $list = $list->sort('Name ASC, Age DESC'); * @example $list = $list->sort('Name ASC, Age DESC');