diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-08-16 13:59:28 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-08-16 13:59:28 +0900 |
| commit | b4ab3df2ec85fbe477d7721344a8cd3630b437a1 (patch) | |
| tree | eb618cbbdfa46cf829031f9c427dc09ef7584831 /crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver | |
| parent | baf9aff3134ac5a10260d3be421a2c17a0180d64 (diff) | |
| download | php-shirabe-b4ab3df2ec85fbe477d7721344a8cd3630b437a1.tar.gz php-shirabe-b4ab3df2ec85fbe477d7721344a8cd3630b437a1.tar.zst php-shirabe-b4ab3df2ec85fbe477d7721344a8cd3630b437a1.zip | |
feat(plugin): guard Rust-owned classes the worker has no proxy for
The worker's autoloader fell through to the real Composer source for every
Rust-owned FQCN without a proxy stub, so plugin code doing `new Filesystem()`
or subclassing `LibraryInstaller` silently ran on a second instance the Rust
side never sees. An unimplemented part of the plugin API has to fail with an
explicit error naming it, not quietly work on a disconnected copy.
The stub generator now emits a guard class for each of those FQCNs: the real
declaration, hierarchy and constants, with every constructor and method
raising an explicit error. References satisfied by the declaration alone
(`instanceof`, `X::class`, `Link::TYPE_REQUIRE`) keep working. Two FQCNs stay
resolvable to the real class, each listed with the worker-side mechanism that
makes a natively constructed instance correct.
The error had nowhere to go: `Installer::run` dropped the `Result` of both
`dispatch_script` calls, so an exception from a listener ended in exit 0.
Both propagate now, the way the exception does upstream.
Three real-plugin E2E comparisons stop at a guard and are ignored, each
naming the class it needs.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver')
17 files changed, 1185 insertions, 0 deletions
diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Decisions.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Decisions.php new file mode 100644 index 00000000..21d44992 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Decisions.php @@ -0,0 +1,145 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\Decisions. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +class Decisions implements \Iterator, \Countable +{ + public const DECISION_LITERAL = 0; + public const DECISION_REASON = 1; + + public function __construct(Pool $pool) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function decide(int $literal, int $level, Rule $why): void + { + \ShirabeUnsupportedClass::fail(self::class, 'decide'); + } + + public function satisfy(int $literal): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'satisfy'); + } + + public function conflict(int $literal): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'conflict'); + } + + public function decided(int $literalOrPackageId): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'decided'); + } + + public function undecided(int $literalOrPackageId): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'undecided'); + } + + public function decidedInstall(int $literalOrPackageId): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'decidedInstall'); + } + + public function decisionLevel(int $literalOrPackageId): int + { + \ShirabeUnsupportedClass::fail(self::class, 'decisionLevel'); + } + + public function decisionRule(int $literalOrPackageId): Rule + { + \ShirabeUnsupportedClass::fail(self::class, 'decisionRule'); + } + + public function atOffset(int $queueOffset): array + { + \ShirabeUnsupportedClass::fail(self::class, 'atOffset'); + } + + public function validOffset(int $queueOffset): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'validOffset'); + } + + public function lastReason(): Rule + { + \ShirabeUnsupportedClass::fail(self::class, 'lastReason'); + } + + public function lastLiteral(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'lastLiteral'); + } + + public function reset(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'reset'); + } + + public function resetToOffset(int $offset): void + { + \ShirabeUnsupportedClass::fail(self::class, 'resetToOffset'); + } + + public function revertLast(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'revertLast'); + } + + public function count(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'count'); + } + + public function rewind(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'rewind'); + } + + public function current() + { + \ShirabeUnsupportedClass::fail(self::class, 'current'); + } + + public function key(): ?int + { + \ShirabeUnsupportedClass::fail(self::class, 'key'); + } + + public function next(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'next'); + } + + public function valid(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'valid'); + } + + public function isEmpty(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isEmpty'); + } + + protected function addDecision(int $literal, int $level): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addDecision'); + } + + public function toString(?Pool $pool = null): string + { + \ShirabeUnsupportedClass::fail(self::class, 'toString'); + } + + public function __toString(): string + { + \ShirabeUnsupportedClass::fail(self::class, '__toString'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/DefaultPolicy.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/DefaultPolicy.php new file mode 100644 index 00000000..bf6e55fb --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/DefaultPolicy.php @@ -0,0 +1,55 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\DefaultPolicy. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +use Composer\Package\BasePackage; +use Composer\Package\PackageInterface; + +class DefaultPolicy implements PolicyInterface +{ + public function __construct(bool $preferStable = false, bool $preferLowest = false, ?array $preferredVersions = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function versionCompare(PackageInterface $a, PackageInterface $b, string $operator): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'versionCompare'); + } + + public function selectPreferredPackages(Pool $pool, array $literals, ?string $requiredPackage = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'selectPreferredPackages'); + } + + protected function groupLiteralsByName(Pool $pool, array $literals): array + { + \ShirabeUnsupportedClass::fail(self::class, 'groupLiteralsByName'); + } + + public function compareByPriority(Pool $pool, BasePackage $a, BasePackage $b, ?string $requiredPackage = null, bool $ignoreReplace = false): int + { + \ShirabeUnsupportedClass::fail(self::class, 'compareByPriority'); + } + + protected function replaces(BasePackage $source, BasePackage $target): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'replaces'); + } + + protected function pruneToBestVersion(Pool $pool, array $literals): array + { + \ShirabeUnsupportedClass::fail(self::class, 'pruneToBestVersion'); + } + + protected function pruneRemoteAliases(Pool $pool, array $literals): array + { + \ShirabeUnsupportedClass::fail(self::class, 'pruneRemoteAliases'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/GenericRule.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/GenericRule.php new file mode 100644 index 00000000..639f47fa --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/GenericRule.php @@ -0,0 +1,107 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\GenericRule. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +class GenericRule extends Rule +{ + public function __construct(array $literals, $reason, $reasonData) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getLiterals(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getLiterals'); + } + + public function getHash() + { + \ShirabeUnsupportedClass::fail(self::class, 'getHash'); + } + + public function equals(Rule $rule): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'equals'); + } + + public function isAssertion(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isAssertion'); + } + + public function __toString(): string + { + \ShirabeUnsupportedClass::fail(self::class, '__toString'); + } + + public function getReason(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'getReason'); + } + + public function getReasonData() + { + \ShirabeUnsupportedClass::fail(self::class, 'getReasonData'); + } + + public function getRequiredPackage(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRequiredPackage'); + } + + public function setType($type): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setType'); + } + + public function getType(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'getType'); + } + + public function disable(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'disable'); + } + + public function enable(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'enable'); + } + + public function isDisabled(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isDisabled'); + } + + public function isEnabled(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isEnabled'); + } + + public function isCausedByLock(RepositorySet $repositorySet, Request $request, Pool $pool): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isCausedByLock'); + } + + public function getSourcePackage(Pool $pool): BasePackage + { + \ShirabeUnsupportedClass::fail(self::class, 'getSourcePackage'); + } + + public function getPrettyString(RepositorySet $repositorySet, Request $request, Pool $pool, bool $isVerbose, array $installedMap = [], array $learnedPool = []): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPrettyString'); + } + + protected function formatPackagesUnique(Pool $pool, array $literalsOrPackages, bool $isVerbose, ?ConstraintInterface $constraint = null, bool $useRemovedVersionGroup = false): string + { + \ShirabeUnsupportedClass::fail(self::class, 'formatPackagesUnique'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/LocalRepoTransaction.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/LocalRepoTransaction.php new file mode 100644 index 00000000..8c702b28 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/LocalRepoTransaction.php @@ -0,0 +1,20 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\LocalRepoTransaction. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +use Composer\Repository\InstalledRepositoryInterface; +use Composer\Repository\RepositoryInterface; + +class LocalRepoTransaction extends Transaction +{ + public function __construct(RepositoryInterface $lockedRepository, InstalledRepositoryInterface $localRepository) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/LockTransaction.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/LockTransaction.php new file mode 100644 index 00000000..e7a0b36f --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/LockTransaction.php @@ -0,0 +1,37 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\LockTransaction. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +class LockTransaction extends Transaction +{ + public function __construct(Pool $pool, array $presentMap, array $unlockableMap, Decisions $decisions) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function setResultPackages(Pool $pool, Decisions $decisions): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setResultPackages'); + } + + public function setNonDevPackages(LockTransaction $extractionResult): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setNonDevPackages'); + } + + public function getNewLockPackages(bool $devMode, bool $updateMirrors = false): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getNewLockPackages'); + } + + public function getAliases(array $aliases): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getAliases'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/MultiConflictRule.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/MultiConflictRule.php new file mode 100644 index 00000000..d8d86170 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/MultiConflictRule.php @@ -0,0 +1,107 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\MultiConflictRule. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +class MultiConflictRule extends Rule +{ + public function __construct(array $literals, $reason, $reasonData) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getLiterals(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getLiterals'); + } + + public function getHash() + { + \ShirabeUnsupportedClass::fail(self::class, 'getHash'); + } + + public function equals(Rule $rule): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'equals'); + } + + public function isAssertion(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isAssertion'); + } + + public function disable(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'disable'); + } + + public function __toString(): string + { + \ShirabeUnsupportedClass::fail(self::class, '__toString'); + } + + public function getReason(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'getReason'); + } + + public function getReasonData() + { + \ShirabeUnsupportedClass::fail(self::class, 'getReasonData'); + } + + public function getRequiredPackage(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRequiredPackage'); + } + + public function setType($type): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setType'); + } + + public function getType(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'getType'); + } + + public function enable(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'enable'); + } + + public function isDisabled(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isDisabled'); + } + + public function isEnabled(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isEnabled'); + } + + public function isCausedByLock(RepositorySet $repositorySet, Request $request, Pool $pool): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isCausedByLock'); + } + + public function getSourcePackage(Pool $pool): BasePackage + { + \ShirabeUnsupportedClass::fail(self::class, 'getSourcePackage'); + } + + public function getPrettyString(RepositorySet $repositorySet, Request $request, Pool $pool, bool $isVerbose, array $installedMap = [], array $learnedPool = []): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPrettyString'); + } + + protected function formatPackagesUnique(Pool $pool, array $literalsOrPackages, bool $isVerbose, ?ConstraintInterface $constraint = null, bool $useRemovedVersionGroup = false): string + { + \ShirabeUnsupportedClass::fail(self::class, 'formatPackagesUnique'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Pool.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Pool.php new file mode 100644 index 00000000..a1770817 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Pool.php @@ -0,0 +1,115 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\Pool. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +use Composer\Package\BasePackage; +use Composer\Semver\Constraint\ConstraintInterface; + +class Pool implements \Countable +{ + public function __construct(array $packages = [], array $unacceptableFixedOrLockedPackages = [], array $removedVersions = [], array $removedVersionsByPackage = [], array $securityRemovedVersions = [], array $abandonedRemovedVersions = []) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRemovedVersions(string $name, ConstraintInterface $constraint): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRemovedVersions'); + } + + public function getAllRemovedVersions(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getAllRemovedVersions'); + } + + public function getRemovedVersionsByPackage(string $objectHash): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRemovedVersionsByPackage'); + } + + public function getAllRemovedVersionsByPackage(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getAllRemovedVersionsByPackage'); + } + + public function isSecurityRemovedPackageVersion(string $packageName, ?ConstraintInterface $constraint): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isSecurityRemovedPackageVersion'); + } + + public function getSecurityAdvisoryIdentifiersForPackageVersion(string $packageName, ?ConstraintInterface $constraint): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSecurityAdvisoryIdentifiersForPackageVersion'); + } + + public function isAbandonedRemovedPackageVersion(string $packageName, ?ConstraintInterface $constraint): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isAbandonedRemovedPackageVersion'); + } + + public function getAllSecurityRemovedPackageVersions(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getAllSecurityRemovedPackageVersions'); + } + + public function getAllAbandonedRemovedPackageVersions(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getAllAbandonedRemovedPackageVersions'); + } + + public function getPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackages'); + } + + public function packageById(int $id): BasePackage + { + \ShirabeUnsupportedClass::fail(self::class, 'packageById'); + } + + public function count(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'count'); + } + + public function whatProvides(string $name, ?ConstraintInterface $constraint = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'whatProvides'); + } + + public function literalToPackage(int $literal): BasePackage + { + \ShirabeUnsupportedClass::fail(self::class, 'literalToPackage'); + } + + public function literalToPrettyString(int $literal, array $installedMap): string + { + \ShirabeUnsupportedClass::fail(self::class, 'literalToPrettyString'); + } + + public function match(BasePackage $candidate, string $name, ?ConstraintInterface $constraint = null): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'match'); + } + + public function isUnacceptableFixedOrLockedPackage(BasePackage $package): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isUnacceptableFixedOrLockedPackage'); + } + + public function getUnacceptableFixedOrLockedPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getUnacceptableFixedOrLockedPackages'); + } + + public function __toString(): string + { + \ShirabeUnsupportedClass::fail(self::class, '__toString'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/PoolBuilder.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/PoolBuilder.php new file mode 100644 index 00000000..78afa42d --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/PoolBuilder.php @@ -0,0 +1,37 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\PoolBuilder. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +use Composer\EventDispatcher\EventDispatcher; +use Composer\IO\IOInterface; + +class PoolBuilder +{ + private const LOAD_BATCH_SIZE = 50; + + public function __construct(array $acceptableStabilities, array $stabilityFlags, array $rootAliases, array $rootReferences, IOInterface $io, ?EventDispatcher $eventDispatcher = null, ?PoolOptimizer $poolOptimizer = null, array $temporaryConstraints = [], ?SecurityAdvisoryPoolFilter $securityAdvisoryPoolFilter = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function setIgnoredTypes(array $types): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setIgnoredTypes'); + } + + public function setAllowedTypes(?array $types): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setAllowedTypes'); + } + + public function buildPool(array $repositories, Request $request): Pool + { + \ShirabeUnsupportedClass::fail(self::class, 'buildPool'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/PoolOptimizer.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/PoolOptimizer.php new file mode 100644 index 00000000..59489d6c --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/PoolOptimizer.php @@ -0,0 +1,22 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\PoolOptimizer. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +class PoolOptimizer +{ + public function __construct(PolicyInterface $policy) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function optimize(Request $request, Pool $pool): Pool + { + \ShirabeUnsupportedClass::fail(self::class, 'optimize'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Request.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Request.php new file mode 100644 index 00000000..2d472d18 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Request.php @@ -0,0 +1,126 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\Request. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +use Composer\Package\BasePackage; +use Composer\Package\PackageInterface; +use Composer\Repository\LockArrayRepository; +use Composer\Semver\Constraint\ConstraintInterface; + +class Request +{ + public const UPDATE_ONLY_LISTED = 0; + public const UPDATE_LISTED_WITH_TRANSITIVE_DEPS_NO_ROOT_REQUIRE = 1; + public const UPDATE_LISTED_WITH_TRANSITIVE_DEPS = 2; + + public function __construct(?LockArrayRepository $lockedRepository = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function requireName(string $packageName, ?ConstraintInterface $constraint = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'requireName'); + } + + public function fixPackage(BasePackage $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'fixPackage'); + } + + public function lockPackage(BasePackage $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'lockPackage'); + } + + public function fixLockedPackage(BasePackage $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'fixLockedPackage'); + } + + public function unlockPackage(BasePackage $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'unlockPackage'); + } + + public function setUpdateAllowList(array $updateAllowList, $updateAllowTransitiveDependencies): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setUpdateAllowList'); + } + + public function getUpdateAllowList(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getUpdateAllowList'); + } + + public function getUpdateAllowTransitiveDependencies(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'getUpdateAllowTransitiveDependencies'); + } + + public function getUpdateAllowTransitiveRootDependencies(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'getUpdateAllowTransitiveRootDependencies'); + } + + public function getRequires(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRequires'); + } + + public function getFixedPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getFixedPackages'); + } + + public function isFixedPackage(BasePackage $package): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isFixedPackage'); + } + + public function getLockedPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getLockedPackages'); + } + + public function isLockedPackage(PackageInterface $package): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isLockedPackage'); + } + + public function getFixedOrLockedPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getFixedOrLockedPackages'); + } + + public function getPresentMap(bool $packageIds = false): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getPresentMap'); + } + + public function getFixedPackagesMap(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getFixedPackagesMap'); + } + + public function getLockedRepository(): ?LockArrayRepository + { + \ShirabeUnsupportedClass::fail(self::class, 'getLockedRepository'); + } + + public function restrictPackages(array $names): void + { + \ShirabeUnsupportedClass::fail(self::class, 'restrictPackages'); + } + + public function getRestrictedPackages(): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRestrictedPackages'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Rule2Literals.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Rule2Literals.php new file mode 100644 index 00000000..6527e99b --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Rule2Literals.php @@ -0,0 +1,107 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\Rule2Literals. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +class Rule2Literals extends Rule +{ + public function __construct(int $literal1, int $literal2, $reason, $reasonData) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getLiterals(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getLiterals'); + } + + public function getHash() + { + \ShirabeUnsupportedClass::fail(self::class, 'getHash'); + } + + public function equals(Rule $rule): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'equals'); + } + + public function isAssertion(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isAssertion'); + } + + public function __toString(): string + { + \ShirabeUnsupportedClass::fail(self::class, '__toString'); + } + + public function getReason(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'getReason'); + } + + public function getReasonData() + { + \ShirabeUnsupportedClass::fail(self::class, 'getReasonData'); + } + + public function getRequiredPackage(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRequiredPackage'); + } + + public function setType($type): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setType'); + } + + public function getType(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'getType'); + } + + public function disable(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'disable'); + } + + public function enable(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'enable'); + } + + public function isDisabled(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isDisabled'); + } + + public function isEnabled(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isEnabled'); + } + + public function isCausedByLock(RepositorySet $repositorySet, Request $request, Pool $pool): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isCausedByLock'); + } + + public function getSourcePackage(Pool $pool): BasePackage + { + \ShirabeUnsupportedClass::fail(self::class, 'getSourcePackage'); + } + + public function getPrettyString(RepositorySet $repositorySet, Request $request, Pool $pool, bool $isVerbose, array $installedMap = [], array $learnedPool = []): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPrettyString'); + } + + protected function formatPackagesUnique(Pool $pool, array $literalsOrPackages, bool $isVerbose, ?ConstraintInterface $constraint = null, bool $useRemovedVersionGroup = false): string + { + \ShirabeUnsupportedClass::fail(self::class, 'formatPackagesUnique'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/RuleSet.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/RuleSet.php new file mode 100644 index 00000000..40d6780a --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/RuleSet.php @@ -0,0 +1,78 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\RuleSet. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +use Composer\Repository\RepositorySet; + +class RuleSet implements \IteratorAggregate, \Countable +{ + public const TYPE_PACKAGE = 0; + public const TYPE_REQUEST = 1; + public const TYPE_LEARNED = 4; + public const TYPES = [ + self::TYPE_PACKAGE => 'PACKAGE', + self::TYPE_REQUEST => 'REQUEST', + self::TYPE_LEARNED => 'LEARNED', + ]; + + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function add(Rule $rule, $type): void + { + \ShirabeUnsupportedClass::fail(self::class, 'add'); + } + + public function count(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'count'); + } + + public function ruleById(int $id): Rule + { + \ShirabeUnsupportedClass::fail(self::class, 'ruleById'); + } + + public function getRules(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRules'); + } + + public function getIterator(): RuleSetIterator + { + \ShirabeUnsupportedClass::fail(self::class, 'getIterator'); + } + + public function getIteratorFor($types): RuleSetIterator + { + \ShirabeUnsupportedClass::fail(self::class, 'getIteratorFor'); + } + + public function getIteratorWithout($types): RuleSetIterator + { + \ShirabeUnsupportedClass::fail(self::class, 'getIteratorWithout'); + } + + public function getTypes(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTypes'); + } + + public function getPrettyString(?RepositorySet $repositorySet = null, ?Request $request = null, ?Pool $pool = null, bool $isVerbose = false): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPrettyString'); + } + + public function __toString(): string + { + \ShirabeUnsupportedClass::fail(self::class, '__toString'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/RuleSetGenerator.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/RuleSetGenerator.php new file mode 100644 index 00000000..4406ddda --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/RuleSetGenerator.php @@ -0,0 +1,65 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\RuleSetGenerator. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface; +use Composer\Package\BasePackage; + +class RuleSetGenerator +{ + public function __construct(PolicyInterface $policy, Pool $pool) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + protected function createRequireRule(BasePackage $package, array $providers, $reason, $reasonData): ?Rule + { + \ShirabeUnsupportedClass::fail(self::class, 'createRequireRule'); + } + + protected function createInstallOneOfRule(array $packages, $reason, $reasonData): Rule + { + \ShirabeUnsupportedClass::fail(self::class, 'createInstallOneOfRule'); + } + + protected function createRule2Literals(BasePackage $issuer, BasePackage $provider, $reason, $reasonData): ?Rule + { + \ShirabeUnsupportedClass::fail(self::class, 'createRule2Literals'); + } + + protected function createMultiConflictRule(array $packages, $reason, $reasonData): Rule + { + \ShirabeUnsupportedClass::fail(self::class, 'createMultiConflictRule'); + } + + protected function addRulesForPackage(BasePackage $package, PlatformRequirementFilterInterface $platformRequirementFilter): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addRulesForPackage'); + } + + protected function addConflictRules(PlatformRequirementFilterInterface $platformRequirementFilter): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addConflictRules'); + } + + protected function addRulesForRequest(Request $request, PlatformRequirementFilterInterface $platformRequirementFilter): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addRulesForRequest'); + } + + protected function addRulesForRootAliases(PlatformRequirementFilterInterface $platformRequirementFilter): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addRulesForRootAliases'); + } + + public function getRulesFor(Request $request, ?PlatformRequirementFilterInterface $platformRequirementFilter = null): RuleSet + { + \ShirabeUnsupportedClass::fail(self::class, 'getRulesFor'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/RuleSetIterator.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/RuleSetIterator.php new file mode 100644 index 00000000..e02b58de --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/RuleSetIterator.php @@ -0,0 +1,42 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\RuleSetIterator. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +class RuleSetIterator implements \Iterator +{ + public function __construct(array $rules) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function current(): Rule + { + \ShirabeUnsupportedClass::fail(self::class, 'current'); + } + + public function key(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'key'); + } + + public function next(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'next'); + } + + public function rewind(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'rewind'); + } + + public function valid(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'valid'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/SecurityAdvisoryPoolFilter.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/SecurityAdvisoryPoolFilter.php new file mode 100644 index 00000000..43250c43 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/SecurityAdvisoryPoolFilter.php @@ -0,0 +1,25 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\SecurityAdvisoryPoolFilter. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +use Composer\Advisory\AuditConfig; +use Composer\Advisory\Auditor; + +class SecurityAdvisoryPoolFilter +{ + public function __construct(Auditor $auditor, AuditConfig $auditConfig) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function filter(Pool $pool, array $repositories, Request $request): Pool + { + \ShirabeUnsupportedClass::fail(self::class, 'filter'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Solver.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Solver.php new file mode 100644 index 00000000..b339f276 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Solver.php @@ -0,0 +1,58 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\Solver. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface; +use Composer\IO\IOInterface; + +class Solver +{ + private const BRANCH_LITERALS = 0; + private const BRANCH_LEVEL = 1; + + public function __construct(PolicyInterface $policy, Pool $pool, IOInterface $io) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRuleSetSize(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'getRuleSetSize'); + } + + public function getPool(): Pool + { + \ShirabeUnsupportedClass::fail(self::class, 'getPool'); + } + + protected function setupFixedMap(Request $request): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setupFixedMap'); + } + + protected function checkForRootRequireProblems(Request $request, PlatformRequirementFilterInterface $platformRequirementFilter): void + { + \ShirabeUnsupportedClass::fail(self::class, 'checkForRootRequireProblems'); + } + + public function solve(Request $request, ?PlatformRequirementFilterInterface $platformRequirementFilter = null): LockTransaction + { + \ShirabeUnsupportedClass::fail(self::class, 'solve'); + } + + protected function propagate(int $level): ?Rule + { + \ShirabeUnsupportedClass::fail(self::class, 'propagate'); + } + + protected function analyze(int $level, Rule $rule): array + { + \ShirabeUnsupportedClass::fail(self::class, 'analyze'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Transaction.php b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Transaction.php new file mode 100644 index 00000000..e3388d49 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/DependencyResolver/Transaction.php @@ -0,0 +1,39 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\DependencyResolver\Transaction. +// The Rust side owns this class and the worker has no proxy for it, so this +// declaration shadows the real one: the constants and the hierarchy stay, while +// constructing it or calling anything on it raises an explicit error. + +namespace Composer\DependencyResolver; + +use Composer\Package\Link; + +class Transaction +{ + public function __construct(array $presentPackages, array $resultPackages) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getOperations(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getOperations'); + } + + protected function calculateOperations(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'calculateOperations'); + } + + protected function getRootPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootPackages'); + } + + protected function getProvidersInResult(Link $link): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getProvidersInResult'); + } +} |
