1<?php 2 3/** 4 * This file is part of the FreeDSx LDAP package. 5 * 6 * (c) Chad Sikorra <Chad.Sikorra@gmail.com> 7 * 8 * For the full copyright and license information, please view the LICENSE 9 * file that was distributed with this source code. 10 */ 11 12namespace FreeDSx\Ldap\Protocol; 13 14use FreeDSx\Asn1\Type\AbstractType; 15use FreeDSx\Ldap\Exception\ProtocolException; 16 17/** 18 * Methods needed to transform an object to/from ASN1 representation. 19 * 20 * @author Chad Sikorra <Chad.Sikorra@gmail.com> 21 */ 22interface ProtocolElementInterface 23{ 24 /** 25 * Returns the Asn1 representation of an object that can be used by an encoder. 26 * 27 * @return AbstractType 28 */ 29 public function toAsn1(): AbstractType; 30 31 /** 32 * @param AbstractType $type 33 * @return mixed 34 * @throws ProtocolException 35 */ 36 public static function fromAsn1(AbstractType $type); 37} 38