Change Schema classes to final

This commit is contained in:
Deon George 2023-04-02 22:08:43 +10:00
parent 4fd51abcb1
commit a62e7ddeca
7 changed files with 9 additions and 8 deletions

View File

@ -11,7 +11,7 @@ use Illuminate\Support\Facades\Log;
* @package phpLDAPadmin * @package phpLDAPadmin
* @subpackage Schema * @subpackage Schema
*/ */
class AttributeType extends Base { final class AttributeType extends Base {
// The attribute from which this attribute inherits (if any) // The attribute from which this attribute inherits (if any)
private ?string $sup_attribute = NULL; private ?string $sup_attribute = NULL;
@ -246,7 +246,7 @@ class AttributeType extends Base {
public function __clone() public function __clone()
{ {
// When we clone, we need to break the reference to // When we clone, we need to break the reference too
$this->aliases = clone $this->aliases; $this->aliases = clone $this->aliases;
} }

View File

@ -10,7 +10,7 @@ use Illuminate\Support\Facades\Log;
* @package phpLDAPadmin * @package phpLDAPadmin
* @subpackage Schema * @subpackage Schema
*/ */
class LDAPSyntax extends Base { final class LDAPSyntax extends Base {
// Is human readable? // Is human readable?
private ?bool $is_not_human_readable = NULL; private ?bool $is_not_human_readable = NULL;

View File

@ -11,7 +11,7 @@ use Illuminate\Support\Facades\Log;
* @package phpLDAPadmin * @package phpLDAPadmin
* @subpackage Schema * @subpackage Schema
*/ */
class MatchingRule extends Base { final class MatchingRule extends Base {
// This rule's syntax OID // This rule's syntax OID
private ?string $syntax = NULL; private ?string $syntax = NULL;

View File

@ -11,7 +11,7 @@ use Illuminate\Support\Facades\Log;
* @package phpLDAPadmin * @package phpLDAPadmin
* @subpackage Schema * @subpackage Schema
*/ */
class MatchingRuleUse extends Base { final class MatchingRuleUse extends Base {
// An array of attribute names who use this MatchingRule // An array of attribute names who use this MatchingRule
private Collection $used_by_attrs; private Collection $used_by_attrs;

View File

@ -15,7 +15,7 @@ use App\Ldap\Entry;
* @package phpLDAPadmin * @package phpLDAPadmin
* @subpackage Schema * @subpackage Schema
*/ */
class ObjectClass extends Base { final class ObjectClass extends Base {
// The server ID that this objectclass belongs to. // The server ID that this objectclass belongs to.
private Server $server; private Server $server;

View File

@ -13,7 +13,7 @@ namespace App\Classes\LDAP\Schema;
* specified it. This class is therefore used by the class ObjectClass to determine * specified it. This class is therefore used by the class ObjectClass to determine
* inheritance. * inheritance.
*/ */
class ObjectClassAttribute extends Base { final class ObjectClassAttribute extends Base {
// This Attribute's root. // This Attribute's root.
private string $source; private string $source;

View File

@ -18,7 +18,7 @@ use App\Classes\LDAP\Schema\{AttributeType,Base,LDAPSyntax,MatchingRule,Matching
use App\Exceptions\InvalidUsage; use App\Exceptions\InvalidUsage;
use App\Ldap\Entry; use App\Ldap\Entry;
class Server final class Server
{ {
// This servers schema objectclasses // This servers schema objectclasses
private Collection $attributetypes; private Collection $attributetypes;
@ -59,6 +59,7 @@ class Server
* @return Collection * @return Collection
* @throws ObjectNotFoundException * @throws ObjectNotFoundException
* @testedin GetBaseDNTest::testBaseDNExists(); * @testedin GetBaseDNTest::testBaseDNExists();
* @todo Need to allow for the scenario if the baseDN is not readable by ACLs
*/ */
public static function baseDNs($connection=NULL,bool $objects=TRUE): Collection public static function baseDNs($connection=NULL,bool $objects=TRUE): Collection
{ {