2
2
3
3
namespace rawsrc \PDOPlusPlus ;
4
4
5
- include_once 'AbstractInjector.php ' ;
6
-
7
- use InvalidArgumentException ;
8
- use rawsrc \PDOPlusPlus \AbstractInjector ;
9
-
10
5
use BadMethodCallException ;
11
6
use Closure ;
12
7
use Exception ;
8
+ use InvalidArgumentException ;
13
9
use PDO ;
14
10
use PDOException ;
15
11
use PDOStatement ;
@@ -545,12 +541,17 @@ protected function execTransaction(string $sql, string $func_name)
545
541
* Plain escaped SQL value
546
542
* Possible types: int str float double num numeric bool binary
547
543
*
548
- * @return AbstractInjector
544
+ * @return object
549
545
* @throws TypeError
550
546
*/
551
- public function getInjectorIn (): AbstractInjector
547
+ public function getInjectorIn (): object
552
548
{
553
- return new class ($ this ->data ) extends AbstractInjector {
549
+ return new class ($ this ->data ) {
550
+ /**
551
+ * @param array $data
552
+ */
553
+ public function __construct (protected array &$ data ) { }
554
+
554
555
/**
555
556
* @param mixed $value
556
557
* @param string $type among: int str float bool binary bigint
@@ -579,11 +580,15 @@ public function __invoke(mixed $value, string $type = 'str'): string
579
580
* Plain escaped SQL values passed by reference
580
581
* Possible types: int str float double num numeric bool binary
581
582
*
582
- * @return AbstractInjector
583
+ * @return object
583
584
*/
584
- public function getInjectorInAsRef (): AbstractInjector
585
+ public function getInjectorInAsRef (): object
585
586
{
586
- return new class ($ this ->data ) extends AbstractInjector {
587
+ return new class ($ this ->data ) {
588
+ /**
589
+ * @param array $data
590
+ */
591
+ public function __construct (protected array &$ data ) { }
587
592
/**
588
593
* @param mixed $value
589
594
* @param string $type among: int str float bool binary bigint
@@ -607,11 +612,15 @@ public function __invoke(mixed &$value, string $type = 'str'): string
607
612
* Injector for values using a statement with ->bindValue()
608
613
* Possible types: int str float double num numeric bool binary
609
614
*
610
- * @return AbstractInjector
615
+ * @return object
611
616
*/
612
- public function getInjectorInByVal (): AbstractInjector
617
+ public function getInjectorInByVal (): object
613
618
{
614
- return new class ($ this ->data ) extends AbstractInjector {
619
+ return new class ($ this ->data ) {
620
+ /**
621
+ * @param array $data
622
+ */
623
+ public function __construct (protected array &$ data ) { }
615
624
/**
616
625
* @param mixed $value
617
626
* @param string $type among: int str float bool binary bigint
@@ -639,11 +648,15 @@ public function __invoke(mixed $value, string $type = 'str'): string
639
648
/**
640
649
* Injector for referenced values using a statement with ->bindParam()
641
650
*
642
- * @return AbstractInjector
651
+ * @return object
643
652
*/
644
- public function getInjectorInByRef (): AbstractInjector
653
+ public function getInjectorInByRef (): object
645
654
{
646
- return new class ($ this ->data ) extends AbstractInjector {
655
+ return new class ($ this ->data ) {
656
+ /**
657
+ * @param array $data
658
+ */
659
+ public function __construct (protected array &$ data ) { }
647
660
/**
648
661
* @param mixed $value
649
662
* @param string $type among: int str float double num numeric bool binary bigint
@@ -673,11 +686,16 @@ public function __invoke(mixed &$value, string $type = 'str'): string
673
686
/**
674
687
* Injector for a plain sql escaped INOUT attribute
675
688
*
676
- * @return AbstractInjector
689
+ * @return object
677
690
*/
678
- public function getInjectorInOut (): AbstractInjector
691
+ public function getInjectorInOut (): object
679
692
{
680
- return new class ($ this ->data ) extends AbstractInjector {
693
+ return new class ($ this ->data ) {
694
+ /**
695
+ * @param array $data
696
+ */
697
+ public function __construct (protected array &$ data ) { }
698
+
681
699
/**
682
700
* @param mixed $value
683
701
* @param string $inout_tag ex: '@id'
@@ -701,11 +719,16 @@ public function __invoke(mixed $value, string $inout_tag, string $type = 'str'):
701
719
/**
702
720
* Injector for an OUT attribute
703
721
*
704
- * @return AbstractInjector
722
+ * @return object
705
723
*/
706
724
public function getInjectorOut (): object
707
725
{
708
- return new class ($ this ->data ) extends AbstractInjector {
726
+ return new class ($ this ->data ) {
727
+ /**
728
+ * @param array $data
729
+ */
730
+ public function __construct (protected array &$ data ) { }
731
+
709
732
/**
710
733
* @param string $out_tag ex:'@id'
711
734
* @return string
0 commit comments