Skip to content

Commit b031ade

Browse files
authored
ENH update some docblock types (#11168)
1 parent dba8734 commit b031ade

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/Control/HTTPRequest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -463,9 +463,9 @@ public function offsetUnset(mixed $offset): void
463463
* <code>$this->setResponse(HTTPRequest::send_file('the content', 'filename.txt'));</code>
464464
*
465465
* @static
466-
* @param $fileData
467-
* @param $fileName
468-
* @param null $mimeType
466+
* @param string $fileData
467+
* @param string $fileName
468+
* @param string|null $mimeType
469469
* @return HTTPResponse
470470
*/
471471
public static function send_file($fileData, $fileName, $mimeType = null)
@@ -497,7 +497,7 @@ public static function send_file($fileData, $fileName, $mimeType = null)
497497
* The pattern can optionally start with an HTTP method and a space. For example, "POST $Controller/$Action".
498498
* This is used to define a rule that only matches on a specific HTTP method.
499499
*
500-
* @param $pattern
500+
* @param string $pattern
501501
* @param bool $shiftOnSuccess
502502
* @return array|bool
503503
*/
@@ -679,7 +679,7 @@ public function routeParams()
679679
}
680680

681681
/**
682-
* @param $params
682+
* @param array $params
683683
* @return HTTPRequest $this
684684
*/
685685
public function setRouteParams($params)
@@ -805,7 +805,7 @@ public function getIP()
805805
* Sets the client IP address which originated this request.
806806
* Use setIPFromHeaderValue if assigning from header value.
807807
*
808-
* @param $ip string
808+
* @param string $ip
809809
* @return $this
810810
*/
811811
public function setIP($ip)

src/Forms/FileUploadReceiver.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ trait FileUploadReceiver
4646
/**
4747
* Parent data record. Will be inferred from parent form or controller if blank.
4848
*
49-
* @var DataObject
49+
* @var ?DataObject
5050
*/
5151
protected $record;
5252

@@ -78,7 +78,7 @@ public function setRecord($record)
7878
* 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
7979
* use Form->getRecord() or Form->Controller()->data()
8080
*
81-
* @return DataObject
81+
* @return ?DataObject
8282
*/
8383
public function getRecord()
8484
{

src/Forms/Form.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public function clearFormState()
371371
/**
372372
* Helper to get current request for this form
373373
*
374-
* @return HTTPRequest
374+
* @return HTTPRequest|null
375375
*/
376376
protected function getRequest()
377377
{
@@ -426,7 +426,7 @@ public function setSessionData($data)
426426
/**
427427
* Return any ValidationResult instance stored for this object
428428
*
429-
* @return ValidationResult The ValidationResult object stored in the session
429+
* @return ValidationResult|null The ValidationResult object stored in the session
430430
*/
431431
public function getSessionValidationResult()
432432
{
@@ -1612,7 +1612,7 @@ public function renderWithoutActionButton($template)
16121612
* Return the default button that should be clicked when another one isn't
16131613
* available.
16141614
*
1615-
* @return FormAction
1615+
* @return FormAction|null
16161616
*/
16171617
public function defaultAction()
16181618
{

src/ORM/DataList.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ public function distinct($value)
350350
*
351351
* Raw SQL is not accepted, only actual field names can be passed
352352
*
353-
* @param string|array $args
353+
* @param string|array|null $args
354354
* @example $list = $list->sort('Name'); // default ASC sorting
355355
* @example $list = $list->sort('"Name"'); // field names can have double quotes around them
356356
* @example $list = $list->sort('Name ASC, Age DESC');

0 commit comments

Comments
 (0)