Move to more PSR-4 standards.

This commit is contained in:
Deon George
2020-06-07 16:25:59 +10:00
parent d458fecff6
commit 7d259b251f
56 changed files with 3247 additions and 4292 deletions

View File

@@ -0,0 +1,30 @@
<?php
namespace Leenooks\OpenPGP\SignaturePacket;
use Leenooks\OpenPGP\Packet;
class Subpacket extends Packet
{
protected $tag = NULL;
function body()
{
return $this->data;
}
function header_and_body(): array
{
$body = $this->body(); // Get body first, we will need it's length
$size = chr(255).pack('N',strlen($body)+1); // Use 5-octet lengths + 1 for tag as first packet body octet
$tag = chr($this->tag);
return ['header'=>$size.$tag,'body'=>$body];
}
/* Defaults for unsupported packets */
function read()
{
$this->data = $this->input;
}
}