Skip to content

Internals Installer Package VerifyManifest

Stefan Crkvenjakov edited this page Oct 7, 2026 · 1 revision

installer\package\VerifyManifest

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/installer/package/VerifyManifest.php · Snapshot 8411f4287706.

Installation validates archives and manifests, moves files, persists metadata, copies data into storage, invokes an optional hook and emits an event. These operations do not form one atomic transaction.

Imports and dependencies

use installer\interfaces\package\IVerifyManifest;
use RuntimeException;

VerifyManifest

Declaration and architectural role

class VerifyManifest implements IVerifyManifest

Constants, enum cases, traits and properties

Declarations below preserve visibility, type, default and modifiers exactly. A typed property without an initializer remains uninitialized until its constructor or another method assigns it. Mutable fields belong to this instance unless marked static; readonly fields can be initialized once. Constructor-promoted properties are also listed below.

Member Declaration Purpose or source contract
$manifest private array $manifest; Used by __construct(), verify().
$verificationList private array $verificationList = []; Used by addKey(), addKeyWithType(), verify().
Constructor-promoted public function __construct(array $manifest) Initialized from the constructor argument; default expression is evaluated when the argument is omitted.

Method index

Method Signature
__construct public function __construct(array $manifest)
addKey public function addKey(string $key): IVerifyManifest
addKeyWithType public function addKeyWithType(string $key, string $type): IVerifyManifest
verify public function verify(): bool

__construct

Source line 14

public function __construct(array $manifest)

Parameters

Parameter Type, modifiers and default Purpose
$manifest array $manifest Operation input; the exact use, validation and propagation are shown in the implementation trace.

State writes: $this->manifest.

Implementation, validation guards and interaction order
public function __construct(array $manifest)
    {
        $this->manifest = $manifest;
    }

addKey

Source line 23

public function addKey(string $key): IVerifyManifest

Parameters

Parameter Type, modifiers and default Purpose
$key string $key Operation input; the exact use, validation and propagation are shown in the implementation trace.

State writes: $this->verificationList[$key].

Return expressions (including local callbacks): $this.

Implementation, validation guards and interaction order
/**
     * @inheritDoc
     */
    public function addKey(string $key): IVerifyManifest
    {
        $this->verificationList[$key] = "*";
        return $this;
    }

addKeyWithType

Source line 32

public function addKeyWithType(string $key, string $type): IVerifyManifest

Parameters

Parameter Type, modifiers and default Purpose
$key string $key Operation input; the exact use, validation and propagation are shown in the implementation trace.
$type string $type Expected class/type or enum selection according to the signature.

State writes: $this->verificationList[$key].

Return expressions (including local callbacks): $this.

Implementation, validation guards and interaction order
/**
     * @inheritDoc
     */
    public function addKeyWithType(string $key, string $type): IVerifyManifest
    {
        $this->verificationList[$key] = $type;
        return $this;
    }

verify

Source line 41

public function verify(): bool

Return expressions (including local callbacks): true.

Explicit exceptions: RuntimeException. The guards in the implementation below show when each is raised; exceptions from collaborators also propagate unless caught.

Implementation, validation guards and interaction order
/**
     * @inheritDoc
     */
    public function verify(): bool
    {
        foreach ($this->verificationList as $key => $type) {
            if (!array_key_exists($key, $this->manifest)) {
                throw new RuntimeException("Manifest key not found: {$key}");
            }
            if ($type === '*') {
                continue;
            }
            $normalized = match ($type) {
                'bool'  => 'boolean',
                'int'   => 'integer',
                'float' => 'double',
                default => $type,
            };
            if (gettype($this->manifest[$key]) !== $normalized) {
                throw new RuntimeException("Manifest key type mismatch: {$key} expected {$type}, got " . gettype($this->manifest[$key]));
            }
        }
        return true;
    }

Related types

Clone this wiki locally