Skip to content

Commit 9ed5925

Browse files
committed
Deprecate public properties that have accessor methods.
This is only the beginning of the public property deprecations. More properties will be deprecated as new accessor methods are introduced. Refs #9325
1 parent 477e756 commit 9ed5925

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/Network/Request.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323
/**
2424
* A class that helps wrap Request information and particulars about a single request.
2525
* Provides methods commonly used to introspect on the request headers and request body.
26-
*
27-
* Has both an Array and Object interface. You can access framework parameters using indexes:
28-
*
29-
* `$request['controller']` or `$request->controller`.
3026
*/
3127
class Request implements ArrayAccess
3228
{
@@ -35,6 +31,7 @@ class Request implements ArrayAccess
3531
* Array of parameters parsed from the URL.
3632
*
3733
* @var array
34+
* @deprecated 3.4.0 This public property will be removed in 4.0.0. Use param() instead.
3835
*/
3936
public $params = [
4037
'plugin' => null,
@@ -50,20 +47,23 @@ class Request implements ArrayAccess
5047
* data.
5148
*
5249
* @var array
50+
* @deprecated 3.4.0 This public property will be removed in 4.0.0. Use data() instead.
5351
*/
5452
public $data = [];
5553

5654
/**
5755
* Array of querystring arguments
5856
*
5957
* @var array
58+
* @deprecated 3.4.0 This public property will be removed in 4.0.0. Use query() instead.
6059
*/
6160
public $query = [];
6261

6362
/**
6463
* Array of cookie data.
6564
*
6665
* @var array
66+
* @deprecated 3.4.0 This public property will be removed in 4.0.0. Use cookie() instead.
6767
*/
6868
public $cookies = [];
6969

@@ -597,6 +597,8 @@ public function __call($name, $params)
597597
*
598598
* @param string $name The property being accessed.
599599
* @return mixed Either the value of the parameter or null.
600+
* @deprecated 3.4.0 Accessing routing parameters through __get will removed in 4.0.0.
601+
* Use param() instead.
600602
*/
601603
public function __get($name)
602604
{
@@ -613,6 +615,8 @@ public function __get($name)
613615
*
614616
* @param string $name The property being accessed.
615617
* @return bool Existence
618+
* @deprecated 3.4.0 Accessing routing parameters through __isset will removed in 4.0.0.
619+
* Use param() instead.
616620
*/
617621
public function __isset($name)
618622
{

0 commit comments

Comments
 (0)