11
11
12
12
namespace CodeIgniter \Database ;
13
13
14
+ use stdClass ;
15
+
14
16
/**
15
17
* @template TConnection of object|resource
16
18
* @template TResult of object|resource
@@ -31,7 +33,7 @@ public function getResult(string $type = 'object'): array;
31
33
*
32
34
* @param string $className The name of the class to use.
33
35
*
34
- * @return mixed
36
+ * @return array
35
37
*/
36
38
public function getCustomResultObject (string $ className );
37
39
@@ -55,10 +57,11 @@ public function getResultObject(): array;
55
57
*
56
58
* If row doesn't exist, returns null.
57
59
*
58
- * @param mixed $n The index of the results to return
60
+ * @param int $n The index of the results to return
59
61
* @param string $type The type of result object. 'array', 'object' or class name.
60
62
*
61
- * @return mixed
63
+ * @return array|object|stdClass|null
64
+ * @phpstan-return ($type is 'object' ? stdClass|null : ($type is 'array' ? array|null : object|null))
62
65
*/
63
66
public function getRow ($ n = 0 , string $ type = 'object ' );
64
67
@@ -67,7 +70,7 @@ public function getRow($n = 0, string $type = 'object');
67
70
*
68
71
* If row doesn't exists, returns null.
69
72
*
70
- * @return mixed
73
+ * @return array|null
71
74
*/
72
75
public function getCustomRowObject (int $ n , string $ className );
73
76
@@ -76,7 +79,7 @@ public function getCustomRowObject(int $n, string $className);
76
79
*
77
80
* If row doesn't exist, returns null.
78
81
*
79
- * @return mixed
82
+ * @return array|null
80
83
*/
81
84
public function getRowArray (int $ n = 0 );
82
85
@@ -85,45 +88,45 @@ public function getRowArray(int $n = 0);
85
88
*
86
89
* If row doesn't exist, returns null.
87
90
*
88
- * @return mixed
91
+ * @return object|stdClass|null
89
92
*/
90
93
public function getRowObject (int $ n = 0 );
91
94
92
95
/**
93
96
* Assigns an item into a particular column slot.
94
97
*
95
- * @param string $key
96
- * @param mixed $value
98
+ * @param array| string $key
99
+ * @param array|object|stdClass|null $value
97
100
*
98
- * @return mixed
101
+ * @return void
99
102
*/
100
103
public function setRow ($ key , $ value = null );
101
104
102
105
/**
103
106
* Returns the "first" row of the current results.
104
107
*
105
- * @return mixed
108
+ * @return array|object|null
106
109
*/
107
110
public function getFirstRow (string $ type = 'object ' );
108
111
109
112
/**
110
113
* Returns the "last" row of the current results.
111
114
*
112
- * @return mixed
115
+ * @return array|object|null
113
116
*/
114
117
public function getLastRow (string $ type = 'object ' );
115
118
116
119
/**
117
120
* Returns the "next" row of the current results.
118
121
*
119
- * @return mixed
122
+ * @return array|object|null
120
123
*/
121
124
public function getNextRow (string $ type = 'object ' );
122
125
123
126
/**
124
127
* Returns the "previous" row of the current results.
125
128
*
126
- * @return mixed
129
+ * @return array|object|null
127
130
*/
128
131
public function getPreviousRow (string $ type = 'object ' );
129
132
@@ -135,7 +138,7 @@ public function getNumRows(): int;
135
138
/**
136
139
* Returns an unbuffered row and move the pointer to the next row.
137
140
*
138
- * @return mixed
141
+ * @return array|object|null
139
142
*/
140
143
public function getUnbufferedRow (string $ type = 'object ' );
141
144
@@ -164,7 +167,7 @@ public function freeResult();
164
167
* internally before fetching results to make sure the result set
165
168
* starts at zero.
166
169
*
167
- * @return mixed
170
+ * @return bool
168
171
*/
169
172
public function dataSeek (int $ n = 0 );
170
173
}
0 commit comments