@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | /** |
100 | 100 | * @param $name |
101 | 101 | * @param AbstractPdo $conn |
102 | - * @return AbstractPdo |
|
102 | + * @return ConnectionPool |
|
103 | 103 | */ |
104 | 104 | public static function add($name, AbstractPdo $conn) |
105 | 105 | { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | /** |
121 | - * @param $name |
|
121 | + * @param string $name |
|
122 | 122 | * @return AbstractPdo |
123 | 123 | */ |
124 | 124 | public static function get($name) |
@@ -12,14 +12,12 @@ |
||
12 | 12 | |
13 | 13 | use Psr\Log\AbstractLogger; |
14 | 14 | use Stash\Interfaces\PoolInterface; |
15 | -use Terah\FluentPdoModel\Drivers\DriverInterface; |
|
16 | -use Terah\FluentPdoModel\Drivers\AbstractPdo; |
|
17 | 15 | use Terah\FluentPdoModel\Drivers; |
16 | +use Terah\FluentPdoModel\Drivers\AbstractPdo; |
|
17 | +use Terah\FluentPdoModel\Drivers\DriverInterface; |
|
18 | 18 | use function Terah\Assert\Assert; |
19 | 19 | use function Terah\Assert\Validate; |
20 | 20 | |
21 | -use Terah\Utils\DateTimeUtils as Date; |
|
22 | - |
|
23 | 21 | class ConnectionPool |
24 | 22 | { |
25 | 23 | /** |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | } |
107 | 107 | |
108 | 108 | /** |
109 | - * @param $key |
|
109 | + * @param string $key |
|
110 | 110 | * @return mixed |
111 | 111 | */ |
112 | 112 | public function getConfig($key) |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | /** |
211 | 211 | * @param bool $include_views |
212 | - * @param null $table |
|
212 | + * @param string $table |
|
213 | 213 | * @return array|null |
214 | 214 | */ |
215 | 215 | abstract public function getColumns($include_views=false, $table=null); |
@@ -17,8 +17,6 @@ |
||
17 | 17 | use function Terah\Assert\Assert; |
18 | 18 | use function Terah\Assert\Validate; |
19 | 19 | |
20 | -use Terah\Utils\DateTimeUtils as Date; |
|
21 | - |
|
22 | 20 | /** |
23 | 21 | * Class AbstractPdo |
24 | 22 | * |
@@ -20,8 +20,6 @@ |
||
20 | 20 | use function Terah\Assert\Assert; |
21 | 21 | use function Terah\Assert\Validate; |
22 | 22 | |
23 | -use Terah\Utils\DateTimeUtils as Date; |
|
24 | - |
|
25 | 23 | /** |
26 | 24 | * PDOOCI |
27 | 25 | * |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | * @param string $class_name |
369 | 369 | * @param null $ctor_args |
370 | 370 | * |
371 | - * @return mixed|null|\stdClass |
|
371 | + * @return \stdClass|null |
|
372 | 372 | */ |
373 | 373 | public function fetchObject($class_name = 'stdClass', $ctor_args = null) |
374 | 374 | { |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | /** |
455 | 455 | * Return the current key/position |
456 | 456 | * |
457 | - * @return null |
|
457 | + * @return integer |
|
458 | 458 | */ |
459 | 459 | public function key() |
460 | 460 | { |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | /** |
489 | 489 | * Check if the current value is valid |
490 | 490 | * |
491 | - * @return null |
|
491 | + * @return boolean |
|
492 | 492 | */ |
493 | 493 | public function valid() |
494 | 494 | { |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | * @param int $maxlen max length |
531 | 531 | * @param mixed $driver data |
532 | 532 | * |
533 | - * @return bool if was bound |
|
533 | + * @return boolean|null if was bound |
|
534 | 534 | */ |
535 | 535 | public function bindColumn($column, &$param, $type = null, $maxlen = null, $driver = null) |
536 | 536 | { |
@@ -663,7 +663,7 @@ discard block |
||
663 | 663 | /** |
664 | 664 | * Dummy method for nextRowSet |
665 | 665 | * |
666 | - * @return bool |
|
666 | + * @return boolean|null |
|
667 | 667 | */ |
668 | 668 | public function nextRowSet() |
669 | 669 | { |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
247 | - * @param $primaryKeyName |
|
247 | + * @param string $primaryKeyName |
|
248 | 248 | * @return $this |
249 | 249 | */ |
250 | 250 | public function primaryKeyName($primaryKeyName) |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | } |
255 | 255 | |
256 | 256 | /** |
257 | - * @param $tableName |
|
257 | + * @param string $tableName |
|
258 | 258 | * |
259 | 259 | * @return $this |
260 | 260 | */ |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | * @param string $table_name |
634 | 634 | * @param bool $drop_if_exists |
635 | 635 | * @param array $indexes |
636 | - * @return $this |
|
636 | + * @return boolean |
|
637 | 637 | * @throws Exception |
638 | 638 | */ |
639 | 639 | public function fetchIntoMemoryTable($table_name, $drop_if_exists=true, array $indexes=[]) |
@@ -955,7 +955,7 @@ discard block |
||
955 | 955 | /** |
956 | 956 | * @param int|null $id |
957 | 957 | * @param int|bool $cacheTtl |
958 | - * @return \stdClass|bool |
|
958 | + * @return boolean |
|
959 | 959 | */ |
960 | 960 | public function fetchExists($id=null, $cacheTtl=false) |
961 | 961 | { |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | * |
977 | 977 | * @param mixed $columns - the column to select. Can be string or array of fields |
978 | 978 | * @param string $alias - an alias to the column |
979 | - * @param bool|true $explicitSelect |
|
979 | + * @param boolean $explicitSelect |
|
980 | 980 | * @return $this |
981 | 981 | */ |
982 | 982 | public function select($columns='*', $alias=null, $explicitSelect=true) |
@@ -1020,6 +1020,9 @@ discard block |
||
1020 | 1020 | return $this; |
1021 | 1021 | } |
1022 | 1022 | |
1023 | + /** |
|
1024 | + * @param string $select |
|
1025 | + */ |
|
1023 | 1026 | public function selectRaw($select) |
1024 | 1027 | { |
1025 | 1028 | $this->_select_fields[] = $select; |
@@ -1745,7 +1748,7 @@ discard block |
||
1745 | 1748 | } |
1746 | 1749 | |
1747 | 1750 | /** |
1748 | - * @param null $name |
|
1751 | + * @param string $name |
|
1749 | 1752 | * @return int |
1750 | 1753 | */ |
1751 | 1754 | public function getLastInsertId($name=null) |
@@ -2609,12 +2612,18 @@ discard block |
||
2609 | 2612 | return $record; |
2610 | 2613 | } |
2611 | 2614 | |
2615 | + /** |
|
2616 | + * @param string $type |
|
2617 | + */ |
|
2612 | 2618 | public function applyGlobalModifiers(stdClass $record, $type) |
2613 | 2619 | { |
2614 | 2620 | unset($type); |
2615 | 2621 | return $record; |
2616 | 2622 | } |
2617 | 2623 | |
2624 | + /** |
|
2625 | + * @param string $type |
|
2626 | + */ |
|
2618 | 2627 | public function removeUnneededFields(\stdClass $record, $type) |
2619 | 2628 | { |
2620 | 2629 | unset($type); |
@@ -2948,7 +2957,7 @@ discard block |
||
2948 | 2957 | |
2949 | 2958 | /** |
2950 | 2959 | * @param string $column |
2951 | - * @param $displayCol |
|
2960 | + * @param string $displayCol |
|
2952 | 2961 | * @return string|null |
2953 | 2962 | */ |
2954 | 2963 | protected function _findFieldByQuery($column, $displayCol) |
@@ -3115,8 +3124,8 @@ discard block |
||
3115 | 3124 | /** |
3116 | 3125 | * @param string $field |
3117 | 3126 | * @param mixed $value |
3118 | - * @param null $type |
|
3119 | - * @param null $record |
|
3127 | + * @param string $type |
|
3128 | + * @param stdClass $record |
|
3120 | 3129 | * @return null |
3121 | 3130 | * @throws Exception |
3122 | 3131 | */ |
@@ -14,15 +14,15 @@ |
||
14 | 14 | namespace Terah\FluentPdoModel; |
15 | 15 | |
16 | 16 | use Closure; |
17 | -use PDOException; |
|
17 | +use DateTime; |
|
18 | 18 | use Exception; |
19 | 19 | use PDO; |
20 | +use PDOException; |
|
20 | 21 | use PDOStatement; |
21 | -use stdClass; |
|
22 | -use DateTime; |
|
23 | -use Terah\FluentPdoModel\Drivers\AbstractPdo; |
|
24 | 22 | use Psr\Log\AbstractLogger; |
25 | 23 | use Stash\Interfaces\PoolInterface; |
24 | +use Terah\FluentPdoModel\Drivers\AbstractPdo; |
|
25 | +use stdClass; |
|
26 | 26 | use function Terah\Assert\Assert; |
27 | 27 | use function Terah\Assert\Validate; |
28 | 28 |