From 98973f8bfde72cef3ee1a4d4b3b00bd2d934249a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Lanzend=C3=B6rfer?= <leviathan@libresilicon.com>
Date: Thu, 3 Aug 2023 13:53:18 +0100
Subject: [PATCH] PHP8.2: Use __get and __set

---
 lib/Net/LDAP3.php        | 11 +++++++++++
 lib/Net/LDAP3/Result.php | 11 +++++++++++
 2 files changed, 22 insertions(+)

diff --git a/lib/Net/LDAP3.php b/lib/Net/LDAP3.php
index a9f196c..815eeac 100644
--- a/lib/Net/LDAP3.php
+++ b/lib/Net/LDAP3.php
@@ -41,6 +41,7 @@ require_once __DIR__ . '/LDAP3/Result.php';
  */
 class Net_LDAP3
 {
+
     const CONTROL_EFFECTIVE_RIGHTS = '1.3.6.1.4.1.42.2.27.9.5.2';
     const CONTROL_SORT_REQUEST     = '1.2.840.113556.1.4.473';
     const CONTROL_VLV_REQUEST      = '2.16.840.1.113730.3.4.9';
@@ -122,7 +123,17 @@ class Net_LDAP3
     protected $_current_host;
     protected $_metadata;
     protected $_vlv_indexes_and_searches;
+    protected $values = array();
+
+    public function __get( $key )
+    {
+        return $this->values[ $key ];
+    }
 
+    public function __set( $key, $value )
+    {
+        $this->values[ $key ] = $value;
+    }
 
     /**
      * Constructor
diff --git a/lib/Net/LDAP3/Result.php b/lib/Net/LDAP3/Result.php
index 8ee788a..d04e0f1 100644
--- a/lib/Net/LDAP3/Result.php
+++ b/lib/Net/LDAP3/Result.php
@@ -38,6 +38,7 @@
  */
 class Net_LDAP3_Result implements Iterator
 {
+    protected $values = array();
     protected $conn;
     protected $base_dn;
     protected $filter;
@@ -48,6 +49,16 @@ class Net_LDAP3_Result implements Iterator
     private $current;
     private $iteratorkey = 0;
 
+    public function __get( $key )
+    {
+        return $this->values[ $key ];
+    }
+
+    public function __set( $key, $value )
+    {
+        $this->values[ $key ] = $value;
+    }
+
     /**
      * Default constructor
      *
-- 
GitLab