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