Skip to content

Internals Uninstaller Cleanup ResourceCleanup

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

uninstaller\cleanup\ResourceCleanup

Framework Internals · Subsystem overview · Developer guide

Source: awt_src/classes/uninstaller/cleanup/ResourceCleanup.php · Snapshot 8411f4287706.

Uninstallation deletes the package record before attempting each cleanup collaborator. Failures are collected; cleanup continues and can leave partial state.

Imports and dependencies

use uninstaller\interfaces\IPackageCleanup;
use vfs\resource\ResourceCache;

ResourceCleanup

Declaration and architectural role

class ResourceCleanup implements IPackageCleanup

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
Constructor-promoted public function __construct(private readonly string $packageRoot) Initialized from the constructor argument; default expression is evaluated when the argument is omitted.

Method index

Method Signature
__construct public function __construct(private readonly string $packageRoot)
clean public function clean(int $id, string $name): array

__construct

Source line 10

public function __construct(private readonly string $packageRoot);

Parameters

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

Concrete no-op/default hook: this method performs no work. Override it where the lifecycle or extension contract calls for behavior.

clean

Source line 12

public function clean(int $id, string $name): array

Parameters

Parameter Type, modifiers and default Purpose
$id int $id Record or runtime identifier selected by this operation.
$name string $name Named key/label selected by this API; its exact scope is shown by the implementation trace.

Return expressions (including local callbacks): ResourceCache::delete($name, $this->packageRoot) ? [] : ["Failed to delete resource entries for {$name}."].

Implementation, validation guards and interaction order
public function clean(int $id, string $name): array
    {
        return ResourceCache::delete($name, $this->packageRoot)
            ? [] : ["Failed to delete resource entries for {$name}."];
    }

Related types

Clone this wiki locally