diff options
121 files changed, 8061 insertions, 91 deletions
@@ -11,10 +11,7 @@ It aims at 100% compatibility with Composer, including the plugin API. ## Plugins -Shirabe runs Composer plugins using the system-provided real PHP. The plugin API is partially implemented. The following plugins are verified to work: - -* [composer/installers](https://github.com/composer/installers) -* [phpstan/extension-installer](https://github.com/phpstan/extension-installer) +Shirabe runs Composer plugins using the system-provided real PHP. The plugin API is partially implemented. ## Requirements diff --git a/crates/shirabe-php-rpc/build.rs b/crates/shirabe-php-rpc/build.rs index 07a77a07..937d0bb2 100644 --- a/crates/shirabe-php-rpc/build.rs +++ b/crates/shirabe-php-rpc/build.rs @@ -79,6 +79,26 @@ fn main() { ) .unwrap(); println!("cargo::rustc-env=SHIRABE_COMPOSER_RUNTIME_BUNDLE_ID={bundle_id}"); + + write_guard_files(&manifest_dir.join("php/guards"), &out_dir); +} + +/// Writes the initializer of `GUARD_FILES`: one `include_str!` per generated guard class. The +/// list is built here rather than spelled out in the source because there is one guard for every +/// Rust-owned class the worker has no proxy stub for. +fn write_guard_files(guards: &Path, out_dir: &Path) { + println!("cargo::rerun-if-changed={}", guards.display()); + + let mut code = String::from("&[\n"); + for file in find_files(guards) { + code += &format!( + " ({:?}, include_str!({:?})),\n", + relative_path(guards, &file), + file.to_str().unwrap() + ); + } + code += "]\n"; + std::fs::write(out_dir.join("guard-files.rs"), code).unwrap(); } /// Every file the bundle holds, in the order `Compiler::compile` adds them. diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Advisory/AuditConfig.php b/crates/shirabe-php-rpc/php/guards/Composer/Advisory/AuditConfig.php new file mode 100644 index 00000000..d45d56ad --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Advisory/AuditConfig.php @@ -0,0 +1,24 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Advisory\AuditConfig. +// 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\Advisory; + +use Composer\Config; + +class AuditConfig +{ + public function __construct(bool $audit, string $auditFormat, string $auditAbandoned, bool $blockInsecure, bool $blockAbandoned, bool $ignoreUnreachable, array $ignoreListForAudit, array $ignoreListForBlocking, array $ignoreSeverityForAudit, array $ignoreSeverityForBlocking, array $ignoreAbandonedForAudit, array $ignoreAbandonedForBlocking) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public static function fromConfig(Config $config, bool $audit = true, string $auditFormat = Auditor::FORMAT_SUMMARY): self + { + \ShirabeUnsupportedClass::fail(self::class, 'fromConfig'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Advisory/IgnoredSecurityAdvisory.php b/crates/shirabe-php-rpc/php/guards/Composer/Advisory/IgnoredSecurityAdvisory.php new file mode 100644 index 00000000..56d423bc --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Advisory/IgnoredSecurityAdvisory.php @@ -0,0 +1,25 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Advisory\IgnoredSecurityAdvisory. +// 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\Advisory; + +use Composer\Semver\Constraint\ConstraintInterface; +use DateTimeImmutable; + +class IgnoredSecurityAdvisory extends SecurityAdvisory +{ + public function __construct(string $packageName, string $advisoryId, ConstraintInterface $affectedVersions, string $title, array $sources, DateTimeImmutable $reportedAt, ?string $cve = null, ?string $link = null, ?string $ignoreReason = null, ?string $severity = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function jsonSerialize() + { + \ShirabeUnsupportedClass::fail(self::class, 'jsonSerialize'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Advisory/PartialSecurityAdvisory.php b/crates/shirabe-php-rpc/php/guards/Composer/Advisory/PartialSecurityAdvisory.php new file mode 100644 index 00000000..04d3b121 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Advisory/PartialSecurityAdvisory.php @@ -0,0 +1,31 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Advisory\PartialSecurityAdvisory. +// 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\Advisory; + +use Composer\Semver\Constraint\ConstraintInterface; +use Composer\Semver\VersionParser; +use JsonSerializable; + +class PartialSecurityAdvisory implements JsonSerializable +{ + public static function create(string $packageName, array $data, VersionParser $parser): self + { + \ShirabeUnsupportedClass::fail(self::class, 'create'); + } + + public function __construct(string $packageName, string $advisoryId, ConstraintInterface $affectedVersions) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function jsonSerialize() + { + \ShirabeUnsupportedClass::fail(self::class, 'jsonSerialize'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Advisory/SecurityAdvisory.php b/crates/shirabe-php-rpc/php/guards/Composer/Advisory/SecurityAdvisory.php new file mode 100644 index 00000000..69749f77 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Advisory/SecurityAdvisory.php @@ -0,0 +1,30 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Advisory\SecurityAdvisory. +// 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\Advisory; + +use Composer\Semver\Constraint\ConstraintInterface; +use DateTimeImmutable; + +class SecurityAdvisory extends PartialSecurityAdvisory +{ + public function __construct(string $packageName, string $advisoryId, ConstraintInterface $affectedVersions, string $title, array $sources, DateTimeImmutable $reportedAt, ?string $cve = null, ?string $link = null, ?string $severity = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function toIgnoredAdvisory(?string $ignoreReason): IgnoredSecurityAdvisory + { + \ShirabeUnsupportedClass::fail(self::class, 'toIgnoredAdvisory'); + } + + public function jsonSerialize() + { + \ShirabeUnsupportedClass::fail(self::class, 'jsonSerialize'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Autoload/AutoloadGenerator.php b/crates/shirabe-php-rpc/php/guards/Composer/Autoload/AutoloadGenerator.php new file mode 100644 index 00000000..92b6edad --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Autoload/AutoloadGenerator.php @@ -0,0 +1,143 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Autoload\AutoloadGenerator. +// 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\Autoload; + +use Composer\Config; +use Composer\EventDispatcher\EventDispatcher; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface; +use Composer\Installer\InstallationManager; +use Composer\IO\IOInterface; +use Composer\Package\PackageInterface; +use Composer\Package\RootPackageInterface; +use Composer\Repository\InstalledRepositoryInterface; +use Composer\Util\Filesystem; +use Composer\Package\Locker; + +class AutoloadGenerator +{ + public function __construct(EventDispatcher $eventDispatcher, ?IOInterface $io = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function setDevMode(bool $devMode = true) + { + \ShirabeUnsupportedClass::fail(self::class, 'setDevMode'); + } + + public function setClassMapAuthoritative(bool $classMapAuthoritative) + { + \ShirabeUnsupportedClass::fail(self::class, 'setClassMapAuthoritative'); + } + + public function setApcu(bool $apcu, ?string $apcuPrefix = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'setApcu'); + } + + public function setRunScripts(bool $runScripts = true) + { + \ShirabeUnsupportedClass::fail(self::class, 'setRunScripts'); + } + + public function setDryRun(bool $dryRun = true): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setDryRun'); + } + + public function setIgnorePlatformRequirements($ignorePlatformReqs) + { + \ShirabeUnsupportedClass::fail(self::class, 'setIgnorePlatformRequirements'); + } + + public function setPlatformRequirementFilter(PlatformRequirementFilterInterface $platformRequirementFilter) + { + \ShirabeUnsupportedClass::fail(self::class, 'setPlatformRequirementFilter'); + } + + public function dump(Config $config, InstalledRepositoryInterface $localRepo, RootPackageInterface $rootPackage, InstallationManager $installationManager, string $targetDir, bool $scanPsrPackages = false, ?string $suffix = null, ?Locker $locker = null, bool $strictAmbiguous = false) + { + \ShirabeUnsupportedClass::fail(self::class, 'dump'); + } + + public function buildPackageMap(InstallationManager $installationManager, PackageInterface $rootPackage, array $packages) + { + \ShirabeUnsupportedClass::fail(self::class, 'buildPackageMap'); + } + + protected function validatePackage(PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'validatePackage'); + } + + public function parseAutoloads(array $packageMap, PackageInterface $rootPackage, $filteredDevPackages = false) + { + \ShirabeUnsupportedClass::fail(self::class, 'parseAutoloads'); + } + + public function createLoader(array $autoloads, ?string $vendorDir = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'createLoader'); + } + + protected function getIncludePathsFile(array $packageMap, Filesystem $filesystem, string $basePath, string $vendorPath, string $vendorPathCode, string $appBaseDirCode) + { + \ShirabeUnsupportedClass::fail(self::class, 'getIncludePathsFile'); + } + + protected function getIncludeFilesFile(array $files, Filesystem $filesystem, string $basePath, string $vendorPath, string $vendorPathCode, string $appBaseDirCode) + { + \ShirabeUnsupportedClass::fail(self::class, 'getIncludeFilesFile'); + } + + protected function getPathCode(Filesystem $filesystem, string $basePath, string $vendorPath, string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'getPathCode'); + } + + protected function getPlatformCheck(array $packageMap, $checkPlatform, array $devPackageNames) + { + \ShirabeUnsupportedClass::fail(self::class, 'getPlatformCheck'); + } + + protected function getAutoloadFile(string $vendorPathToTargetDirCode, string $suffix) + { + \ShirabeUnsupportedClass::fail(self::class, 'getAutoloadFile'); + } + + protected function getAutoloadRealFile(bool $useClassMap, bool $useIncludePath, ?string $targetDirLoader, bool $useIncludeFiles, string $vendorPathCode, string $appBaseDirCode, string $suffix, bool $useGlobalIncludePath, string $prependAutoloader, bool $checkPlatform) + { + \ShirabeUnsupportedClass::fail(self::class, 'getAutoloadRealFile'); + } + + protected function getStaticFile(string $suffix, string $targetDir, string $vendorPath, string $basePath) + { + \ShirabeUnsupportedClass::fail(self::class, 'getStaticFile'); + } + + protected function parseAutoloadsType(array $packageMap, string $type, RootPackageInterface $rootPackage) + { + \ShirabeUnsupportedClass::fail(self::class, 'parseAutoloadsType'); + } + + protected function getFileIdentifier(PackageInterface $package, string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileIdentifier'); + } + + protected function filterPackageMap(array $packageMap, RootPackageInterface $rootPackage) + { + \ShirabeUnsupportedClass::fail(self::class, 'filterPackageMap'); + } + + protected function sortPackageMap(array $packageMap) + { + \ShirabeUnsupportedClass::fail(self::class, 'sortPackageMap'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Cache.php b/crates/shirabe-php-rpc/php/guards/Composer/Cache.php new file mode 100644 index 00000000..286b262c --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Cache.php @@ -0,0 +1,110 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Cache. +// 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; + +use Composer\IO\IOInterface; +use Composer\Util\Filesystem; + +class Cache +{ + public function __construct(IOInterface $io, string $cacheDir, string $allowlist = 'a-z0-9._', ?Filesystem $filesystem = null, bool $readOnly = false) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function setReadOnly(bool $readOnly) + { + \ShirabeUnsupportedClass::fail(self::class, 'setReadOnly'); + } + + public function isReadOnly() + { + \ShirabeUnsupportedClass::fail(self::class, 'isReadOnly'); + } + + public static function isUsable(string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'isUsable'); + } + + public function isEnabled() + { + \ShirabeUnsupportedClass::fail(self::class, 'isEnabled'); + } + + public function getRoot() + { + \ShirabeUnsupportedClass::fail(self::class, 'getRoot'); + } + + public function read(string $file) + { + \ShirabeUnsupportedClass::fail(self::class, 'read'); + } + + public function write(string $file, string $contents) + { + \ShirabeUnsupportedClass::fail(self::class, 'write'); + } + + public function copyFrom(string $file, string $source) + { + \ShirabeUnsupportedClass::fail(self::class, 'copyFrom'); + } + + public function copyTo(string $file, string $target) + { + \ShirabeUnsupportedClass::fail(self::class, 'copyTo'); + } + + public function gcIsNecessary() + { + \ShirabeUnsupportedClass::fail(self::class, 'gcIsNecessary'); + } + + public function remove(string $file) + { + \ShirabeUnsupportedClass::fail(self::class, 'remove'); + } + + public function clear() + { + \ShirabeUnsupportedClass::fail(self::class, 'clear'); + } + + public function getAge(string $file) + { + \ShirabeUnsupportedClass::fail(self::class, 'getAge'); + } + + public function gc(int $ttl, int $maxSize) + { + \ShirabeUnsupportedClass::fail(self::class, 'gc'); + } + + public function gcVcsCache(int $ttl): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'gcVcsCache'); + } + + public function sha1(string $file) + { + \ShirabeUnsupportedClass::fail(self::class, 'sha1'); + } + + public function sha256(string $file) + { + \ShirabeUnsupportedClass::fail(self::class, 'sha256'); + } + + protected function getFinder() + { + \ShirabeUnsupportedClass::fail(self::class, 'getFinder'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Compiler.php b/crates/shirabe-php-rpc/php/guards/Composer/Compiler.php new file mode 100644 index 00000000..ba4ddff4 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Compiler.php @@ -0,0 +1,22 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Compiler. +// 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; + +class Compiler +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function compile(string $pharFile = 'composer.phar'): void + { + \ShirabeUnsupportedClass::fail(self::class, 'compile'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Config/JsonConfigSource.php b/crates/shirabe-php-rpc/php/guards/Composer/Config/JsonConfigSource.php new file mode 100644 index 00000000..ce71cc7e --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Config/JsonConfigSource.php @@ -0,0 +1,74 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Config\JsonConfigSource. +// 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\Config; + +use Composer\Json\JsonFile; + +class JsonConfigSource implements ConfigSourceInterface +{ + public function __construct(JsonFile $file, bool $authConfig = false) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getName'); + } + + public function addRepository(string $name, $config, bool $append = true): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addRepository'); + } + + public function insertRepository(string $name, $config, string $referenceName, int $offset = 0): void + { + \ShirabeUnsupportedClass::fail(self::class, 'insertRepository'); + } + + public function setRepositoryUrl(string $name, string $url): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setRepositoryUrl'); + } + + public function removeRepository(string $name): void + { + \ShirabeUnsupportedClass::fail(self::class, 'removeRepository'); + } + + public function addConfigSetting(string $name, $value): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addConfigSetting'); + } + + public function removeConfigSetting(string $name): void + { + \ShirabeUnsupportedClass::fail(self::class, 'removeConfigSetting'); + } + + public function addProperty(string $name, $value): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addProperty'); + } + + public function removeProperty(string $name): void + { + \ShirabeUnsupportedClass::fail(self::class, 'removeProperty'); + } + + public function addLink(string $type, string $name, string $value): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addLink'); + } + + public function removeLink(string $type, string $name): void + { + \ShirabeUnsupportedClass::fail(self::class, 'removeLink'); + } +} 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'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/FileDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/FileDownloader.php new file mode 100644 index 00000000..0232b002 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/FileDownloader.php @@ -0,0 +1,105 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\FileDownloader. +// 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\Downloader; + +use Composer\Config; +use Composer\Cache; +use Composer\IO\IOInterface; +use Composer\Package\PackageInterface; +use Composer\EventDispatcher\EventDispatcher; +use Composer\Util\Filesystem; +use Composer\Util\HttpDownloader; +use Composer\Util\ProcessExecutor; +use React\Promise\PromiseInterface; + +class FileDownloader implements DownloaderInterface, ChangeReportInterface +{ + public static $downloadMetadata = []; + public static $responseHeaders = []; + + public function __construct(IOInterface $io, Config $config, HttpDownloader $httpDownloader, ?EventDispatcher $eventDispatcher = null, ?Cache $cache = null, ?Filesystem $filesystem = null, ?ProcessExecutor $process = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getInstallationSource(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallationSource'); + } + + public function download(PackageInterface $package, string $path, ?PackageInterface $prevPackage = null, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + protected function getDistPath(PackageInterface $package, int $component): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getDistPath'); + } + + protected function clearLastCacheWrite(PackageInterface $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'clearLastCacheWrite'); + } + + protected function addCleanupPath(PackageInterface $package, string $path): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addCleanupPath'); + } + + protected function removeCleanupPath(PackageInterface $package, string $path): void + { + \ShirabeUnsupportedClass::fail(self::class, 'removeCleanupPath'); + } + + public function update(PackageInterface $initial, PackageInterface $target, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'update'); + } + + public function remove(PackageInterface $package, string $path, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'remove'); + } + + protected function getFileName(PackageInterface $package, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileName'); + } + + protected function getInstallOperationAppendix(PackageInterface $package, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallOperationAppendix'); + } + + protected function processUrl(PackageInterface $package, string $url): string + { + \ShirabeUnsupportedClass::fail(self::class, 'processUrl'); + } + + public function getLocalChanges(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getLocalChanges'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/FossilDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/FossilDownloader.php new file mode 100644 index 00000000..1990705e --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/FossilDownloader.php @@ -0,0 +1,100 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\FossilDownloader. +// 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\Downloader; + +use React\Promise\PromiseInterface; +use Composer\Package\PackageInterface; + +class FossilDownloader extends VcsDownloader +{ + protected function doDownload(PackageInterface $package, string $path, string $url, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doDownload'); + } + + protected function doInstall(PackageInterface $package, string $path, string $url): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doInstall'); + } + + protected function doUpdate(PackageInterface $initial, PackageInterface $target, string $path, string $url): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doUpdate'); + } + + public function getLocalChanges(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getLocalChanges'); + } + + protected function getCommitLogs(string $fromReference, string $toReference, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getCommitLogs'); + } + + protected function hasMetadataRepository(string $path): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasMetadataRepository'); + } + + public function __construct(IOInterface $io, Config $config, ?ProcessExecutor $process = null, ?Filesystem $fs = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getInstallationSource(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallationSource'); + } + + public function download(PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + public function update(PackageInterface $initial, PackageInterface $target, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'update'); + } + + public function remove(PackageInterface $package, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'remove'); + } + + public function getVcsReference(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getVcsReference'); + } + + protected function cleanChanges(PackageInterface $package, string $path, bool $update): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanChanges'); + } + + protected function reapplyChanges(string $path): void + { + \ShirabeUnsupportedClass::fail(self::class, 'reapplyChanges'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/GitDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/GitDownloader.php new file mode 100644 index 00000000..3ab711fb --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/GitDownloader.php @@ -0,0 +1,149 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\GitDownloader. +// 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\Downloader; + +use Composer\Config; +use Composer\IO\IOInterface; +use Composer\Package\PackageInterface; +use Composer\Util\Filesystem; +use Composer\Util\ProcessExecutor; +use React\Promise\PromiseInterface; + +class GitDownloader extends VcsDownloader implements DvcsDownloaderInterface +{ + public function __construct(IOInterface $io, Config $config, ?ProcessExecutor $process = null, ?Filesystem $fs = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + protected function doDownload(PackageInterface $package, string $path, string $url, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doDownload'); + } + + protected function doInstall(PackageInterface $package, string $path, string $url): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doInstall'); + } + + protected function doUpdate(PackageInterface $initial, PackageInterface $target, string $path, string $url): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doUpdate'); + } + + public function getLocalChanges(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getLocalChanges'); + } + + public function getUnpushedChanges(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUnpushedChanges'); + } + + protected function cleanChanges(PackageInterface $package, string $path, bool $update): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanChanges'); + } + + protected function reapplyChanges(string $path): void + { + \ShirabeUnsupportedClass::fail(self::class, 'reapplyChanges'); + } + + protected function updateToCommit(PackageInterface $package, string $path, string $reference, string $prettyVersion): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'updateToCommit'); + } + + protected function updateOriginUrl(string $path, string $url): void + { + \ShirabeUnsupportedClass::fail(self::class, 'updateOriginUrl'); + } + + protected function setPushUrl(string $path, string $url): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setPushUrl'); + } + + protected function getCommitLogs(string $fromReference, string $toReference, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getCommitLogs'); + } + + protected function discardChanges(string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'discardChanges'); + } + + protected function stashChanges(string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'stashChanges'); + } + + protected function viewDiff(string $path): void + { + \ShirabeUnsupportedClass::fail(self::class, 'viewDiff'); + } + + protected function normalizePath(string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'normalizePath'); + } + + protected function hasMetadataRepository(string $path): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasMetadataRepository'); + } + + protected function getShortHash(string $reference): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getShortHash'); + } + + public function getInstallationSource(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallationSource'); + } + + public function download(PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + public function update(PackageInterface $initial, PackageInterface $target, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'update'); + } + + public function remove(PackageInterface $package, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'remove'); + } + + public function getVcsReference(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getVcsReference'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/GzipDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/GzipDownloader.php new file mode 100644 index 00000000..df6da1d5 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/GzipDownloader.php @@ -0,0 +1,45 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\GzipDownloader. +// 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\Downloader; + +use React\Promise\PromiseInterface; +use Composer\Package\PackageInterface; + +class GzipDownloader extends ArchiveDownloader +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + protected function extract(PackageInterface $package, string $file, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'extract'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + protected function getInstallOperationAppendix(PackageInterface $package, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallOperationAppendix'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/HgDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/HgDownloader.php new file mode 100644 index 00000000..24abe7d2 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/HgDownloader.php @@ -0,0 +1,100 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\HgDownloader. +// 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\Downloader; + +use React\Promise\PromiseInterface; +use Composer\Package\PackageInterface; + +class HgDownloader extends VcsDownloader +{ + protected function doDownload(PackageInterface $package, string $path, string $url, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doDownload'); + } + + protected function doInstall(PackageInterface $package, string $path, string $url): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doInstall'); + } + + protected function doUpdate(PackageInterface $initial, PackageInterface $target, string $path, string $url): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doUpdate'); + } + + public function getLocalChanges(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getLocalChanges'); + } + + protected function getCommitLogs(string $fromReference, string $toReference, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getCommitLogs'); + } + + protected function hasMetadataRepository(string $path): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasMetadataRepository'); + } + + public function __construct(IOInterface $io, Config $config, ?ProcessExecutor $process = null, ?Filesystem $fs = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getInstallationSource(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallationSource'); + } + + public function download(PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + public function update(PackageInterface $initial, PackageInterface $target, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'update'); + } + + public function remove(PackageInterface $package, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'remove'); + } + + public function getVcsReference(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getVcsReference'); + } + + protected function cleanChanges(PackageInterface $package, string $path, bool $update): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanChanges'); + } + + protected function reapplyChanges(string $path): void + { + \ShirabeUnsupportedClass::fail(self::class, 'reapplyChanges'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/PathDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/PathDownloader.php new file mode 100644 index 00000000..f565b3c4 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/PathDownloader.php @@ -0,0 +1,48 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\PathDownloader. +// 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\Downloader; + +use React\Promise\PromiseInterface; +use Composer\Package\PackageInterface; + +class PathDownloader extends FileDownloader implements VcsCapableDownloaderInterface +{ + private const STRATEGY_SYMLINK = 10; + private const STRATEGY_MIRROR = 20; + + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function download(PackageInterface $package, string $path, ?PackageInterface $prevPackage = null, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function install(PackageInterface $package, string $path, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + public function remove(PackageInterface $package, string $path, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'remove'); + } + + public function getVcsReference(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getVcsReference'); + } + + protected function getInstallOperationAppendix(PackageInterface $package, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallOperationAppendix'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/PerforceDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/PerforceDownloader.php new file mode 100644 index 00000000..91eb45cf --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/PerforceDownloader.php @@ -0,0 +1,111 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\PerforceDownloader. +// 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\Downloader; + +use React\Promise\PromiseInterface; +use Composer\Package\PackageInterface; +use Composer\Util\Perforce; + +class PerforceDownloader extends VcsDownloader +{ + protected function doDownload(PackageInterface $package, string $path, string $url, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doDownload'); + } + + public function doInstall(PackageInterface $package, string $path, string $url): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doInstall'); + } + + public function initPerforce(PackageInterface $package, string $path, string $url): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initPerforce'); + } + + protected function doUpdate(PackageInterface $initial, PackageInterface $target, string $path, string $url): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doUpdate'); + } + + public function getLocalChanges(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getLocalChanges'); + } + + protected function getCommitLogs(string $fromReference, string $toReference, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getCommitLogs'); + } + + public function setPerforce(Perforce $perforce): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setPerforce'); + } + + protected function hasMetadataRepository(string $path): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasMetadataRepository'); + } + + public function __construct(IOInterface $io, Config $config, ?ProcessExecutor $process = null, ?Filesystem $fs = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getInstallationSource(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallationSource'); + } + + public function download(PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + public function update(PackageInterface $initial, PackageInterface $target, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'update'); + } + + public function remove(PackageInterface $package, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'remove'); + } + + public function getVcsReference(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getVcsReference'); + } + + protected function cleanChanges(PackageInterface $package, string $path, bool $update): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanChanges'); + } + + protected function reapplyChanges(string $path): void + { + \ShirabeUnsupportedClass::fail(self::class, 'reapplyChanges'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/PharDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/PharDownloader.php new file mode 100644 index 00000000..84314215 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/PharDownloader.php @@ -0,0 +1,45 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\PharDownloader. +// 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\Downloader; + +use React\Promise\PromiseInterface; +use Composer\Package\PackageInterface; + +class PharDownloader extends ArchiveDownloader +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + protected function extract(PackageInterface $package, string $file, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'extract'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + protected function getInstallOperationAppendix(PackageInterface $package, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallOperationAppendix'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/RarDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/RarDownloader.php new file mode 100644 index 00000000..74dbfa9f --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/RarDownloader.php @@ -0,0 +1,45 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\RarDownloader. +// 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\Downloader; + +use React\Promise\PromiseInterface; +use Composer\Package\PackageInterface; + +class RarDownloader extends ArchiveDownloader +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + protected function extract(PackageInterface $package, string $file, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'extract'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + protected function getInstallOperationAppendix(PackageInterface $package, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallOperationAppendix'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/SvnDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/SvnDownloader.php new file mode 100644 index 00000000..9e776766 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/SvnDownloader.php @@ -0,0 +1,110 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\SvnDownloader. +// 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\Downloader; + +use Composer\Package\PackageInterface; +use React\Promise\PromiseInterface; + +class SvnDownloader extends VcsDownloader +{ + protected function doDownload(PackageInterface $package, string $path, string $url, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doDownload'); + } + + protected function doInstall(PackageInterface $package, string $path, string $url): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doInstall'); + } + + protected function doUpdate(PackageInterface $initial, PackageInterface $target, string $path, string $url): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'doUpdate'); + } + + public function getLocalChanges(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getLocalChanges'); + } + + protected function execute(PackageInterface $package, string $baseUrl, array $command, string $url, ?string $cwd = null, ?string $path = null): string + { + \ShirabeUnsupportedClass::fail(self::class, 'execute'); + } + + protected function cleanChanges(PackageInterface $package, string $path, bool $update): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanChanges'); + } + + protected function getCommitLogs(string $fromReference, string $toReference, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getCommitLogs'); + } + + protected function discardChanges(string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'discardChanges'); + } + + protected function hasMetadataRepository(string $path): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasMetadataRepository'); + } + + public function __construct(IOInterface $io, Config $config, ?ProcessExecutor $process = null, ?Filesystem $fs = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getInstallationSource(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallationSource'); + } + + public function download(PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + public function update(PackageInterface $initial, PackageInterface $target, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'update'); + } + + public function remove(PackageInterface $package, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'remove'); + } + + public function getVcsReference(PackageInterface $package, string $path): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getVcsReference'); + } + + protected function reapplyChanges(string $path): void + { + \ShirabeUnsupportedClass::fail(self::class, 'reapplyChanges'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/TarDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/TarDownloader.php new file mode 100644 index 00000000..755f6b24 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/TarDownloader.php @@ -0,0 +1,45 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\TarDownloader. +// 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\Downloader; + +use Composer\Package\PackageInterface; +use React\Promise\PromiseInterface; + +class TarDownloader extends ArchiveDownloader +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + protected function extract(PackageInterface $package, string $file, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'extract'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + protected function getInstallOperationAppendix(PackageInterface $package, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallOperationAppendix'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/XzDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/XzDownloader.php new file mode 100644 index 00000000..8a76e994 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/XzDownloader.php @@ -0,0 +1,45 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\XzDownloader. +// 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\Downloader; + +use React\Promise\PromiseInterface; +use Composer\Package\PackageInterface; + +class XzDownloader extends ArchiveDownloader +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + protected function extract(PackageInterface $package, string $file, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'extract'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + protected function getInstallOperationAppendix(PackageInterface $package, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallOperationAppendix'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Downloader/ZipDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/ZipDownloader.php new file mode 100644 index 00000000..6fda26a5 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Downloader/ZipDownloader.php @@ -0,0 +1,55 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Downloader\ZipDownloader. +// 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\Downloader; + +use Composer\Package\PackageInterface; +use React\Promise\PromiseInterface; + +class ZipDownloader extends ArchiveDownloader +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function download(PackageInterface $package, string $path, ?PackageInterface $prevPackage = null, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + protected function extract(PackageInterface $package, string $file, string $path): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'extract'); + } + + protected function getErrorMessage(int $retval, string $file): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getErrorMessage'); + } + + public function prepare(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup(string $type, PackageInterface $package, string $path, ?PackageInterface $prevPackage = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(PackageInterface $package, string $path, bool $output = true): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + protected function getInstallOperationAppendix(PackageInterface $package, string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallOperationAppendix'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Factory.php b/crates/shirabe-php-rpc/php/guards/Composer/Factory.php new file mode 100644 index 00000000..3edad509 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Factory.php @@ -0,0 +1,134 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Factory. +// 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; + +use Composer\IO\IOInterface; +use Composer\Package\Version\VersionGuesser; +use Composer\Package\RootPackageInterface; +use Composer\Repository\RepositoryManager; +use Composer\Util\ProcessExecutor; +use Composer\Util\HttpDownloader; +use Composer\Util\Loop; +use Symfony\Component\Console\Output\ConsoleOutput; +use Composer\EventDispatcher\EventDispatcher; +use Composer\Package\Version\VersionParser; +use Composer\Repository\InstalledRepositoryInterface; + +class Factory +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + protected static function getHomeDir(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getHomeDir'); + } + + protected static function getCacheDir(string $home): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getCacheDir'); + } + + protected static function getDataDir(string $home): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getDataDir'); + } + + public static function createConfig(?IOInterface $io = null, ?string $cwd = null): Config + { + \ShirabeUnsupportedClass::fail(self::class, 'createConfig'); + } + + public static function getComposerFile(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerFile'); + } + + public static function getLockFile(string $composerFile): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getLockFile'); + } + + public static function createAdditionalStyles(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'createAdditionalStyles'); + } + + public static function createOutput(): ConsoleOutput + { + \ShirabeUnsupportedClass::fail(self::class, 'createOutput'); + } + + public function createComposer(IOInterface $io, $localConfig = null, $disablePlugins = false, ?string $cwd = null, bool $fullLoad = true, bool $disableScripts = false) + { + \ShirabeUnsupportedClass::fail(self::class, 'createComposer'); + } + + public static function createGlobal(IOInterface $io, bool $disablePlugins = false, bool $disableScripts = false): ?Composer + { + \ShirabeUnsupportedClass::fail(self::class, 'createGlobal'); + } + + protected function addLocalRepository(IOInterface $io, RepositoryManager $rm, string $vendorDir, RootPackageInterface $rootPackage, ?ProcessExecutor $process = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addLocalRepository'); + } + + protected function createGlobalComposer(IOInterface $io, Config $config, $disablePlugins, bool $disableScripts, bool $fullLoad = false): ?PartialComposer + { + \ShirabeUnsupportedClass::fail(self::class, 'createGlobalComposer'); + } + + public function createDownloadManager(IOInterface $io, Config $config, HttpDownloader $httpDownloader, ProcessExecutor $process, ?EventDispatcher $eventDispatcher = null): \Composer\Downloader\DownloadManager + { + \ShirabeUnsupportedClass::fail(self::class, 'createDownloadManager'); + } + + public function createArchiveManager(Config $config, \Composer\Downloader\DownloadManager $dm, Loop $loop) + { + \ShirabeUnsupportedClass::fail(self::class, 'createArchiveManager'); + } + + protected function createPluginManager(IOInterface $io, Composer $composer, ?PartialComposer $globalComposer = null, $disablePlugins = false): \Composer\Plugin\PluginManager + { + \ShirabeUnsupportedClass::fail(self::class, 'createPluginManager'); + } + + public function createInstallationManager(Loop $loop, IOInterface $io, ?EventDispatcher $eventDispatcher = null): \Composer\Installer\InstallationManager + { + \ShirabeUnsupportedClass::fail(self::class, 'createInstallationManager'); + } + + protected function createDefaultInstallers(\Composer\Installer\InstallationManager $im, PartialComposer $composer, IOInterface $io, ?ProcessExecutor $process = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'createDefaultInstallers'); + } + + protected function purgePackages(InstalledRepositoryInterface $repo, \Composer\Installer\InstallationManager $im): void + { + \ShirabeUnsupportedClass::fail(self::class, 'purgePackages'); + } + + protected function loadRootPackage(RepositoryManager $rm, Config $config, VersionParser $parser, VersionGuesser $guesser, IOInterface $io): \Composer\Package\Loader\RootPackageLoader + { + \ShirabeUnsupportedClass::fail(self::class, 'loadRootPackage'); + } + + public static function create(IOInterface $io, $config = null, $disablePlugins = false, bool $disableScripts = false): Composer + { + \ShirabeUnsupportedClass::fail(self::class, 'create'); + } + + public static function createHttpDownloader(IOInterface $io, Config $config, array $options = []): HttpDownloader + { + \ShirabeUnsupportedClass::fail(self::class, 'createHttpDownloader'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php b/crates/shirabe-php-rpc/php/guards/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php new file mode 100644 index 00000000..b4288ecf --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Filter/PlatformRequirementFilter/IgnoreListPlatformRequirementFilter.php @@ -0,0 +1,34 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Filter\PlatformRequirementFilter\IgnoreListPlatformRequirementFilter. +// 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\Filter\PlatformRequirementFilter; + +use Composer\Semver\Constraint\ConstraintInterface; + +final class IgnoreListPlatformRequirementFilter implements PlatformRequirementFilterInterface +{ + public function __construct(array $reqList) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function isIgnored(string $req): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isIgnored'); + } + + public function isUpperBoundIgnored(string $req): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isUpperBoundIgnored'); + } + + public function filterConstraint(string $req, ConstraintInterface $constraint, bool $allowUpperBoundOverride = true): ConstraintInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'filterConstraint'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Installer.php b/crates/shirabe-php-rpc/php/guards/Composer/Installer.php new file mode 100644 index 00000000..7197f97c --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Installer.php @@ -0,0 +1,253 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Installer. +// 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; + +use Composer\Advisory\AuditConfig; +use Composer\Autoload\AutoloadGenerator; +use Composer\DependencyResolver\LockTransaction; +use Composer\DependencyResolver\PolicyInterface; +use Composer\Downloader\DownloadManager; +use Composer\EventDispatcher\EventDispatcher; +use Composer\Filter\PlatformRequirementFilter\PlatformRequirementFilterInterface; +use Composer\Installer\InstallationManager; +use Composer\Installer\SuggestedPackagesReporter; +use Composer\IO\IOInterface; +use Composer\Package\Locker; +use Composer\Package\RootPackageInterface; +use Composer\Repository\InstalledRepositoryInterface; +use Composer\Repository\PlatformRepository; +use Composer\Repository\RepositoryInterface; +use Composer\Repository\RepositoryManager; +use Composer\Repository\LockArrayRepository; + +class Installer +{ + public const ERROR_NONE = 0; // no error/success state + public const ERROR_GENERIC_FAILURE = 1; + public const ERROR_NO_LOCK_FILE_FOR_PARTIAL_UPDATE = 3; + public const ERROR_LOCK_FILE_INVALID = 4; + public const ERROR_DEPENDENCY_RESOLUTION_FAILED = 2; + public const ERROR_AUDIT_FAILED = 5; + public const ERROR_TRANSPORT_EXCEPTION = 100; + + public function __construct(IOInterface $io, Config $config, RootPackageInterface $package, DownloadManager $downloadManager, RepositoryManager $repositoryManager, Locker $locker, InstallationManager $installationManager, EventDispatcher $eventDispatcher, AutoloadGenerator $autoloadGenerator) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function run(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'run'); + } + + protected function doUpdate(InstalledRepositoryInterface $localRepo, bool $doInstall): int + { + \ShirabeUnsupportedClass::fail(self::class, 'doUpdate'); + } + + protected function extractDevPackages(LockTransaction $lockTransaction, PlatformRepository $platformRepo, array $aliases, PolicyInterface $policy, ?LockArrayRepository $lockedRepository = null): int + { + \ShirabeUnsupportedClass::fail(self::class, 'extractDevPackages'); + } + + protected function doInstall(InstalledRepositoryInterface $localRepo, bool $alreadySolved = false): int + { + \ShirabeUnsupportedClass::fail(self::class, 'doInstall'); + } + + protected function createPlatformRepo(bool $forUpdate): PlatformRepository + { + \ShirabeUnsupportedClass::fail(self::class, 'createPlatformRepo'); + } + + public static function create(IOInterface $io, Composer $composer): self + { + \ShirabeUnsupportedClass::fail(self::class, 'create'); + } + + public function setIgnoredTypes(array $types): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setIgnoredTypes'); + } + + public function setAllowedTypes(?array $types): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setAllowedTypes'); + } + + public function setAdditionalFixedRepository(RepositoryInterface $additionalFixedRepository): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setAdditionalFixedRepository'); + } + + public function setTemporaryConstraints(array $constraints): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setTemporaryConstraints'); + } + + public function setDryRun(bool $dryRun = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setDryRun'); + } + + public function isDryRun(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isDryRun'); + } + + public function setDownloadOnly(bool $downloadOnly = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setDownloadOnly'); + } + + public function setPreferSource(bool $preferSource = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setPreferSource'); + } + + public function setPreferDist(bool $preferDist = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setPreferDist'); + } + + public function setOptimizeAutoloader(bool $optimizeAutoloader): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setOptimizeAutoloader'); + } + + public function setClassMapAuthoritative(bool $classMapAuthoritative): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setClassMapAuthoritative'); + } + + public function setApcuAutoloader(bool $apcuAutoloader, ?string $apcuAutoloaderPrefix = null): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setApcuAutoloader'); + } + + public function setUpdate(bool $update): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setUpdate'); + } + + public function setInstall(bool $install): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setInstall'); + } + + public function setDevMode(bool $devMode = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setDevMode'); + } + + public function setDumpAutoloader(bool $dumpAutoloader = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setDumpAutoloader'); + } + + public function setRunScripts(bool $runScripts = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setRunScripts'); + } + + public function setConfig(Config $config): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setConfig'); + } + + public function setVerbose(bool $verbose = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setVerbose'); + } + + public function isVerbose(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isVerbose'); + } + + public function setIgnorePlatformRequirements($ignorePlatformReqs): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setIgnorePlatformRequirements'); + } + + public function setPlatformRequirementFilter(PlatformRequirementFilterInterface $platformRequirementFilter): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setPlatformRequirementFilter'); + } + + public function setUpdateMirrors(bool $updateMirrors): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setUpdateMirrors'); + } + + public function setUpdateAllowList(array $packages): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setUpdateAllowList'); + } + + public function setUpdateAllowTransitiveDependencies(int $updateAllowTransitiveDependencies): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setUpdateAllowTransitiveDependencies'); + } + + public function setPreferStable(bool $preferStable = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setPreferStable'); + } + + public function setPreferLowest(bool $preferLowest = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setPreferLowest'); + } + + public function setMinimalUpdate(bool $minimalUpdate = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setMinimalUpdate'); + } + + public function setWriteLock(bool $writeLock = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setWriteLock'); + } + + public function setExecuteOperations(bool $executeOperations = true): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setExecuteOperations'); + } + + public function setAudit(bool $audit): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setAudit'); + } + + public function setErrorOnAudit(bool $errorOnAudit): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setErrorOnAudit'); + } + + public function setAuditFormat(string $auditFormat): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setAuditFormat'); + } + + public function setAuditConfig(AuditConfig $auditConfig): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setAuditConfig'); + } + + public function disablePlugins(): self + { + \ShirabeUnsupportedClass::fail(self::class, 'disablePlugins'); + } + + public function setSuggestedPackagesReporter(SuggestedPackagesReporter $suggestedPackagesReporter): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setSuggestedPackagesReporter'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Installer/BinaryInstaller.php b/crates/shirabe-php-rpc/php/guards/Composer/Installer/BinaryInstaller.php new file mode 100644 index 00000000..084ba3ff --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Installer/BinaryInstaller.php @@ -0,0 +1,66 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Installer\BinaryInstaller. +// 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\Installer; + +use Composer\IO\IOInterface; +use Composer\Package\PackageInterface; +use Composer\Util\Filesystem; + +class BinaryInstaller +{ + public function __construct(IOInterface $io, string $binDir, string $binCompat, ?Filesystem $filesystem = null, ?string $vendorDir = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function installBinaries(PackageInterface $package, string $installPath, bool $warnOnOverwrite = true): void + { + \ShirabeUnsupportedClass::fail(self::class, 'installBinaries'); + } + + public function removeBinaries(PackageInterface $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'removeBinaries'); + } + + public static function determineBinaryCaller(string $bin): string + { + \ShirabeUnsupportedClass::fail(self::class, 'determineBinaryCaller'); + } + + protected function getBinaries(PackageInterface $package): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBinaries'); + } + + protected function installFullBinaries(string $binPath, string $link, string $bin, PackageInterface $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'installFullBinaries'); + } + + protected function installUnixyProxyBinaries(string $binPath, string $link): void + { + \ShirabeUnsupportedClass::fail(self::class, 'installUnixyProxyBinaries'); + } + + protected function initializeBinDir(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initializeBinDir'); + } + + protected function generateWindowsProxyCode(string $bin, string $link): string + { + \ShirabeUnsupportedClass::fail(self::class, 'generateWindowsProxyCode'); + } + + protected function generateUnixyProxyCode(string $bin, string $link): string + { + \ShirabeUnsupportedClass::fail(self::class, 'generateUnixyProxyCode'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Installer/InstallerEvent.php b/crates/shirabe-php-rpc/php/guards/Composer/Installer/InstallerEvent.php new file mode 100644 index 00000000..f35bbccc --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Installer/InstallerEvent.php @@ -0,0 +1,47 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Installer\InstallerEvent. +// 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\Installer; + +use Composer\Composer; +use Composer\DependencyResolver\Transaction; +use Composer\EventDispatcher\Event; +use Composer\IO\IOInterface; + +class InstallerEvent extends Event +{ + public function __construct(string $eventName, Composer $composer, IOInterface $io, bool $devMode, bool $executeOperations, Transaction $transaction) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getComposer(): Composer + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposer'); + } + + public function getIO(): IOInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'getIO'); + } + + public function isDevMode(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isDevMode'); + } + + public function isExecutingOperations(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isExecutingOperations'); + } + + public function getTransaction(): ?Transaction + { + \ShirabeUnsupportedClass::fail(self::class, 'getTransaction'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Installer/LibraryInstaller.php b/crates/shirabe-php-rpc/php/guards/Composer/Installer/LibraryInstaller.php new file mode 100644 index 00000000..81d4a1fe --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Installer/LibraryInstaller.php @@ -0,0 +1,104 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Installer\LibraryInstaller. +// 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\Installer; + +use Composer\IO\IOInterface; +use Composer\PartialComposer; +use Composer\Repository\InstalledRepositoryInterface; +use Composer\Package\PackageInterface; +use Composer\Util\Filesystem; +use Composer\Downloader\DownloadManager; + +class LibraryInstaller implements InstallerInterface, BinaryPresenceInterface +{ + public function __construct(IOInterface $io, PartialComposer $composer, ?string $type = 'library', ?Filesystem $filesystem = null, ?BinaryInstaller $binaryInstaller = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function supports(string $packageType) + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'isInstalled'); + } + + public function download(PackageInterface $package, ?PackageInterface $prevPackage = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function prepare($type, PackageInterface $package, ?PackageInterface $prevPackage = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup($type, PackageInterface $package, ?PackageInterface $prevPackage = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(InstalledRepositoryInterface $repo, PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) + { + \ShirabeUnsupportedClass::fail(self::class, 'update'); + } + + public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'uninstall'); + } + + public function getInstallPath(PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallPath'); + } + + public function ensureBinariesPresence(PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'ensureBinariesPresence'); + } + + protected function getPackageBasePath(PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackageBasePath'); + } + + protected function installCode(PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'installCode'); + } + + protected function updateCode(PackageInterface $initial, PackageInterface $target) + { + \ShirabeUnsupportedClass::fail(self::class, 'updateCode'); + } + + protected function removeCode(PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'removeCode'); + } + + protected function initializeVendorDir() + { + \ShirabeUnsupportedClass::fail(self::class, 'initializeVendorDir'); + } + + protected function getDownloadManager(): DownloadManager + { + \ShirabeUnsupportedClass::fail(self::class, 'getDownloadManager'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Installer/MetapackageInstaller.php b/crates/shirabe-php-rpc/php/guards/Composer/Installer/MetapackageInstaller.php new file mode 100644 index 00000000..fbaeaeb3 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Installer/MetapackageInstaller.php @@ -0,0 +1,66 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Installer\MetapackageInstaller. +// 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\Installer; + +use Composer\Repository\InstalledRepositoryInterface; +use Composer\Package\PackageInterface; +use Composer\IO\IOInterface; + +class MetapackageInstaller implements InstallerInterface +{ + public function __construct(IOInterface $io) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function supports(string $packageType) + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'isInstalled'); + } + + public function download(PackageInterface $package, ?PackageInterface $prevPackage = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function prepare($type, PackageInterface $package, ?PackageInterface $prevPackage = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup($type, PackageInterface $package, ?PackageInterface $prevPackage = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(InstalledRepositoryInterface $repo, PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) + { + \ShirabeUnsupportedClass::fail(self::class, 'update'); + } + + public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'uninstall'); + } + + public function getInstallPath(PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallPath'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Installer/PluginInstaller.php b/crates/shirabe-php-rpc/php/guards/Composer/Installer/PluginInstaller.php new file mode 100644 index 00000000..dc09803b --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Installer/PluginInstaller.php @@ -0,0 +1,64 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Installer\PluginInstaller. +// 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\Installer; + +use Composer\IO\IOInterface; +use Composer\PartialComposer; +use Composer\Repository\InstalledRepositoryInterface; +use Composer\Package\PackageInterface; +use Composer\Plugin\PluginManager; +use Composer\Util\Filesystem; + +class PluginInstaller extends LibraryInstaller +{ + public function __construct(IOInterface $io, PartialComposer $composer, ?Filesystem $fs = null, ?BinaryInstaller $binaryInstaller = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function supports(string $packageType) + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + public function disablePlugins(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'disablePlugins'); + } + + public function prepare($type, PackageInterface $package, ?PackageInterface $prevPackage = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function download(PackageInterface $package, ?PackageInterface $prevPackage = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function install(InstalledRepositoryInterface $repo, PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target) + { + \ShirabeUnsupportedClass::fail(self::class, 'update'); + } + + public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'uninstall'); + } + + protected function getPluginManager(): PluginManager + { + \ShirabeUnsupportedClass::fail(self::class, 'getPluginManager'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Installer/ProjectInstaller.php b/crates/shirabe-php-rpc/php/guards/Composer/Installer/ProjectInstaller.php new file mode 100644 index 00000000..50c7792e --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Installer/ProjectInstaller.php @@ -0,0 +1,68 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Installer\ProjectInstaller. +// 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\Installer; + +use React\Promise\PromiseInterface; +use Composer\Package\PackageInterface; +use Composer\Downloader\DownloadManager; +use Composer\Repository\InstalledRepositoryInterface; +use Composer\Util\Filesystem; + +class ProjectInstaller implements InstallerInterface +{ + public function __construct(string $installPath, DownloadManager $dm, Filesystem $fs) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function supports(string $packageType): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isInstalled'); + } + + public function download(PackageInterface $package, ?PackageInterface $prevPackage = null): ?PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function prepare($type, PackageInterface $package, ?PackageInterface $prevPackage = null): ?PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'prepare'); + } + + public function cleanup($type, PackageInterface $package, ?PackageInterface $prevPackage = null): ?PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function install(InstalledRepositoryInterface $repo, PackageInterface $package): ?PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'install'); + } + + public function update(InstalledRepositoryInterface $repo, PackageInterface $initial, PackageInterface $target): ?PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'update'); + } + + public function uninstall(InstalledRepositoryInterface $repo, PackageInterface $package): ?PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'uninstall'); + } + + public function getInstallPath(PackageInterface $package): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getInstallPath'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Json/JsonFile.php b/crates/shirabe-php-rpc/php/guards/Composer/Json/JsonFile.php new file mode 100644 index 00000000..f61af348 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Json/JsonFile.php @@ -0,0 +1,81 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Json\JsonFile. +// 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\Json; + +use Composer\Util\HttpDownloader; +use Composer\IO\IOInterface; + +class JsonFile +{ + public const LAX_SCHEMA = 1; + public const STRICT_SCHEMA = 2; + public const AUTH_SCHEMA = 3; + public const LOCK_SCHEMA = 4; + public const JSON_UNESCAPED_SLASHES = 64; + public const JSON_PRETTY_PRINT = 128; + public const JSON_UNESCAPED_UNICODE = 256; + public const COMPOSER_SCHEMA_PATH = __DIR__ . '/../../../res/composer-schema.json'; + public const LOCK_SCHEMA_PATH = __DIR__ . '/../../../res/composer-lock-schema.json'; + public const INDENT_DEFAULT = ' '; + + public function __construct(string $path, ?HttpDownloader $httpDownloader = null, ?IOInterface $io = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getPath(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPath'); + } + + public function exists(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'exists'); + } + + public function read() + { + \ShirabeUnsupportedClass::fail(self::class, 'read'); + } + + public function write(array $hash, int $options = JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) + { + \ShirabeUnsupportedClass::fail(self::class, 'write'); + } + + public function validateSchema(int $schema = self::STRICT_SCHEMA, ?string $schemaFile = null): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'validateSchema'); + } + + public static function validateJsonSchema(string $source, $data, int $schema, ?string $schemaFile = null): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'validateJsonSchema'); + } + + public static function encode($data, int $options = \JSON_UNESCAPED_SLASHES | \JSON_PRETTY_PRINT | \JSON_UNESCAPED_UNICODE, string $indent = self::INDENT_DEFAULT): string + { + \ShirabeUnsupportedClass::fail(self::class, 'encode'); + } + + public static function parseJson(?string $json, ?string $file = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'parseJson'); + } + + protected static function validateSyntax(string $json, ?string $file = null): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'validateSyntax'); + } + + public static function detectIndenting(?string $json): string + { + \ShirabeUnsupportedClass::fail(self::class, 'detectIndenting'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/ArchivableFilesFinder.php b/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/ArchivableFilesFinder.php new file mode 100644 index 00000000..be2ed91c --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/ArchivableFilesFinder.php @@ -0,0 +1,24 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Package\Archiver\ArchivableFilesFinder. +// 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\Package\Archiver; + +use FilterIterator; + +class ArchivableFilesFinder extends FilterIterator +{ + public function __construct(string $sources, array $excludes, bool $ignoreFilters = false) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function accept(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'accept'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/ArchiveManager.php b/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/ArchiveManager.php new file mode 100644 index 00000000..97e9071b --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/ArchiveManager.php @@ -0,0 +1,51 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Package\Archiver\ArchiveManager. +// 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\Package\Archiver; + +use Composer\Downloader\DownloadManager; +use Composer\Util\Loop; +use Composer\Package\CompletePackageInterface; + +class ArchiveManager +{ + public function __construct(DownloadManager $downloadManager, Loop $loop) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function addArchiver(ArchiverInterface $archiver): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addArchiver'); + } + + public function setOverwriteFiles(bool $overwriteFiles): self + { + \ShirabeUnsupportedClass::fail(self::class, 'setOverwriteFiles'); + } + + public function getPackageFilenameParts(CompletePackageInterface $package): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackageFilenameParts'); + } + + public function getPackageFilenameFromParts(array $parts): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackageFilenameFromParts'); + } + + public function getPackageFilename(CompletePackageInterface $package): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackageFilename'); + } + + public function archive(CompletePackageInterface $package, string $format, string $targetDir, ?string $fileName = null, bool $ignoreFilters = false): string + { + \ShirabeUnsupportedClass::fail(self::class, 'archive'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/PharArchiver.php b/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/PharArchiver.php new file mode 100644 index 00000000..71303caf --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/PharArchiver.php @@ -0,0 +1,27 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Package\Archiver\PharArchiver. +// 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\Package\Archiver; + +class PharArchiver implements ArchiverInterface +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function archive(string $sources, string $target, string $format, array $excludes = [], bool $ignoreFilters = false): string + { + \ShirabeUnsupportedClass::fail(self::class, 'archive'); + } + + public function supports(string $format, ?string $sourceType): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/ZipArchiver.php b/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/ZipArchiver.php new file mode 100644 index 00000000..130ce74c --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Package/Archiver/ZipArchiver.php @@ -0,0 +1,27 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Package\Archiver\ZipArchiver. +// 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\Package\Archiver; + +class ZipArchiver implements ArchiverInterface +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function archive(string $sources, string $target, string $format, array $excludes = [], bool $ignoreFilters = false): string + { + \ShirabeUnsupportedClass::fail(self::class, 'archive'); + } + + public function supports(string $format, ?string $sourceType): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Package/Loader/ArrayLoader.php b/crates/shirabe-php-rpc/php/guards/Composer/Package/Loader/ArrayLoader.php new file mode 100644 index 00000000..4e37ad7f --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Package/Loader/ArrayLoader.php @@ -0,0 +1,40 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Package\Loader\ArrayLoader. +// 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\Package\Loader; + +use Composer\Package\BasePackage; +use Composer\Package\Version\VersionParser; + +class ArrayLoader implements LoaderInterface +{ + public function __construct(?VersionParser $parser = null, bool $loadOptions = false) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function load(array $config, string $class = 'Composer\Package\CompletePackage'): BasePackage + { + \ShirabeUnsupportedClass::fail(self::class, 'load'); + } + + public function loadPackages(array $versions): array + { + \ShirabeUnsupportedClass::fail(self::class, 'loadPackages'); + } + + public function parseLinks(string $source, string $sourceVersion, string $description, array $links): array + { + \ShirabeUnsupportedClass::fail(self::class, 'parseLinks'); + } + + public function getBranchAlias(array $config): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranchAlias'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Package/Loader/RootPackageLoader.php b/crates/shirabe-php-rpc/php/guards/Composer/Package/Loader/RootPackageLoader.php new file mode 100644 index 00000000..3d2d3390 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Package/Loader/RootPackageLoader.php @@ -0,0 +1,39 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Package\Loader\RootPackageLoader. +// 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\Package\Loader; + +use Composer\Package\BasePackage; +use Composer\Config; +use Composer\IO\IOInterface; +use Composer\Package\Version\VersionGuesser; +use Composer\Package\Version\VersionParser; +use Composer\Repository\RepositoryManager; + +class RootPackageLoader extends ArrayLoader +{ + public function __construct(RepositoryManager $manager, Config $config, ?VersionParser $parser = null, ?VersionGuesser $versionGuesser = null, ?IOInterface $io = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function load(array $config, string $class = 'Composer\Package\RootPackage', ?string $cwd = null): BasePackage + { + \ShirabeUnsupportedClass::fail(self::class, 'load'); + } + + public static function extractStabilityFlags(array $requires, string $minimumStability, array $stabilityFlags): array + { + \ShirabeUnsupportedClass::fail(self::class, 'extractStabilityFlags'); + } + + public static function extractReferences(array $requires, array $references): array + { + \ShirabeUnsupportedClass::fail(self::class, 'extractReferences'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Package/Loader/ValidatingArrayLoader.php b/crates/shirabe-php-rpc/php/guards/Composer/Package/Loader/ValidatingArrayLoader.php new file mode 100644 index 00000000..c6f7af70 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Package/Loader/ValidatingArrayLoader.php @@ -0,0 +1,44 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Package\Loader\ValidatingArrayLoader. +// 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\Package\Loader; + +use Composer\Package\BasePackage; +use Composer\Package\Version\VersionParser; + +class ValidatingArrayLoader implements LoaderInterface +{ + public const CHECK_ALL = 3; + public const CHECK_UNBOUND_CONSTRAINTS = 1; + public const CHECK_STRICT_CONSTRAINTS = 2; + + public function __construct(LoaderInterface $loader, bool $strictName = true, ?VersionParser $parser = null, int $flags = 0) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function load(array $config, string $class = 'Composer\Package\CompletePackage'): BasePackage + { + \ShirabeUnsupportedClass::fail(self::class, 'load'); + } + + public function getWarnings(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getWarnings'); + } + + public function getErrors(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getErrors'); + } + + public static function hasPackageNamingError(string $name, bool $isLink = false): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'hasPackageNamingError'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Package/Locker.php b/crates/shirabe-php-rpc/php/guards/Composer/Package/Locker.php new file mode 100644 index 00000000..4009f162 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Package/Locker.php @@ -0,0 +1,113 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Package\Locker. +// 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\Package; + +use Composer\Json\JsonFile; +use Composer\Installer\InstallationManager; +use Composer\Repository\LockArrayRepository; +use Composer\Util\ProcessExecutor; +use Composer\IO\IOInterface; + +class Locker +{ + public function __construct(IOInterface $io, JsonFile $lockFile, InstallationManager $installationManager, string $composerFileContents, ?ProcessExecutor $process = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getJsonFile(): JsonFile + { + \ShirabeUnsupportedClass::fail(self::class, 'getJsonFile'); + } + + public static function getContentHash(string $composerFileContents): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getContentHash'); + } + + public function isLocked(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isLocked'); + } + + public function isFresh(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isFresh'); + } + + public function getLockedRepository(bool $withDevReqs = false): LockArrayRepository + { + \ShirabeUnsupportedClass::fail(self::class, 'getLockedRepository'); + } + + public function getDevPackageNames(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDevPackageNames'); + } + + public function getPlatformRequirements(bool $withDevReqs = false): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getPlatformRequirements'); + } + + public function getMinimumStability(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getMinimumStability'); + } + + public function getStabilityFlags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getStabilityFlags'); + } + + public function getPreferStable(): ?bool + { + \ShirabeUnsupportedClass::fail(self::class, 'getPreferStable'); + } + + public function getPreferLowest(): ?bool + { + \ShirabeUnsupportedClass::fail(self::class, 'getPreferLowest'); + } + + public function getPlatformOverrides(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getPlatformOverrides'); + } + + public function getAliases(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getAliases'); + } + + public function getPluginApi() + { + \ShirabeUnsupportedClass::fail(self::class, 'getPluginApi'); + } + + public function getLockData(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getLockData'); + } + + public function setLockData(array $packages, ?array $devPackages, array $platformReqs, array $platformDevReqs, array $aliases, string $minimumStability, array $stabilityFlags, bool $preferStable, bool $preferLowest, array $platformOverrides, bool $write = true): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'setLockData'); + } + + public function updateHash(JsonFile $composerJson, ?callable $dataProcessor = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'updateHash'); + } + + public function getMissingRequirementInfo(RootPackageInterface $package, bool $includeDev): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getMissingRequirementInfo'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Package/Version/VersionBumper.php b/crates/shirabe-php-rpc/php/guards/Composer/Package/Version/VersionBumper.php new file mode 100644 index 00000000..c9a4ae00 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Package/Version/VersionBumper.php @@ -0,0 +1,25 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Package\Version\VersionBumper. +// 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\Package\Version; + +use Composer\Package\PackageInterface; +use Composer\Semver\Constraint\ConstraintInterface; + +class VersionBumper +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function bumpRequirement(ConstraintInterface $constraint, PackageInterface $package): string + { + \ShirabeUnsupportedClass::fail(self::class, 'bumpRequirement'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Package/Version/VersionSelector.php b/crates/shirabe-php-rpc/php/guards/Composer/Package/Version/VersionSelector.php new file mode 100644 index 00000000..2264073f --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Package/Version/VersionSelector.php @@ -0,0 +1,32 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Package\Version\VersionSelector. +// 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\Package\Version; + +use Composer\IO\IOInterface; +use Composer\Package\PackageInterface; +use Composer\Repository\RepositorySet; +use Composer\Repository\PlatformRepository; + +class VersionSelector +{ + public function __construct(RepositorySet $repositorySet, ?PlatformRepository $platformRepo = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function findBestCandidate(string $packageName, ?string $targetPackageVersion = null, string $preferredStability = 'stable', $platformRequirementFilter = null, int $repoSetFlags = 0, ?IOInterface $io = null, $showWarnings = true) + { + \ShirabeUnsupportedClass::fail(self::class, 'findBestCandidate'); + } + + public function findRecommendedRequireVersion(PackageInterface $package): string + { + \ShirabeUnsupportedClass::fail(self::class, 'findRecommendedRequireVersion'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Plugin/CommandEvent.php b/crates/shirabe-php-rpc/php/guards/Composer/Plugin/CommandEvent.php new file mode 100644 index 00000000..df84c294 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Plugin/CommandEvent.php @@ -0,0 +1,36 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Plugin\CommandEvent. +// 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\Plugin; + +use Composer\EventDispatcher\Event; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class CommandEvent extends Event +{ + public function __construct(string $name, string $commandName, InputInterface $input, OutputInterface $output, array $args = [], array $flags = []) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getInput(): InputInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'getInput'); + } + + public function getOutput(): OutputInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'getOutput'); + } + + public function getCommandName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getCommandName'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PluginManager.php b/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PluginManager.php new file mode 100644 index 00000000..857c740e --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PluginManager.php @@ -0,0 +1,118 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Plugin\PluginManager. +// 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\Plugin; + +use Composer\Composer; +use Composer\IO\IOInterface; +use Composer\PartialComposer; +use Composer\Package\PackageInterface; +use Composer\Plugin\Capability\Capability; + +class PluginManager +{ + public function __construct(IOInterface $io, Composer $composer, ?PartialComposer $globalComposer = null, $disablePlugins = false) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function setRunningInGlobalDir(bool $runningInGlobalDir): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setRunningInGlobalDir'); + } + + public function loadInstalledPlugins(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'loadInstalledPlugins'); + } + + public function deactivateInstalledPlugins(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'deactivateInstalledPlugins'); + } + + public function getPlugins(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getPlugins'); + } + + public function getRegisteredPlugins(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRegisteredPlugins'); + } + + public function getGlobalComposer(): ?PartialComposer + { + \ShirabeUnsupportedClass::fail(self::class, 'getGlobalComposer'); + } + + public function registerPackage(PackageInterface $package, bool $failOnMissingClasses = false, bool $isGlobalPlugin = false): void + { + \ShirabeUnsupportedClass::fail(self::class, 'registerPackage'); + } + + public function deactivatePackage(PackageInterface $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'deactivatePackage'); + } + + public function uninstallPackage(PackageInterface $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'uninstallPackage'); + } + + protected function getPluginApiVersion(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPluginApiVersion'); + } + + public function addPlugin(PluginInterface $plugin, bool $isGlobalPlugin = false, ?PackageInterface $sourcePackage = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addPlugin'); + } + + public function removePlugin(PluginInterface $plugin): void + { + \ShirabeUnsupportedClass::fail(self::class, 'removePlugin'); + } + + public function uninstallPlugin(PluginInterface $plugin): void + { + \ShirabeUnsupportedClass::fail(self::class, 'uninstallPlugin'); + } + + protected function getCapabilityImplementationClassName(PluginInterface $plugin, string $capability): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getCapabilityImplementationClassName'); + } + + public function getPluginCapability(PluginInterface $plugin, $capabilityClassName, array $ctorArgs = []): ?Capability + { + \ShirabeUnsupportedClass::fail(self::class, 'getPluginCapability'); + } + + public function getPluginCapabilities($capabilityClassName, array $ctorArgs = []): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getPluginCapabilities'); + } + + public function arePluginsDisabled($type) + { + \ShirabeUnsupportedClass::fail(self::class, 'arePluginsDisabled'); + } + + public function disablePlugins(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'disablePlugins'); + } + + public function isPluginAllowed(string $package, bool $isGlobalPlugin, bool $optional = false, bool $prompt = true): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isPluginAllowed'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PostFileDownloadEvent.php b/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PostFileDownloadEvent.php new file mode 100644 index 00000000..c387767b --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PostFileDownloadEvent.php @@ -0,0 +1,50 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Plugin\PostFileDownloadEvent. +// 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\Plugin; + +use Composer\EventDispatcher\Event; +use Composer\Package\PackageInterface; + +class PostFileDownloadEvent extends Event +{ + public function __construct(string $name, ?string $fileName, ?string $checksum, string $url, string $type, $context = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getFileName(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileName'); + } + + public function getChecksum(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getChecksum'); + } + + public function getUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUrl'); + } + + public function getContext() + { + \ShirabeUnsupportedClass::fail(self::class, 'getContext'); + } + + public function getPackage(): ?PackageInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackage'); + } + + public function getType(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getType'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PreFileDownloadEvent.php b/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PreFileDownloadEvent.php new file mode 100644 index 00000000..f1c53d99 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PreFileDownloadEvent.php @@ -0,0 +1,65 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Plugin\PreFileDownloadEvent. +// 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\Plugin; + +use Composer\EventDispatcher\Event; +use Composer\Util\HttpDownloader; + +class PreFileDownloadEvent extends Event +{ + public function __construct(string $name, HttpDownloader $httpDownloader, string $processedUrl, string $type, $context = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getHttpDownloader(): HttpDownloader + { + \ShirabeUnsupportedClass::fail(self::class, 'getHttpDownloader'); + } + + public function getProcessedUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getProcessedUrl'); + } + + public function setProcessedUrl(string $processedUrl): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setProcessedUrl'); + } + + public function getCustomCacheKey(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getCustomCacheKey'); + } + + public function setCustomCacheKey(?string $customCacheKey): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setCustomCacheKey'); + } + + public function getType(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getType'); + } + + public function getContext() + { + \ShirabeUnsupportedClass::fail(self::class, 'getContext'); + } + + public function getTransportOptions(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTransportOptions'); + } + + public function setTransportOptions(array $options): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setTransportOptions'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PrePoolCreateEvent.php b/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PrePoolCreateEvent.php new file mode 100644 index 00000000..537a777d --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Plugin/PrePoolCreateEvent.php @@ -0,0 +1,70 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Plugin\PrePoolCreateEvent. +// 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\Plugin; + +use Composer\EventDispatcher\Event; +use Composer\DependencyResolver\Request; + +class PrePoolCreateEvent extends Event +{ + public function __construct(string $name, array $repositories, Request $request, array $acceptableStabilities, array $stabilityFlags, array $rootAliases, array $rootReferences, array $packages, array $unacceptableFixedPackages) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRepositories(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepositories'); + } + + public function getRequest(): Request + { + \ShirabeUnsupportedClass::fail(self::class, 'getRequest'); + } + + public function getAcceptableStabilities(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getAcceptableStabilities'); + } + + public function getStabilityFlags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getStabilityFlags'); + } + + public function getRootAliases(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootAliases'); + } + + public function getRootReferences(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootReferences'); + } + + public function getPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackages'); + } + + public function getUnacceptableFixedPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getUnacceptableFixedPackages'); + } + + public function setPackages(array $packages): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setPackages'); + } + + public function setUnacceptableFixedPackages(array $packages): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setUnacceptableFixedPackages'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/ArtifactRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/ArtifactRepository.php new file mode 100644 index 00000000..893facda --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/ArtifactRepository.php @@ -0,0 +1,34 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\ArtifactRepository. +// 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\Repository; + +use Composer\IO\IOInterface; + +class ArtifactRepository extends ArrayRepository implements ConfigurableRepositoryInterface +{ + public function __construct(array $repoConfig, IOInterface $io) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRepoName() + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } + + public function getRepoConfig() + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoConfig'); + } + + protected function initialize() + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/ComposerRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/ComposerRepository.php new file mode 100644 index 00000000..e36e1c4b --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/ComposerRepository.php @@ -0,0 +1,108 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\ComposerRepository. +// 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\Repository; + +use Composer\Package\PackageInterface; +use Composer\Config; +use Composer\IO\IOInterface; +use Composer\Util\HttpDownloader; +use Composer\EventDispatcher\EventDispatcher; + +class ComposerRepository extends ArrayRepository implements ConfigurableRepositoryInterface, AdvisoryProviderInterface +{ + public function __construct(array $repoConfig, IOInterface $io, Config $config, HttpDownloader $httpDownloader, ?EventDispatcher $eventDispatcher = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRepoName() + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } + + public function getRepoConfig() + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoConfig'); + } + + public function findPackage(string $name, $constraint) + { + \ShirabeUnsupportedClass::fail(self::class, 'findPackage'); + } + + public function findPackages(string $name, $constraint = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'findPackages'); + } + + public function getPackages() + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackages'); + } + + public function getPackageNames(?string $packageFilter = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackageNames'); + } + + public function loadPackages(array $packageNameMap, array $acceptableStabilities, array $stabilityFlags, array $alreadyLoaded = []) + { + \ShirabeUnsupportedClass::fail(self::class, 'loadPackages'); + } + + public function search(string $query, int $mode = 0, ?string $type = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'search'); + } + + public function hasSecurityAdvisories(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasSecurityAdvisories'); + } + + public function getSecurityAdvisories(array $packageConstraintMap, bool $allowPartialAdvisories = false): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSecurityAdvisories'); + } + + public function getProviders(string $packageName) + { + \ShirabeUnsupportedClass::fail(self::class, 'getProviders'); + } + + protected function configurePackageTransportOptions(PackageInterface $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'configurePackageTransportOptions'); + } + + protected function initialize() + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function addPackage(PackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, 'addPackage'); + } + + protected function loadRootServerFile(?int $rootMaxAge = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'loadRootServerFile'); + } + + protected function fetchFile(string $filename, ?string $cacheKey = null, ?string $sha256 = null, bool $storeLastModifiedTime = false) + { + \ShirabeUnsupportedClass::fail(self::class, 'fetchFile'); + } + + protected function lazyProvidersRepoContains(string $name) + { + \ShirabeUnsupportedClass::fail(self::class, 'lazyProvidersRepoContains'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/CompositeRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/CompositeRepository.php new file mode 100644 index 00000000..691a797b --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/CompositeRepository.php @@ -0,0 +1,80 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\CompositeRepository. +// 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\Repository; + +use Composer\Package\BasePackage; +use Composer\Package\PackageInterface; + +class CompositeRepository implements RepositoryInterface +{ + public function __construct(array $repositories) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRepoName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } + + public function getRepositories(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepositories'); + } + + public function hasPackage(PackageInterface $package): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasPackage'); + } + + public function findPackage($name, $constraint): ?BasePackage + { + \ShirabeUnsupportedClass::fail(self::class, 'findPackage'); + } + + public function findPackages($name, $constraint = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'findPackages'); + } + + public function loadPackages(array $packageNameMap, array $acceptableStabilities, array $stabilityFlags, array $alreadyLoaded = []): array + { + \ShirabeUnsupportedClass::fail(self::class, 'loadPackages'); + } + + public function search(string $query, int $mode = 0, ?string $type = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'search'); + } + + public function getPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackages'); + } + + public function getProviders($packageName): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getProviders'); + } + + public function removePackage(PackageInterface $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'removePackage'); + } + + public function count(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'count'); + } + + public function addRepository(RepositoryInterface $repository): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addRepository'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/FilterRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/FilterRepository.php new file mode 100644 index 00000000..866585a1 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/FilterRepository.php @@ -0,0 +1,80 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\FilterRepository. +// 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\Repository; + +use Composer\Package\PackageInterface; +use Composer\Package\BasePackage; + +class FilterRepository implements RepositoryInterface, AdvisoryProviderInterface +{ + public function __construct(RepositoryInterface $repo, array $options) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRepoName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } + + public function getRepository(): RepositoryInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepository'); + } + + public function hasPackage(PackageInterface $package): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasPackage'); + } + + public function findPackage($name, $constraint): ?BasePackage + { + \ShirabeUnsupportedClass::fail(self::class, 'findPackage'); + } + + public function findPackages($name, $constraint = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'findPackages'); + } + + public function loadPackages(array $packageNameMap, array $acceptableStabilities, array $stabilityFlags, array $alreadyLoaded = []): array + { + \ShirabeUnsupportedClass::fail(self::class, 'loadPackages'); + } + + public function search(string $query, int $mode = 0, ?string $type = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'search'); + } + + public function getPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getPackages'); + } + + public function getProviders($packageName): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getProviders'); + } + + public function count(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'count'); + } + + public function hasSecurityAdvisories(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasSecurityAdvisories'); + } + + public function getSecurityAdvisories(array $packageConstraintMap, bool $allowPartialAdvisories = false): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSecurityAdvisories'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/InstalledRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/InstalledRepository.php new file mode 100644 index 00000000..6add0007 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/InstalledRepository.php @@ -0,0 +1,39 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\InstalledRepository. +// 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\Repository; + +use Composer\Semver\Constraint\ConstraintInterface; + +class InstalledRepository extends CompositeRepository +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function findPackagesWithReplacersAndProviders(string $name, $constraint = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'findPackagesWithReplacersAndProviders'); + } + + public function getDependents($needle, ?ConstraintInterface $constraint = null, bool $invert = false, bool $recurse = true, ?array $packagesFound = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDependents'); + } + + public function getRepoName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } + + public function addRepository(RepositoryInterface $repository): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addRepository'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/LockArrayRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/LockArrayRepository.php new file mode 100644 index 00000000..afa486cf --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/LockArrayRepository.php @@ -0,0 +1,27 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\LockArrayRepository. +// 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\Repository; + +class LockArrayRepository extends ArrayRepository +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRepoName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } + + public function getCanonicalPackages() + { + \ShirabeUnsupportedClass::fail(self::class, 'getCanonicalPackages'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/PackageRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/PackageRepository.php new file mode 100644 index 00000000..6ea6629b --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/PackageRepository.php @@ -0,0 +1,37 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\PackageRepository. +// 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\Repository; + +class PackageRepository extends ArrayRepository implements AdvisoryProviderInterface +{ + public function __construct(array $config) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + protected function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function getRepoName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } + + public function hasSecurityAdvisories(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasSecurityAdvisories'); + } + + public function getSecurityAdvisories(array $packageConstraintMap, bool $allowPartialAdvisories = false): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSecurityAdvisories'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/PathRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/PathRepository.php new file mode 100644 index 00000000..2c664d1b --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/PathRepository.php @@ -0,0 +1,38 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\PathRepository. +// 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\Repository; + +use Composer\Config; +use Composer\EventDispatcher\EventDispatcher; +use Composer\IO\IOInterface; +use Composer\Util\HttpDownloader; +use Composer\Util\ProcessExecutor; + +class PathRepository extends ArrayRepository implements ConfigurableRepositoryInterface +{ + public function __construct(array $repoConfig, IOInterface $io, Config $config, ?HttpDownloader $httpDownloader = null, ?EventDispatcher $dispatcher = null, ?ProcessExecutor $process = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRepoName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } + + public function getRepoConfig(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoConfig'); + } + + protected function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/PearRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/PearRepository.php new file mode 100644 index 00000000..abba7813 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/PearRepository.php @@ -0,0 +1,17 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\PearRepository. +// 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\Repository; + +class PearRepository extends ArrayRepository +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/PlatformRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/PlatformRepository.php new file mode 100644 index 00000000..665ead73 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/PlatformRepository.php @@ -0,0 +1,63 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\PlatformRepository. +// 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\Repository; + +use Composer\Package\PackageInterface; +use Composer\Platform\HhvmDetector; +use Composer\Platform\Runtime; + +class PlatformRepository extends ArrayRepository +{ + public const PLATFORM_PACKAGE_REGEX = '{^(?:php(?:-64bit|-ipv6|-zts|-debug)?|hhvm|(?:ext|lib)-[a-z0-9](?:[_.-]?[a-z0-9]+)*|composer(?:-(?:plugin|runtime)-api)?)$}iD'; + + public function __construct(array $packages = [], array $overrides = [], ?Runtime $runtime = null, ?HhvmDetector $hhvmDetector = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRepoName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } + + public function isPlatformPackageDisabled(string $name): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isPlatformPackageDisabled'); + } + + public function getDisabledPackages(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDisabledPackages'); + } + + protected function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function addPackage(PackageInterface $package): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addPackage'); + } + + public static function isPlatformPackage(string $name): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isPlatformPackage'); + } + + public static function getPlatformPhpVersion(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPlatformPhpVersion'); + } + + public function search(string $query, int $mode = 0, ?string $type = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'search'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/RepositoryFactory.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/RepositoryFactory.php new file mode 100644 index 00000000..e2f3a1b7 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/RepositoryFactory.php @@ -0,0 +1,58 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\RepositoryFactory. +// 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\Repository; + +use Composer\IO\IOInterface; +use Composer\Config; +use Composer\EventDispatcher\EventDispatcher; +use Composer\Util\HttpDownloader; +use Composer\Util\ProcessExecutor; + +class RepositoryFactory +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public static function configFromString(IOInterface $io, Config $config, string $repository, bool $allowFilesystem = false) + { + \ShirabeUnsupportedClass::fail(self::class, 'configFromString'); + } + + public static function fromString(IOInterface $io, Config $config, string $repository, bool $allowFilesystem = false, ?RepositoryManager $rm = null): RepositoryInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'fromString'); + } + + public static function createRepo(IOInterface $io, Config $config, array $repoConfig, ?RepositoryManager $rm = null): RepositoryInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'createRepo'); + } + + public static function defaultRepos(?IOInterface $io = null, ?Config $config = null, ?RepositoryManager $rm = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'defaultRepos'); + } + + public static function manager(IOInterface $io, Config $config, ?HttpDownloader $httpDownloader = null, ?EventDispatcher $eventDispatcher = null, ?ProcessExecutor $process = null): RepositoryManager + { + \ShirabeUnsupportedClass::fail(self::class, 'manager'); + } + + public static function defaultReposWithDefaultManager(IOInterface $io): array + { + \ShirabeUnsupportedClass::fail(self::class, 'defaultReposWithDefaultManager'); + } + + public static function generateRepositoryName($index, array $repo, array $existingRepos): string + { + \ShirabeUnsupportedClass::fail(self::class, 'generateRepositoryName'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/RepositorySet.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/RepositorySet.php new file mode 100644 index 00000000..0c846767 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/RepositorySet.php @@ -0,0 +1,93 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\RepositorySet. +// 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\Repository; + +use Composer\DependencyResolver\PoolOptimizer; +use Composer\DependencyResolver\Pool; +use Composer\DependencyResolver\Request; +use Composer\DependencyResolver\SecurityAdvisoryPoolFilter; +use Composer\EventDispatcher\EventDispatcher; +use Composer\IO\IOInterface; +use Composer\Semver\Constraint\ConstraintInterface; + +class RepositorySet +{ + public const ALLOW_UNACCEPTABLE_STABILITIES = 1; + public const ALLOW_SHADOWED_REPOSITORIES = 2; + + public function __construct(string $minimumStability = 'stable', array $stabilityFlags = [], array $rootAliases = [], array $rootReferences = [], array $rootRequires = [], array $temporaryConstraints = []) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function allowInstalledRepositories(bool $allow = true): void + { + \ShirabeUnsupportedClass::fail(self::class, 'allowInstalledRepositories'); + } + + public function getRootRequires(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootRequires'); + } + + public function getTemporaryConstraints(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTemporaryConstraints'); + } + + public function addRepository(RepositoryInterface $repo): void + { + \ShirabeUnsupportedClass::fail(self::class, 'addRepository'); + } + + public function findPackages(string $name, ?ConstraintInterface $constraint = null, int $flags = 0): array + { + \ShirabeUnsupportedClass::fail(self::class, 'findPackages'); + } + + public function getSecurityAdvisories(array $packageNames, bool $allowPartialAdvisories, bool $ignoreUnreachable = false): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSecurityAdvisories'); + } + + public function getMatchingSecurityAdvisories(array $packages, bool $allowPartialAdvisories = false, bool $ignoreUnreachable = false): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getMatchingSecurityAdvisories'); + } + + public function getProviders(string $packageName): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getProviders'); + } + + public function isPackageAcceptable(array $names, string $stability): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isPackageAcceptable'); + } + + public function createPool(Request $request, IOInterface $io, ?EventDispatcher $eventDispatcher = null, ?PoolOptimizer $poolOptimizer = null, array $ignoredTypes = [], ?array $allowedTypes = null, ?SecurityAdvisoryPoolFilter $securityAdvisoryPoolFilter = null): Pool + { + \ShirabeUnsupportedClass::fail(self::class, 'createPool'); + } + + public function createPoolWithAllPackages(): Pool + { + \ShirabeUnsupportedClass::fail(self::class, 'createPoolWithAllPackages'); + } + + public function createPoolForPackage(string $packageName, ?LockArrayRepository $lockedRepo = null): Pool + { + \ShirabeUnsupportedClass::fail(self::class, 'createPoolForPackage'); + } + + public function createPoolForPackages(array $packageNames, ?LockArrayRepository $lockedRepo = null): Pool + { + \ShirabeUnsupportedClass::fail(self::class, 'createPoolForPackages'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/RootPackageRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/RootPackageRepository.php new file mode 100644 index 00000000..ea7abae1 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/RootPackageRepository.php @@ -0,0 +1,24 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\RootPackageRepository. +// 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\Repository; + +use Composer\Package\RootPackageInterface; + +class RootPackageRepository extends ArrayRepository +{ + public function __construct(RootPackageInterface $package) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRepoName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/ForgejoDriver.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/ForgejoDriver.php new file mode 100644 index 00000000..0e812dfe --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/ForgejoDriver.php @@ -0,0 +1,122 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\Vcs\ForgejoDriver. +// 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. +// Composer\Repository\Vcs\VcsDriver::__construct() is final, so it keeps running the real implementation here. + +namespace Composer\Repository\Vcs; + +use Composer\Config; +use Composer\IO\IOInterface; +use Composer\Util\Http\Response; + +class ForgejoDriver extends VcsDriver +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function getFileContent(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileContent'); + } + + public function getChangeDate(string $identifier): ?\DateTimeImmutable + { + \ShirabeUnsupportedClass::fail(self::class, 'getChangeDate'); + } + + public function getRootIdentifier(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootIdentifier'); + } + + public function getBranches(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranches'); + } + + public function getTags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTags'); + } + + public function getDist(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDist'); + } + + public function getComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerInformation'); + } + + public function getSource(string $identifier): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSource'); + } + + public function getUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUrl'); + } + + public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + protected function setupGitDriver(string $url): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setupGitDriver'); + } + + protected function getNextPage(Response $response): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getNextPage'); + } + + protected function getContents(string $url, bool $fetchingRepoData = false): Response + { + \ShirabeUnsupportedClass::fail(self::class, 'getContents'); + } + + protected function attemptCloneFallback(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'attemptCloneFallback'); + } + + protected function shouldCache(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'shouldCache'); + } + + protected function getBaseComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBaseComposerInformation'); + } + + public function hasComposerFile(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasComposerFile'); + } + + protected function getScheme(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getScheme'); + } + + public function cleanup(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/FossilDriver.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/FossilDriver.php new file mode 100644 index 00000000..0bf55416 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/FossilDriver.php @@ -0,0 +1,116 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\Vcs\FossilDriver. +// 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. +// Composer\Repository\Vcs\VcsDriver::__construct() is final, so it keeps running the real implementation here. + +namespace Composer\Repository\Vcs; + +use Composer\Config; +use Composer\IO\IOInterface; + +class FossilDriver extends VcsDriver +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + protected function checkFossil(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'checkFossil'); + } + + protected function updateLocalRepo(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'updateLocalRepo'); + } + + public function getRootIdentifier(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootIdentifier'); + } + + public function getUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUrl'); + } + + public function getSource(string $identifier): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSource'); + } + + public function getDist(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDist'); + } + + public function getFileContent(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileContent'); + } + + public function getChangeDate(string $identifier): ?\DateTimeImmutable + { + \ShirabeUnsupportedClass::fail(self::class, 'getChangeDate'); + } + + public function getTags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTags'); + } + + public function getBranches(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranches'); + } + + public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + protected function shouldCache(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'shouldCache'); + } + + public function getComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerInformation'); + } + + protected function getBaseComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBaseComposerInformation'); + } + + public function hasComposerFile(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasComposerFile'); + } + + protected function getScheme(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getScheme'); + } + + protected function getContents(string $url): Response + { + \ShirabeUnsupportedClass::fail(self::class, 'getContents'); + } + + public function cleanup(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitBitbucketDriver.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitBitbucketDriver.php new file mode 100644 index 00000000..1249b6a9 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitBitbucketDriver.php @@ -0,0 +1,137 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\Vcs\GitBitbucketDriver. +// 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. +// Composer\Repository\Vcs\VcsDriver::__construct() is final, so it keeps running the real implementation here. + +namespace Composer\Repository\Vcs; + +use Composer\Config; +use Composer\IO\IOInterface; +use Composer\Util\Http\Response; + +class GitBitbucketDriver extends VcsDriver +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function getUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUrl'); + } + + protected function getRepoData(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoData'); + } + + public function getComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerInformation'); + } + + public function getFileContent(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileContent'); + } + + public function getChangeDate(string $identifier): ?\DateTimeImmutable + { + \ShirabeUnsupportedClass::fail(self::class, 'getChangeDate'); + } + + public function getSource(string $identifier): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSource'); + } + + public function getDist(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDist'); + } + + public function getTags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTags'); + } + + public function getBranches(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranches'); + } + + protected function fetchWithOAuthCredentials(string $url, bool $fetchingRepoData = false): Response + { + \ShirabeUnsupportedClass::fail(self::class, 'fetchWithOAuthCredentials'); + } + + protected function generateSshUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'generateSshUrl'); + } + + protected function attemptCloneFallback(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'attemptCloneFallback'); + } + + protected function setupFallbackDriver(string $url): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setupFallbackDriver'); + } + + protected function parseCloneUrls(array $cloneLinks): void + { + \ShirabeUnsupportedClass::fail(self::class, 'parseCloneUrls'); + } + + public function getRootIdentifier(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootIdentifier'); + } + + public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + protected function shouldCache(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'shouldCache'); + } + + protected function getBaseComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBaseComposerInformation'); + } + + public function hasComposerFile(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasComposerFile'); + } + + protected function getScheme(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getScheme'); + } + + protected function getContents(string $url): Response + { + \ShirabeUnsupportedClass::fail(self::class, 'getContents'); + } + + public function cleanup(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitDriver.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitDriver.php new file mode 100644 index 00000000..ae4ed49b --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitDriver.php @@ -0,0 +1,106 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\Vcs\GitDriver. +// 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. +// Composer\Repository\Vcs\VcsDriver::__construct() is final, so it keeps running the real implementation here. + +namespace Composer\Repository\Vcs; + +use Composer\IO\IOInterface; +use Composer\Config; + +class GitDriver extends VcsDriver +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function getRootIdentifier(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootIdentifier'); + } + + public function getUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUrl'); + } + + public function getSource(string $identifier): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSource'); + } + + public function getDist(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDist'); + } + + public function getFileContent(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileContent'); + } + + public function getChangeDate(string $identifier): ?\DateTimeImmutable + { + \ShirabeUnsupportedClass::fail(self::class, 'getChangeDate'); + } + + public function getTags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTags'); + } + + public function getBranches(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranches'); + } + + public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + protected function shouldCache(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'shouldCache'); + } + + public function getComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerInformation'); + } + + protected function getBaseComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBaseComposerInformation'); + } + + public function hasComposerFile(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasComposerFile'); + } + + protected function getScheme(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getScheme'); + } + + protected function getContents(string $url): Response + { + \ShirabeUnsupportedClass::fail(self::class, 'getContents'); + } + + public function cleanup(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitHubDriver.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitHubDriver.php new file mode 100644 index 00000000..32b3551d --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitHubDriver.php @@ -0,0 +1,147 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\Vcs\GitHubDriver. +// 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. +// Composer\Repository\Vcs\VcsDriver::__construct() is final, so it keeps running the real implementation here. + +namespace Composer\Repository\Vcs; + +use Composer\Config; +use Composer\IO\IOInterface; +use Composer\Util\Http\Response; + +class GitHubDriver extends VcsDriver +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function getRepositoryUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepositoryUrl'); + } + + public function getRootIdentifier(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootIdentifier'); + } + + public function getUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUrl'); + } + + protected function getApiUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getApiUrl'); + } + + public function getSource(string $identifier): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSource'); + } + + public function getDist(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDist'); + } + + public function getComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerInformation'); + } + + public function getFileContent(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileContent'); + } + + public function getChangeDate(string $identifier): ?\DateTimeImmutable + { + \ShirabeUnsupportedClass::fail(self::class, 'getChangeDate'); + } + + public function getTags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTags'); + } + + public function getBranches(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranches'); + } + + public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + public function getRepoData(): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoData'); + } + + protected function generateSshUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'generateSshUrl'); + } + + protected function getContents(string $url, bool $fetchingRepoData = false): Response + { + \ShirabeUnsupportedClass::fail(self::class, 'getContents'); + } + + protected function fetchRootIdentifier(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'fetchRootIdentifier'); + } + + protected function attemptCloneFallback(?\Throwable $e = null): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'attemptCloneFallback'); + } + + protected function setupGitDriver(string $url): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setupGitDriver'); + } + + protected function getNextPage(Response $response): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getNextPage'); + } + + protected function shouldCache(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'shouldCache'); + } + + protected function getBaseComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBaseComposerInformation'); + } + + public function hasComposerFile(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasComposerFile'); + } + + protected function getScheme(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getScheme'); + } + + public function cleanup(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitLabDriver.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitLabDriver.php new file mode 100644 index 00000000..b1d0c34d --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/GitLabDriver.php @@ -0,0 +1,165 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\Vcs\GitLabDriver. +// 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. +// Composer\Repository\Vcs\VcsDriver::__construct() is final, so it keeps running the real implementation here. + +namespace Composer\Repository\Vcs; + +use Composer\Config; +use Composer\IO\IOInterface; +use Composer\Util\HttpDownloader; +use Composer\Util\Http\Response; + +class GitLabDriver extends VcsDriver +{ + public const URL_REGEX = '#^(?:(?P<scheme>https?)://(?P<domain>.+?)(?::(?P<port>[0-9]+))?/|git@(?P<domain2>[^:]+):)(?P<parts>.+)/(?P<repo>[^/]+?)(?:\.git|/)?$#'; + + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function setHttpDownloader(HttpDownloader $httpDownloader): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setHttpDownloader'); + } + + public function getComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerInformation'); + } + + public function getFileContent(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileContent'); + } + + public function getChangeDate(string $identifier): ?\DateTimeImmutable + { + \ShirabeUnsupportedClass::fail(self::class, 'getChangeDate'); + } + + public function getRepositoryUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepositoryUrl'); + } + + public function getUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUrl'); + } + + public function getDist(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDist'); + } + + public function getSource(string $identifier): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSource'); + } + + public function getRootIdentifier(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootIdentifier'); + } + + public function getBranches(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranches'); + } + + public function getTags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTags'); + } + + public function getApiUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getApiUrl'); + } + + protected function getReferences(string $type): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getReferences'); + } + + protected function fetchProject(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'fetchProject'); + } + + protected function attemptCloneFallback(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'attemptCloneFallback'); + } + + protected function generateSshUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'generateSshUrl'); + } + + protected function generatePublicUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'generatePublicUrl'); + } + + protected function setupGitDriver(string $url): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setupGitDriver'); + } + + protected function getContents(string $url, bool $fetchingRepoData = false): Response + { + \ShirabeUnsupportedClass::fail(self::class, 'getContents'); + } + + public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + public function getRepoData(): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoData'); + } + + protected function getNextPage(Response $response): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getNextPage'); + } + + protected function shouldCache(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'shouldCache'); + } + + protected function getBaseComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBaseComposerInformation'); + } + + public function hasComposerFile(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasComposerFile'); + } + + protected function getScheme(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getScheme'); + } + + public function cleanup(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/HgDriver.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/HgDriver.php new file mode 100644 index 00000000..18cf388d --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/HgDriver.php @@ -0,0 +1,106 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\Vcs\HgDriver. +// 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. +// Composer\Repository\Vcs\VcsDriver::__construct() is final, so it keeps running the real implementation here. + +namespace Composer\Repository\Vcs; + +use Composer\Config; +use Composer\IO\IOInterface; + +class HgDriver extends VcsDriver +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function getRootIdentifier(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootIdentifier'); + } + + public function getUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUrl'); + } + + public function getSource(string $identifier): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSource'); + } + + public function getDist(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDist'); + } + + public function getFileContent(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileContent'); + } + + public function getChangeDate(string $identifier): ?\DateTimeImmutable + { + \ShirabeUnsupportedClass::fail(self::class, 'getChangeDate'); + } + + public function getTags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTags'); + } + + public function getBranches(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranches'); + } + + public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + protected function shouldCache(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'shouldCache'); + } + + public function getComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerInformation'); + } + + protected function getBaseComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBaseComposerInformation'); + } + + public function hasComposerFile(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasComposerFile'); + } + + protected function getScheme(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getScheme'); + } + + protected function getContents(string $url): Response + { + \ShirabeUnsupportedClass::fail(self::class, 'getContents'); + } + + public function cleanup(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/PerforceDriver.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/PerforceDriver.php new file mode 100644 index 00000000..fbff0a56 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/PerforceDriver.php @@ -0,0 +1,117 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\Vcs\PerforceDriver. +// 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. +// Composer\Repository\Vcs\VcsDriver::__construct() is final, so it keeps running the real implementation here. + +namespace Composer\Repository\Vcs; + +use Composer\Config; +use Composer\IO\IOInterface; +use Composer\Util\Http\Response; + +class PerforceDriver extends VcsDriver +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function getFileContent(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileContent'); + } + + public function getChangeDate(string $identifier): ?\DateTimeImmutable + { + \ShirabeUnsupportedClass::fail(self::class, 'getChangeDate'); + } + + public function getRootIdentifier(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootIdentifier'); + } + + public function getBranches(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranches'); + } + + public function getTags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTags'); + } + + public function getDist(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDist'); + } + + public function getSource(string $identifier): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSource'); + } + + public function getUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUrl'); + } + + public function hasComposerFile(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasComposerFile'); + } + + public function getContents(string $url): Response + { + \ShirabeUnsupportedClass::fail(self::class, 'getContents'); + } + + public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + public function cleanup(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } + + public function getDepot(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getDepot'); + } + + public function getBranch(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranch'); + } + + protected function shouldCache(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'shouldCache'); + } + + public function getComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerInformation'); + } + + protected function getBaseComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBaseComposerInformation'); + } + + protected function getScheme(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getScheme'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/SvnDriver.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/SvnDriver.php new file mode 100644 index 00000000..3f9b1569 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/Vcs/SvnDriver.php @@ -0,0 +1,121 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\Vcs\SvnDriver. +// 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. +// Composer\Repository\Vcs\VcsDriver::__construct() is final, so it keeps running the real implementation here. + +namespace Composer\Repository\Vcs; + +use Composer\Config; +use Composer\IO\IOInterface; + +class SvnDriver extends VcsDriver +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function initialize(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function getRootIdentifier(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getRootIdentifier'); + } + + public function getUrl(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUrl'); + } + + public function getSource(string $identifier): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getSource'); + } + + public function getDist(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getDist'); + } + + protected function shouldCache(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'shouldCache'); + } + + public function getComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerInformation'); + } + + public function getFileContent(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileContent'); + } + + public function getChangeDate(string $identifier): ?\DateTimeImmutable + { + \ShirabeUnsupportedClass::fail(self::class, 'getChangeDate'); + } + + public function getTags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTags'); + } + + public function getBranches(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranches'); + } + + public static function supports(IOInterface $io, Config $config, string $url, bool $deep = false): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supports'); + } + + protected static function normalizeUrl(string $url): string + { + \ShirabeUnsupportedClass::fail(self::class, 'normalizeUrl'); + } + + protected function execute(array $command, string $url): string + { + \ShirabeUnsupportedClass::fail(self::class, 'execute'); + } + + protected function buildIdentifier(string $baseDir, int $revision): string + { + \ShirabeUnsupportedClass::fail(self::class, 'buildIdentifier'); + } + + protected function getBaseComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBaseComposerInformation'); + } + + public function hasComposerFile(string $identifier): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasComposerFile'); + } + + protected function getScheme(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getScheme'); + } + + protected function getContents(string $url): Response + { + \ShirabeUnsupportedClass::fail(self::class, 'getContents'); + } + + public function cleanup(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanup'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Repository/VcsRepository.php b/crates/shirabe-php-rpc/php/guards/Composer/Repository/VcsRepository.php new file mode 100644 index 00000000..0c3e612e --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Repository/VcsRepository.php @@ -0,0 +1,70 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Repository\VcsRepository. +// 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\Repository; + +use Composer\Repository\Vcs\VcsDriverInterface; +use Composer\Package\Loader\LoaderInterface; +use Composer\EventDispatcher\EventDispatcher; +use Composer\Util\ProcessExecutor; +use Composer\Util\HttpDownloader; +use Composer\IO\IOInterface; +use Composer\Config; + +class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInterface +{ + public function __construct(array $repoConfig, IOInterface $io, Config $config, HttpDownloader $httpDownloader, ?EventDispatcher $dispatcher = null, ?ProcessExecutor $process = null, ?array $drivers = null, ?VersionCacheInterface $versionCache = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getRepoName() + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoName'); + } + + public function getRepoConfig() + { + \ShirabeUnsupportedClass::fail(self::class, 'getRepoConfig'); + } + + public function setLoader(LoaderInterface $loader): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setLoader'); + } + + public function getDriver(): ?VcsDriverInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'getDriver'); + } + + public function hadInvalidBranches(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hadInvalidBranches'); + } + + public function getEmptyReferences(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getEmptyReferences'); + } + + public function getVersionTransportExceptions(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getVersionTransportExceptions'); + } + + protected function initialize() + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + protected function preProcess(VcsDriverInterface $driver, array $data, string $identifier): array + { + \ShirabeUnsupportedClass::fail(self::class, 'preProcess'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/AuthHelper.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/AuthHelper.php new file mode 100644 index 00000000..a17ce769 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/AuthHelper.php @@ -0,0 +1,45 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\AuthHelper. +// 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\Util; + +use Composer\Config; +use Composer\IO\IOInterface; + +class AuthHelper +{ + public function __construct(IOInterface $io, Config $config) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function storeAuth(string $origin, $storeAuth): void + { + \ShirabeUnsupportedClass::fail(self::class, 'storeAuth'); + } + + public function promptAuthIfNeeded(string $url, string $origin, int $statusCode, ?string $reason = null, array $headers = [], int $retryCount = 0, ?string $responseBody = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'promptAuthIfNeeded'); + } + + public function addAuthenticationHeader(array $headers, string $origin, string $url): array + { + \ShirabeUnsupportedClass::fail(self::class, 'addAuthenticationHeader'); + } + + public function addAuthenticationOptions(array $options, string $origin, string $url): array + { + \ShirabeUnsupportedClass::fail(self::class, 'addAuthenticationOptions'); + } + + public function isPublicBitBucketDownload(string $urlToBitBucketFile): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isPublicBitBucketDownload'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Bitbucket.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Bitbucket.php new file mode 100644 index 00000000..b85c4b45 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Bitbucket.php @@ -0,0 +1,42 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\Bitbucket. +// 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\Util; + +use Composer\IO\IOInterface; +use Composer\Config; + +class Bitbucket +{ + public const OAUTH2_ACCESS_TOKEN_URL = 'https://bitbucket.org/site/oauth2/access_token'; + + public function __construct(IOInterface $io, Config $config, ?ProcessExecutor $process = null, ?HttpDownloader $httpDownloader = null, ?int $time = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getToken(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getToken'); + } + + public function authorizeOAuth(string $originUrl): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'authorizeOAuth'); + } + + public function authorizeOAuthInteractively(string $originUrl, ?string $message = null): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'authorizeOAuthInteractively'); + } + + public function requestToken(string $originUrl, string $consumerKey, string $consumerSecret): string + { + \ShirabeUnsupportedClass::fail(self::class, 'requestToken'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/ConfigValidator.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/ConfigValidator.php new file mode 100644 index 00000000..0e35d197 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/ConfigValidator.php @@ -0,0 +1,27 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\ConfigValidator. +// 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\Util; + +use Composer\Package\Loader\ValidatingArrayLoader; +use Composer\IO\IOInterface; + +class ConfigValidator +{ + public const CHECK_VERSION = 1; + + public function __construct(IOInterface $io) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function validate(string $file, int $arrayLoaderValidationFlags = ValidatingArrayLoader::CHECK_ALL, int $flags = self::CHECK_VERSION): array + { + \ShirabeUnsupportedClass::fail(self::class, 'validate'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Filesystem.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Filesystem.php new file mode 100644 index 00000000..6d8dbb24 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Filesystem.php @@ -0,0 +1,167 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\Filesystem. +// 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\Util; + +class Filesystem +{ + public function __construct(?ProcessExecutor $executor = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function remove(string $file) + { + \ShirabeUnsupportedClass::fail(self::class, 'remove'); + } + + public function isDirEmpty(string $dir) + { + \ShirabeUnsupportedClass::fail(self::class, 'isDirEmpty'); + } + + public function emptyDirectory(string $dir, bool $ensureDirectoryExists = true) + { + \ShirabeUnsupportedClass::fail(self::class, 'emptyDirectory'); + } + + public function removeDirectory(string $directory) + { + \ShirabeUnsupportedClass::fail(self::class, 'removeDirectory'); + } + + public function removeDirectoryAsync(string $directory) + { + \ShirabeUnsupportedClass::fail(self::class, 'removeDirectoryAsync'); + } + + public function removeDirectoryPhp(string $directory) + { + \ShirabeUnsupportedClass::fail(self::class, 'removeDirectoryPhp'); + } + + public function ensureDirectoryExists(string $directory) + { + \ShirabeUnsupportedClass::fail(self::class, 'ensureDirectoryExists'); + } + + public function unlink(string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'unlink'); + } + + public function rmdir(string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'rmdir'); + } + + public function copyThenRemove(string $source, string $target) + { + \ShirabeUnsupportedClass::fail(self::class, 'copyThenRemove'); + } + + public function copy(string $source, string $target) + { + \ShirabeUnsupportedClass::fail(self::class, 'copy'); + } + + public function rename(string $source, string $target) + { + \ShirabeUnsupportedClass::fail(self::class, 'rename'); + } + + public function findShortestPath(string $from, string $to, bool $directories = false, bool $preferRelative = false) + { + \ShirabeUnsupportedClass::fail(self::class, 'findShortestPath'); + } + + public function findShortestPathCode(string $from, string $to, bool $directories = false, bool $staticCode = false, bool $preferRelative = false) + { + \ShirabeUnsupportedClass::fail(self::class, 'findShortestPathCode'); + } + + public function isAbsolutePath(string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'isAbsolutePath'); + } + + public function size(string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'size'); + } + + public function normalizePath(string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'normalizePath'); + } + + public static function trimTrailingSlash(string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'trimTrailingSlash'); + } + + public static function isLocalPath(string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'isLocalPath'); + } + + public static function getPlatformPath(string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'getPlatformPath'); + } + + public static function isReadable(string $path) + { + \ShirabeUnsupportedClass::fail(self::class, 'isReadable'); + } + + protected function directorySize(string $directory) + { + \ShirabeUnsupportedClass::fail(self::class, 'directorySize'); + } + + protected function getProcess() + { + \ShirabeUnsupportedClass::fail(self::class, 'getProcess'); + } + + public function relativeSymlink(string $target, string $link) + { + \ShirabeUnsupportedClass::fail(self::class, 'relativeSymlink'); + } + + public function isSymlinkedDirectory(string $directory) + { + \ShirabeUnsupportedClass::fail(self::class, 'isSymlinkedDirectory'); + } + + public function junction(string $target, string $junction) + { + \ShirabeUnsupportedClass::fail(self::class, 'junction'); + } + + public function isJunction(string $junction) + { + \ShirabeUnsupportedClass::fail(self::class, 'isJunction'); + } + + public function removeJunction(string $junction) + { + \ShirabeUnsupportedClass::fail(self::class, 'removeJunction'); + } + + public function filePutContentsIfModified(string $path, string $content) + { + \ShirabeUnsupportedClass::fail(self::class, 'filePutContentsIfModified'); + } + + public function safeCopy(string $source, string $target): void + { + \ShirabeUnsupportedClass::fail(self::class, 'safeCopy'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Git.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Git.php new file mode 100644 index 00000000..df78b1f1 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Git.php @@ -0,0 +1,100 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\Git. +// 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\Util; + +use Composer\Config; +use Composer\IO\IOInterface; + +class Git +{ + public function __construct(IOInterface $io, Config $config, ProcessExecutor $process, Filesystem $fs) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public static function checkForRepoOwnershipError(string $output, string $path, ?IOInterface $io = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'checkForRepoOwnershipError'); + } + + public function setHttpDownloader(HttpDownloader $httpDownloader): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setHttpDownloader'); + } + + public function runCommands(array $commands, string $url, ?string $cwd, bool $initialClone = false, &$commandOutput = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'runCommands'); + } + + public function runCommand($commandCallable, string $url, ?string $cwd, bool $initialClone = false, &$commandOutput = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'runCommand'); + } + + public function syncMirror(string $url, string $dir): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'syncMirror'); + } + + public function fetchRefOrSyncMirror(string $url, string $dir, string $ref, ?string $prettyVersion = null): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'fetchRefOrSyncMirror'); + } + + public static function getNoShowSignatureFlag(ProcessExecutor $process): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getNoShowSignatureFlag'); + } + + public static function getNoShowSignatureFlags(ProcessExecutor $process): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getNoShowSignatureFlags'); + } + + public static function supportsNoCommitHeaderFlag(ProcessExecutor $process): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'supportsNoCommitHeaderFlag'); + } + + public static function buildRevListCommand(ProcessExecutor $process, array $arguments): array + { + \ShirabeUnsupportedClass::fail(self::class, 'buildRevListCommand'); + } + + public static function parseRevListOutput(string $output, ProcessExecutor $process): string + { + \ShirabeUnsupportedClass::fail(self::class, 'parseRevListOutput'); + } + + public function getMirrorDefaultBranch(string $url, string $dir, bool $isLocalPathRepository): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getMirrorDefaultBranch'); + } + + public static function cleanEnv(?ProcessExecutor $process = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanEnv'); + } + + public static function getGitHubDomainsRegex(Config $config): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getGitHubDomainsRegex'); + } + + public static function getGitLabDomainsRegex(Config $config): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getGitLabDomainsRegex'); + } + + public static function getVersion(ProcessExecutor $process): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getVersion'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/GitHub.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/GitHub.php new file mode 100644 index 00000000..e6dadefb --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/GitHub.php @@ -0,0 +1,52 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\GitHub. +// 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\Util; + +use Composer\IO\IOInterface; +use Composer\Config; + +class GitHub +{ + public const GITHUB_TOKEN_REGEX = '{^([a-f0-9]{12,}|gh[a-z]_[a-zA-Z0-9_]+|github_pat_[a-zA-Z0-9_]+)$}'; + + public function __construct(IOInterface $io, Config $config, ?ProcessExecutor $process = null, ?HttpDownloader $httpDownloader = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function authorizeOAuth(string $originUrl): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'authorizeOAuth'); + } + + public function authorizeOAuthInteractively(string $originUrl, ?string $message = null): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'authorizeOAuthInteractively'); + } + + public function getRateLimit(array $headers): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getRateLimit'); + } + + public function getSsoUrl(array $headers): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getSsoUrl'); + } + + public function isRateLimited(array $headers): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isRateLimited'); + } + + public function requiresSso(array $headers): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'requiresSso'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/GitLab.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/GitLab.php new file mode 100644 index 00000000..4c131f61 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/GitLab.php @@ -0,0 +1,40 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\GitLab. +// 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\Util; + +use Composer\IO\IOInterface; +use Composer\Config; + +class GitLab +{ + public function __construct(IOInterface $io, Config $config, ?ProcessExecutor $process = null, ?HttpDownloader $httpDownloader = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function authorizeOAuth(string $originUrl): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'authorizeOAuth'); + } + + public function authorizeOAuthInteractively(string $scheme, string $originUrl, ?string $message = null): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'authorizeOAuthInteractively'); + } + + public function authorizeOAuthRefresh(string $scheme, string $originUrl): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'authorizeOAuthRefresh'); + } + + public function isOAuthExpired(string $originUrl): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isOAuthExpired'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/CurlDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/CurlDownloader.php new file mode 100644 index 00000000..5e362356 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/CurlDownloader.php @@ -0,0 +1,37 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\Http\CurlDownloader. +// 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\Util\Http; + +use Composer\Config; +use Composer\IO\IOInterface; + +class CurlDownloader +{ + private const BAD_MULTIPLEXING_CURL_VERSIONS = ['7.87.0', '7.88.0', '7.88.1']; + + public function __construct(IOInterface $io, Config $config, array $options = [], bool $disableTls = false) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function download(callable $resolve, callable $reject, string $origin, string $url, array $options, ?string $copyTo = null): int + { + \ShirabeUnsupportedClass::fail(self::class, 'download'); + } + + public function abortRequest(int $id): void + { + \ShirabeUnsupportedClass::fail(self::class, 'abortRequest'); + } + + public function tick(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'tick'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/CurlResponse.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/CurlResponse.php new file mode 100644 index 00000000..ae229589 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/CurlResponse.php @@ -0,0 +1,22 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\Http\CurlResponse. +// 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\Util\Http; + +class CurlResponse extends Response +{ + public function __construct(array $request, ?int $code, array $headers, ?string $body, array $curlInfo) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getCurlInfo(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getCurlInfo'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/Response.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/Response.php new file mode 100644 index 00000000..61eebb7f --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Http/Response.php @@ -0,0 +1,57 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\Http\Response. +// 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\Util\Http; + +class Response +{ + public function __construct(array $request, ?int $code, array $headers, ?string $body) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getStatusCode(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'getStatusCode'); + } + + public function getStatusMessage(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getStatusMessage'); + } + + public function getHeaders(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getHeaders'); + } + + public function getHeader(string $name): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getHeader'); + } + + public function getBody(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getBody'); + } + + public function decodeJson() + { + \ShirabeUnsupportedClass::fail(self::class, 'decodeJson'); + } + + public function collect(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'collect'); + } + + public static function findHeaderValue(array $headers, string $name): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'findHeaderValue'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/HttpDownloader.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/HttpDownloader.php new file mode 100644 index 00000000..a2fad123 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/HttpDownloader.php @@ -0,0 +1,86 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\HttpDownloader. +// 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\Util; + +use Composer\Config; +use Composer\IO\IOInterface; + +class HttpDownloader +{ + private const STATUS_QUEUED = 1; + private const STATUS_STARTED = 2; + private const STATUS_COMPLETED = 3; + private const STATUS_FAILED = 4; + private const STATUS_ABORTED = 5; + + public function __construct(IOInterface $io, Config $config, array $options = [], bool $disableTls = false) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function get(string $url, array $options = []) + { + \ShirabeUnsupportedClass::fail(self::class, 'get'); + } + + public function add(string $url, array $options = []) + { + \ShirabeUnsupportedClass::fail(self::class, 'add'); + } + + public function copy(string $url, string $to, array $options = []) + { + \ShirabeUnsupportedClass::fail(self::class, 'copy'); + } + + public function addCopy(string $url, string $to, array $options = []) + { + \ShirabeUnsupportedClass::fail(self::class, 'addCopy'); + } + + public function getOptions() + { + \ShirabeUnsupportedClass::fail(self::class, 'getOptions'); + } + + public function setOptions(array $options) + { + \ShirabeUnsupportedClass::fail(self::class, 'setOptions'); + } + + public function wait(?int $index = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'wait'); + } + + public function enableAsync(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'enableAsync'); + } + + public function countActiveJobs(?int $index = null): int + { + \ShirabeUnsupportedClass::fail(self::class, 'countActiveJobs'); + } + + public static function outputWarnings(IOInterface $io, string $url, $data): void + { + \ShirabeUnsupportedClass::fail(self::class, 'outputWarnings'); + } + + public static function getExceptionHints(\Throwable $e): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getExceptionHints'); + } + + public static function isCurlEnabled(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isCurlEnabled'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Loop.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Loop.php new file mode 100644 index 00000000..32648ece --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Loop.php @@ -0,0 +1,39 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\Loop. +// 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\Util; + +use Symfony\Component\Console\Helper\ProgressBar; + +class Loop +{ + public function __construct(HttpDownloader $httpDownloader, ?ProcessExecutor $processExecutor = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function getHttpDownloader(): HttpDownloader + { + \ShirabeUnsupportedClass::fail(self::class, 'getHttpDownloader'); + } + + public function getProcessExecutor(): ?ProcessExecutor + { + \ShirabeUnsupportedClass::fail(self::class, 'getProcessExecutor'); + } + + public function wait(array $promises, ?ProgressBar $progress = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'wait'); + } + + public function abortJobs(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'abortJobs'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Perforce.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Perforce.php new file mode 100644 index 00000000..892317b9 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Perforce.php @@ -0,0 +1,219 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\Perforce. +// 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\Util; + +use Composer\IO\IOInterface; + +class Perforce +{ + public function __construct($repoConfig, string $port, string $path, ProcessExecutor $process, bool $isWindows, IOInterface $io) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public static function create($repoConfig, string $port, string $path, ProcessExecutor $process, IOInterface $io): self + { + \ShirabeUnsupportedClass::fail(self::class, 'create'); + } + + public static function checkServerExists(string $url, ProcessExecutor $processExecutor): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'checkServerExists'); + } + + public function initialize($repoConfig): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initialize'); + } + + public function initializeDepotAndBranch(?string $depot, ?string $branch): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initializeDepotAndBranch'); + } + + public function generateUniquePerforceClientName(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'generateUniquePerforceClientName'); + } + + public function cleanupClientSpec(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanupClientSpec'); + } + + protected function executeCommand($command): int + { + \ShirabeUnsupportedClass::fail(self::class, 'executeCommand'); + } + + public function getClient(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getClient'); + } + + protected function getPath(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPath'); + } + + public function initializePath(string $path): void + { + \ShirabeUnsupportedClass::fail(self::class, 'initializePath'); + } + + protected function getPort(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPort'); + } + + public function setStream(string $stream): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setStream'); + } + + public function isStream(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isStream'); + } + + public function getStream(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getStream'); + } + + public function getStreamWithoutLabel(string $stream): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getStreamWithoutLabel'); + } + + public function getP4ClientSpec(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getP4ClientSpec'); + } + + public function getUser(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUser'); + } + + public function setUser(?string $user): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setUser'); + } + + public function queryP4User(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'queryP4User'); + } + + protected function getP4variable(string $name): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getP4variable'); + } + + public function queryP4Password(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'queryP4Password'); + } + + public function generateP4Command(array $arguments, bool $useClient = true): array + { + \ShirabeUnsupportedClass::fail(self::class, 'generateP4Command'); + } + + public function isLoggedIn(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isLoggedIn'); + } + + public function connectClient(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'connectClient'); + } + + public function syncCodeBase(?string $sourceReference): void + { + \ShirabeUnsupportedClass::fail(self::class, 'syncCodeBase'); + } + + public function writeClientSpecToFile($spec): void + { + \ShirabeUnsupportedClass::fail(self::class, 'writeClientSpecToFile'); + } + + public function writeP4ClientSpec(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'writeP4ClientSpec'); + } + + protected function read($pipe, $name): void + { + \ShirabeUnsupportedClass::fail(self::class, 'read'); + } + + public function windowsLogin(?string $password): int + { + \ShirabeUnsupportedClass::fail(self::class, 'windowsLogin'); + } + + public function p4Login(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'p4Login'); + } + + public function getComposerInformation(string $identifier): ?array + { + \ShirabeUnsupportedClass::fail(self::class, 'getComposerInformation'); + } + + public function getFileContent(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFileContent'); + } + + public function getFilePath(string $file, string $identifier): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'getFilePath'); + } + + public function getBranches(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getBranches'); + } + + public function getTags(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getTags'); + } + + public function checkStream(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'checkStream'); + } + + protected function getChangeList(string $reference): mixed + { + \ShirabeUnsupportedClass::fail(self::class, 'getChangeList'); + } + + public function getCommitLogs(string $fromReference, string $toReference): mixed + { + \ShirabeUnsupportedClass::fail(self::class, 'getCommitLogs'); + } + + public function getFilesystem(): Filesystem + { + \ShirabeUnsupportedClass::fail(self::class, 'getFilesystem'); + } + + public function setFilesystem(Filesystem $fs): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setFilesystem'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Platform.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Platform.php new file mode 100644 index 00000000..2384723d --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Platform.php @@ -0,0 +1,92 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\Platform. +// 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\Util; + +class Platform +{ + public function __construct() + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public static function getCwd(bool $allowEmpty = false): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getCwd'); + } + + public static function realpath(string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'realpath'); + } + + public static function getEnv(string $name) + { + \ShirabeUnsupportedClass::fail(self::class, 'getEnv'); + } + + public static function putEnv(string $name, string $value): void + { + \ShirabeUnsupportedClass::fail(self::class, 'putEnv'); + } + + public static function clearEnv(string $name): void + { + \ShirabeUnsupportedClass::fail(self::class, 'clearEnv'); + } + + public static function expandPath(string $path): string + { + \ShirabeUnsupportedClass::fail(self::class, 'expandPath'); + } + + public static function getUserDirectory(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUserDirectory'); + } + + public static function isWindowsSubsystemForLinux(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isWindowsSubsystemForLinux'); + } + + public static function isWindows(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isWindows'); + } + + public static function isDocker(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isDocker'); + } + + public static function strlen(string $str): int + { + \ShirabeUnsupportedClass::fail(self::class, 'strlen'); + } + + public static function isTty($fd = null): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isTty'); + } + + public static function isInputCompletionProcess(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'isInputCompletionProcess'); + } + + public static function workaroundFilesystemIssues(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'workaroundFilesystemIssues'); + } + + public static function getDevNull(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getDevNull'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/ProcessExecutor.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/ProcessExecutor.php new file mode 100644 index 00000000..405905e8 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/ProcessExecutor.php @@ -0,0 +1,114 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\ProcessExecutor. +// 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\Util; + +use Composer\IO\IOInterface; +use React\Promise\PromiseInterface; + +class ProcessExecutor +{ + private const STATUS_QUEUED = 1; + private const STATUS_STARTED = 2; + private const STATUS_COMPLETED = 3; + private const STATUS_FAILED = 4; + private const STATUS_ABORTED = 5; + private const BUILTIN_CMD_COMMANDS = [ + 'assoc', 'break', 'call', 'cd', 'chdir', 'cls', 'color', 'copy', 'date', + 'del', 'dir', 'echo', 'endlocal', 'erase', 'exit', 'for', 'ftype', 'goto', + 'help', 'if', 'label', 'md', 'mkdir', 'mklink', 'move', 'path', 'pause', + 'popd', 'prompt', 'pushd', 'rd', 'rem', 'ren', 'rename', 'rmdir', 'set', + 'setlocal', 'shift', 'start', 'time', 'title', 'type', 'ver', 'vol', + ]; + private const GIT_CMDS_NEED_GIT_DIR = [ + ['show'], + ['log'], + ['branch'], + ['remote', 'set-url'], + ]; + + public function __construct(?IOInterface $io = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function execute($command, &$output = null, ?string $cwd = null): int + { + \ShirabeUnsupportedClass::fail(self::class, 'execute'); + } + + public function executeTty($command, ?string $cwd = null): int + { + \ShirabeUnsupportedClass::fail(self::class, 'executeTty'); + } + + public function executeAsync($command, ?string $cwd = null): PromiseInterface + { + \ShirabeUnsupportedClass::fail(self::class, 'executeAsync'); + } + + protected function outputHandler(string $type, string $buffer): void + { + \ShirabeUnsupportedClass::fail(self::class, 'outputHandler'); + } + + public function setMaxJobs(int $maxJobs): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setMaxJobs'); + } + + public function resetMaxJobs(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'resetMaxJobs'); + } + + public function wait($index = null): void + { + \ShirabeUnsupportedClass::fail(self::class, 'wait'); + } + + public function enableAsync(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'enableAsync'); + } + + public function countActiveJobs($index = null): int + { + \ShirabeUnsupportedClass::fail(self::class, 'countActiveJobs'); + } + + public function splitLines(?string $output): array + { + \ShirabeUnsupportedClass::fail(self::class, 'splitLines'); + } + + public function getErrorOutput(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getErrorOutput'); + } + + public static function getTimeout(): int + { + \ShirabeUnsupportedClass::fail(self::class, 'getTimeout'); + } + + public static function setTimeout(int $timeout): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setTimeout'); + } + + public static function escape($argument): string + { + \ShirabeUnsupportedClass::fail(self::class, 'escape'); + } + + public function requiresGitDirEnv($command): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'requiresGitDirEnv'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/RemoteFilesystem.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/RemoteFilesystem.php new file mode 100644 index 00000000..3cf20768 --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/RemoteFilesystem.php @@ -0,0 +1,85 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\RemoteFilesystem. +// 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\Util; + +use Composer\Config; +use Composer\IO\IOInterface; + +class RemoteFilesystem +{ + public function __construct(IOInterface $io, Config $config, array $options = [], bool $disableTls = false, ?AuthHelper $authHelper = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public function copy(string $originUrl, string $fileUrl, string $fileName, bool $progress = true, array $options = []) + { + \ShirabeUnsupportedClass::fail(self::class, 'copy'); + } + + public function getContents(string $originUrl, string $fileUrl, bool $progress = true, array $options = []) + { + \ShirabeUnsupportedClass::fail(self::class, 'getContents'); + } + + public function getOptions() + { + \ShirabeUnsupportedClass::fail(self::class, 'getOptions'); + } + + public function setOptions(array $options) + { + \ShirabeUnsupportedClass::fail(self::class, 'setOptions'); + } + + public function isTlsDisabled() + { + \ShirabeUnsupportedClass::fail(self::class, 'isTlsDisabled'); + } + + public function getLastHeaders() + { + \ShirabeUnsupportedClass::fail(self::class, 'getLastHeaders'); + } + + public static function findStatusCode(array $headers) + { + \ShirabeUnsupportedClass::fail(self::class, 'findStatusCode'); + } + + public function findStatusMessage(array $headers) + { + \ShirabeUnsupportedClass::fail(self::class, 'findStatusMessage'); + } + + protected function get(string $originUrl, string $fileUrl, array $additionalOptions = [], ?string $fileName = null, bool $progress = true) + { + \ShirabeUnsupportedClass::fail(self::class, 'get'); + } + + protected function getRemoteContents(string $originUrl, string $fileUrl, $context, ?array &$responseHeaders = null, ?int $maxFileSize = null) + { + \ShirabeUnsupportedClass::fail(self::class, 'getRemoteContents'); + } + + protected function callbackGet(int $notificationCode, int $severity, ?string $message, int $messageCode, int $bytesTransferred, int $bytesMax) + { + \ShirabeUnsupportedClass::fail(self::class, 'callbackGet'); + } + + protected function promptAuthAndRetry($httpStatus, ?string $reason = null, array $headers = []) + { + \ShirabeUnsupportedClass::fail(self::class, 'promptAuthAndRetry'); + } + + protected function getOptionsForUrl(string $originUrl, array $additionalOptions) + { + \ShirabeUnsupportedClass::fail(self::class, 'getOptionsForUrl'); + } +} diff --git a/crates/shirabe-php-rpc/php/guards/Composer/Util/Svn.php b/crates/shirabe-php-rpc/php/guards/Composer/Util/Svn.php new file mode 100644 index 00000000..c113296d --- /dev/null +++ b/crates/shirabe-php-rpc/php/guards/Composer/Util/Svn.php @@ -0,0 +1,82 @@ +<?php + +// Generated by scripts/plugin-stub-generator; do not edit by hand. +// Guard for Composer\Util\Svn. +// 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\Util; + +use Composer\Config; +use Composer\IO\IOInterface; + +class Svn +{ + private const MAX_QTY_AUTH_TRIES = 5; + + public function __construct(string $url, IOInterface $io, Config $config, ?ProcessExecutor $process = null) + { + \ShirabeUnsupportedClass::fail(self::class, '__construct'); + } + + public static function cleanEnv(): void + { + \ShirabeUnsupportedClass::fail(self::class, 'cleanEnv'); + } + + public function execute(array $command, string $url, ?string $cwd = null, ?string $path = null, bool $verbose = false): string + { + \ShirabeUnsupportedClass::fail(self::class, 'execute'); + } + + public function executeLocal(array $command, string $path, ?string $cwd = null, bool $verbose = false): string + { + \ShirabeUnsupportedClass::fail(self::class, 'executeLocal'); + } + + public function setCacheCredentials(bool $cacheCredentials): void + { + \ShirabeUnsupportedClass::fail(self::class, 'setCacheCredentials'); + } + + protected function doAuthDance(): Svn + { + \ShirabeUnsupportedClass::fail(self::class, 'doAuthDance'); + } + + protected function getCommand(array $cmd, string $url, ?string $path = null): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getCommand'); + } + + protected function getCredentialArgs(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getCredentialArgs'); + } + + protected function getPassword(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getPassword'); + } + + protected function getUsername(): string + { + \ShirabeUnsupportedClass::fail(self::class, 'getUsername'); + } + + protected function hasAuth(): bool + { + \ShirabeUnsupportedClass::fail(self::class, 'hasAuth'); + } + + protected function getAuthCacheArgs(): array + { + \ShirabeUnsupportedClass::fail(self::class, 'getAuthCacheArgs'); + } + + public function binaryVersion(): ?string + { + \ShirabeUnsupportedClass::fail(self::class, 'binaryVersion'); + } +} diff --git a/crates/shirabe-php-rpc/php/worker.php b/crates/shirabe-php-rpc/php/worker.php index d5fe67d4..ce75f9d1 100644 --- a/crates/shirabe-php-rpc/php/worker.php +++ b/crates/shirabe-php-rpc/php/worker.php @@ -30,6 +30,23 @@ interface ShirabeRustStub public function __shirabeBind(int $rhandle, int $epoch): void; } +/** + * Raised by the guard classes (php/guards/): classes whose entity lives on the Rust side but that + * this worker has no proxy for. Their declaration shadows the real Composer one, so running the + * real implementation here — on an instance the Rust side never sees — fails loudly instead. + */ +final class ShirabeUnsupportedClass +{ + public static function fail(string $class, string $member): void + { + throw new RuntimeException( + "{$class}::{$member}() is not available in the plugin runtime: the Rust side owns " + . 'this class and there is no proxy for it here, so the real implementation would ' + . 'run on an instance the Rust side never sees.' + ); + } +} + /** Interns proxy stubs so the same Rust handle always yields the same stub instance. */ final class ShirabeRustObjectRegistry { @@ -44,7 +61,9 @@ final class ShirabeRustObjectRegistry return $existing; } } - if (!class_exists($class)) { + // A guard class exists for every proxied FQCN without a stub, so class_exists() alone no + // longer tells the two apart; only a stub can be bound to a Rust handle. + if (!class_exists($class) || !is_a($class, ShirabeRustStub::class, true)) { throw new RuntimeException( "no proxy stub class is available for {$class}" ); @@ -143,6 +162,7 @@ final class ShirabeRpcRuntime /** @var resource */ public static $socket; public static ?string $stubsDir = null; + public static ?string $guardsDir = null; /** @var ?callable(string): void */ public static $stubAutoloader = null; /** @var array<string, callable(array): mixed> */ @@ -439,18 +459,20 @@ if ($client === false) { stream_set_write_buffer($client, 0); ShirabeRpcRuntime::$socket = $client; ShirabeRpcRuntime::$stubsDir = $argv[2] ?? null; +ShirabeRpcRuntime::$guardsDir = $argv[3] ?? null; // Proxy stub classes take priority over any other autoloader (including autoloaders that a // script or the composer runtime registers later), so a proxied FQCN can never be shadowed by // the real implementation. `__shirabe_require` re-prepends this closure after loading code -// that registers its own prepending autoloader. +// that registers its own prepending autoloader. The guards come after the stubs: they cover the +// Rust-owned classes no stub proxies, so the two directories never hold the same FQCN. ShirabeRpcRuntime::$stubAutoloader = static function (string $class): void { - if (ShirabeRpcRuntime::$stubsDir === null) { - return; - } - $file = ShirabeRpcRuntime::$stubsDir . '/' . str_replace('\\', '/', $class) . '.php'; - if (is_file($file)) { - require $file; + $relative = '/' . str_replace('\\', '/', $class) . '.php'; + foreach ([ShirabeRpcRuntime::$stubsDir, ShirabeRpcRuntime::$guardsDir] as $dir) { + if ($dir !== null && is_file($dir . $relative)) { + require $dir . $relative; + return; + } } }; spl_autoload_register(ShirabeRpcRuntime::$stubAutoloader, true, true); diff --git a/crates/shirabe-php-rpc/src/lib.rs b/crates/shirabe-php-rpc/src/lib.rs index 34c3961d..d818b364 100644 --- a/crates/shirabe-php-rpc/src/lib.rs +++ b/crates/shirabe-php-rpc/src/lib.rs @@ -1035,6 +1035,13 @@ const RUNTIME_FILES: &[(&str, &str)] = &[ ), ]; +/// Guard classes made autoloadable inside the worker, behind the stubs: they shadow the real +/// Composer class of every Rust-owned FQCN no stub proxies, so the worker cannot fall through to +/// the real implementation and run an instance the Rust side never sees. Generated by +/// `scripts/plugin-stub-generator/generate-stubs`; too many to spell out here, so `build.rs` +/// builds the list from the directory itself. +const GUARD_FILES: &[(&str, &str)] = include!(concat!(env!("OUT_DIR"), "/guard-files.rs")); + struct Worker { stream: UnixStream, // Also queried for its exit status when a socket read/write fails, to tell a dead worker @@ -1106,9 +1113,15 @@ fn spawn_worker() -> anyhow::Result<Worker> { std::fs::write(&script_path, GLUE_SCRIPT)?; let stubs_dir = tempdir.path().join("stubs"); - for (relative_path, contents) in STUB_FILES.iter().chain(RUNTIME_FILES) { - let path = stubs_dir.join(relative_path); - std::fs::create_dir_all(path.parent().expect("stub paths have a parent"))?; + let guards_dir = tempdir.path().join("guards"); + let files = STUB_FILES + .iter() + .chain(RUNTIME_FILES) + .map(|entry| (&stubs_dir, entry)) + .chain(GUARD_FILES.iter().map(|entry| (&guards_dir, entry))); + for (dir, (relative_path, contents)) in files { + let path = dir.join(relative_path); + std::fs::create_dir_all(path.parent().expect("generated class paths have a parent"))?; std::fs::write(&path, contents)?; } @@ -1141,7 +1154,8 @@ fn spawn_worker() -> anyhow::Result<Worker> { command .arg(&script_path) .arg(WORKER_SOCKET_FD.to_string()) - .arg(&stubs_dir); + .arg(&stubs_dir) + .arg(&guards_dir); // SAFETY: the closure only calls async-signal-safe syscalls, as required between fork and // exec. It owns the child end, so the descriptor stays alive until the exec happens. unsafe { diff --git a/crates/shirabe-php-rpc/tests/generated_stubs.rs b/crates/shirabe-php-rpc/tests/generated_stubs.rs index 0980745e..5648b44c 100644 --- a/crates/shirabe-php-rpc/tests/generated_stubs.rs +++ b/crates/shirabe-php-rpc/tests/generated_stubs.rs @@ -1,6 +1,6 @@ -//! Freshness check for the generated proxy stubs: `generate-stubs --check` verifies that the -//! committed stub files and the `STUB_FILES` list in `lib.rs` match what the generator emits -//! from the current Composer checkout and classifier report. +//! Freshness check for the generated proxy stubs and guard classes: `generate-stubs --check` +//! verifies that the committed stub and guard files, and the `STUB_FILES` list in `lib.rs`, match +//! what the generator emits from the current Composer checkout and classifier report. //! //! The generator needs a PHP interpreter, its composer vendor directory and the classifier //! report; when any of those is missing the test returns early, following the non-mock test diff --git a/crates/shirabe/src/installer.rs b/crates/shirabe/src/installer.rs index 9b4a84e8..ee60f59f 100644 --- a/crates/shirabe/src/installer.rs +++ b/crates/shirabe/src/installer.rs @@ -273,7 +273,7 @@ impl Installer { self.dev_mode, vec![], IndexMap::new(), - ); + )?; } self.download_manager @@ -469,7 +469,7 @@ impl Installer { self.dev_mode, vec![], IndexMap::new(), - ); + )?; } let audit_config = self.get_audit_config()?.clone(); diff --git a/crates/shirabe/tests/plugin/e2e_extension_installer_test.rs b/crates/shirabe/tests/plugin/e2e_extension_installer_test.rs index 9a95888c..0465757a 100644 --- a/crates/shirabe/tests/plugin/e2e_extension_installer_test.rs +++ b/crates/shirabe/tests/plugin/e2e_extension_installer_test.rs @@ -117,6 +117,10 @@ fn run_install(work: &Path, program: &str, args: &[&str]) -> InstallRun { } } +// TODO(plugin): the plugin's post-install listener does `new Composer\Util\Filesystem()`, and +// the guard class the worker loads for that FQCN raises an explicit error: the Rust side owns +// Filesystem and has no proxy for plugin-constructed instances of it. +#[ignore = "Filesystem is Rust-owned and has no proxy the plugin can construct; see the TODO(plugin) above"] #[test] fn test_extension_installer_install_matches_upstream_composer() { if !php_runtime_available() { diff --git a/crates/shirabe/tests/plugin/e2e_installers_test.rs b/crates/shirabe/tests/plugin/e2e_installers_test.rs index 67c51b5c..9d8693fb 100644 --- a/crates/shirabe/tests/plugin/e2e_installers_test.rs +++ b/crates/shirabe/tests/plugin/e2e_installers_test.rs @@ -99,6 +99,11 @@ fn edit(path: &Path, from: &str, to: &str) { std::fs::write(path, text.replace(from, to)).unwrap(); } +// TODO(plugin): the plugin's Installer extends Composer\Installer\LibraryInstaller, whose +// constructor the guard class the worker loads rejects with an explicit error: the Rust side owns +// LibraryInstaller and has no proxy a plugin can subclass. The same applies to the two tests +// below. +#[ignore = "LibraryInstaller is Rust-owned and has no proxy a plugin can subclass; see the TODO(plugin) above"] #[test] fn test_composer_installers_matches_upstream_composer() { if !php_runtime_available() || !plugin_fetched() { @@ -139,6 +144,7 @@ fn test_composer_installers_matches_upstream_composer() { /// The rest of the installer contract: `update` reinstalls a package in place, a second `install` /// runs over an already-installed tree, and `remove` reaches the plugin's own `uninstall()` /// override — the one that chains onto the promise `LibraryInstaller::uninstall` returns. +#[ignore = "LibraryInstaller is Rust-owned and has no proxy a plugin can subclass; see the TODO(plugin) above"] #[test] fn test_composer_installers_update_and_remove_match_upstream_composer() { if !php_runtime_available() || !plugin_fetched() { @@ -203,6 +209,7 @@ fn test_composer_installers_update_and_remove_match_upstream_composer() { /// The plugin's configuration surface: `installer-paths` in the root package's extra (both the /// `type:` and the package-name matcher, with `{$name}` templating) and `installer-name` in the /// installed package's own extra. Both are read back through the package proxy. +#[ignore = "LibraryInstaller is Rust-owned and has no proxy a plugin can subclass; see the TODO(plugin) above"] #[test] fn test_composer_installers_custom_paths_match_upstream_composer() { if !php_runtime_available() || !plugin_fetched() { diff --git a/crates/shirabe/tests/plugin/e2e_normalize_test.rs b/crates/shirabe/tests/plugin/e2e_normalize_test.rs index ccfdb596..9fb49bab 100644 --- a/crates/shirabe/tests/plugin/e2e_normalize_test.rs +++ b/crates/shirabe/tests/plugin/e2e_normalize_test.rs @@ -1,7 +1,7 @@ //! ergebnis/composer-normalize E2E compatibility check: upstream Composer and Shirabe each -//! install the pinned plugin (with its real dependency tree) and the `list`/`help` renderings -//! of its command are compared; the execution comparison is present but ignored until the -//! worker can construct a second native Composer instance. +//! install the pinned plugin (with its real dependency tree); the `list`/`help` renderings of its +//! command are compared, as is running the command. Both comparisons are ignored, each for the +//! reason recorded on it. //! //! Prerequisites: the PHP runtime, the Composer checkout, and the pinned packages in //! `fixtures/e2e-normalize/ext/` — run `fixtures/e2e-normalize/fetch` once to populate it. @@ -60,6 +60,10 @@ fn normalize_lines(stdout: &str) -> Vec<&str> { .collect() } +// TODO(plugin): NormalizePlugin::getCommands() does `new Composer\Factory()`, and the guard +// class the worker loads for that FQCN raises an explicit error: Factory has no counterpart the +// worker can run, so the plugin's command never reaches the command list. +#[ignore = "the plugin's command provider constructs Composer\\Factory, which the worker has no counterpart for; see the TODO(plugin) above"] #[test] fn test_normalize_listing_matches_upstream_composer() { if !php_runtime_available() { diff --git a/docs/dev/php-rpc.md b/docs/dev/php-rpc.md index b1c992d7..f91b8e54 100644 --- a/docs/dev/php-rpc.md +++ b/docs/dev/php-rpc.md @@ -185,7 +185,7 @@ allocates the Rust entity behind a `new SomeProxiedClass(...)` written by plugin answers with `[rhandle, epoch]`. Classes whose entity Rust cannot build are an explicit error naming the class. -## Proxy stubs and runtime classes +## Proxy stubs, runtime classes and guards `php/stubs/` holds the proxy stub classes (`Composer\Script\Event`, `Composer\PartialComposer`, `Composer\Composer`, the `Composer\IO\{BaseIO,ConsoleIO,BufferIO,NullIO}` hierarchy, the @@ -215,8 +215,14 @@ by `scripts/plugin-stub-generator/generate-stubs` and must not be edited by hand here) is a faithful in-process port of the real base class and crosses the wire as a P-table entity (`__shirabeRustHandleDescriptor()` returns null in native mode). -Both sets are written into the same autoload directory at worker spawn and resolved with -highest priority, so these FQCNs can never be shadowed by the real implementation; +`php/guards/` holds the guard classes: one per Composer class whose entity lives on the Rust side +and that neither a stub nor a runtime class shadows. A guard keeps the FQCN, the hierarchy and the +constants of the real class, and raises an explicit error from its constructor and every method, +so code running here can never work on a second instance the Rust side never sees. They are +generated by the same tool as the stubs. + +The three sets are written into two autoload directories at worker spawn (guards behind stubs) and +resolved with highest priority, so these FQCNs can never be shadowed by the real implementation; `__shirabe_require` restores that priority after loading code that prepends its own autoloader. Stubs are interned per rhandle (`WeakReference`-based registry) so identity (`===`) holds, and their destructors send `ReleaseRustHandle`. Reviving a stub for an existing entity bypasses its diff --git a/docs/dev/plugin-class-classification.md b/docs/dev/plugin-class-classification.md index c77eca52..7046ea48 100644 --- a/docs/dev/plugin-class-classification.md +++ b/docs/dev/plugin-class-classification.md @@ -42,6 +42,12 @@ exactly one category. | `php-native` | PHP | the real, unmodified PHP source | none — Rust may or may not have its own port for internal use, and that port is free to diverge in shape | | `unsupported` | n/a | nothing; any reference raises an explicit error | none, until explicitly promoted | +A Rust-owned class the child has no artifact for — every `unsupported` one, and +every `rust-proxy`/`rust-snapshot` one whose stub is not written yet — is +shadowed there by a generated *guard* class instead of the real Composer source: +same FQCN, hierarchy and constants, every constructor and method an explicit +error. See `docs/dev/plugin-stub-generation.md`. + #### rust-proxy The living services: `Composer`, `Config`, `RepositoryManager`, diff --git a/docs/dev/plugin-stub-generation.md b/docs/dev/plugin-stub-generation.md index 68dde156..e2b6d848 100644 --- a/docs/dev/plugin-stub-generation.md +++ b/docs/dev/plugin-stub-generation.md @@ -1,4 +1,4 @@ -# Plugin proxy stub generation +# Plugin proxy stub and guard generation ## Purpose @@ -12,13 +12,21 @@ Composer sources keeps every stub signature mechanically faithful to the real class and turns "the stub is missing something the real class has" into a generation failure instead of silent breakage. +The same tool emits the **guard classes** under +`crates/shirabe-php-rpc/php/guards/`, one for every Rust-owned class no stub and +no `php/runtime/` class shadows. Without them the worker's autoloader falls +through to the real Composer implementation, and code running there works on a +second instance the Rust side never sees — silent breakage in place of the +explicit error an unimplemented plugin API is supposed to raise. `build.rs` +embeds the guards, building the list from the directory itself. + ## Running ``` cd scripts/plugin-stub-generator composer install # once; vendor/ is git-ignored -./generate-stubs # rewrites crates/shirabe-php-rpc/php/stubs/ -./generate-stubs --check # verifies committed stubs are fresh; exit 1 otherwise +./generate-stubs # rewrites the stubs/ and guards/ directories +./generate-stubs --check # verifies committed files are fresh; exit 1 otherwise ``` Inputs: @@ -36,10 +44,19 @@ Inputs: interfaces from vendor packages (e.g. `Psr\Log\LoggerInterface`) resolve too. * the classifier report (`scripts/plugin-class-classifier/report.json`, override with `--report=`). Run `scripts/plugin-class-classifier/classify` first; the - report is git-ignored. Every target must be classified `rust-proxy` or - `contract`, and a report with classification violations is rejected. + report is git-ignored. Every stub target must be classified `rust-proxy` or + `contract`, and a report with classification violations is rejected. The guard + set is read from the report alone: every `rust-proxy`, `rust-snapshot` and + `unsupported` class that is not a stub target, a `php/runtime/` class or an + exemption. +* `guard-exemptions.list` — the Rust-owned FQCNs that stay resolvable to the real + Composer class, each with the worker-side mechanism that makes a native + instance correct (the materialized-value codec for `Composer\Package\Link`, + the dual-mode `Composer\EventDispatcher\Event` for + `Composer\Plugin\PreCommandRunEvent`). An entry that needs no guard anyway + fails the run. -The freshness check runs in `cargo test` as +The freshness check for both sets runs in `cargo test` as `crates/shirabe-php-rpc/tests/generated_stubs.rs`; it returns early when PHP, the generator's vendor directory or the classifier report is unavailable. @@ -93,6 +110,27 @@ the generator's vendor directory or the classifier report is unavailable. order, restricted to names the emitted stub references; signatures declared elsewhere (interface files) are re-spelled through that import table. +## What a guard looks like + +A guard reproduces the real class's declaration — `abstract`/`final`, `extends`, +`implements`, the constants and public static properties verbatim — so that +references satisfied by the declaration alone keep working: `instanceof`, +`catch`, `X::class`, `Link::TYPE_REQUIRE`. Everything executable raises +`ShirabeUnsupportedClass::fail()`, which names the class and the member: + +* the constructor (the class's own, or the one it would inherit; a class whose + hierarchy declares none gets a no-argument one, so the implicit constructor + cannot be reached either), +* every public and protected method the guard would otherwise inherit from real + code: its own, its traits', and those of ancestors up to the first one that is + itself guarded or shadowed by a stub. Private methods are reachable only from + the code the guard replaces, and a destructor that throws would fire during + unwinding, so neither is emitted. + +Abstract methods of an abstract guard stay abstract. A method an ancestor +declares `final` cannot be redeclared, so it keeps running the real +implementation; the guard's header names each one. + ## Coverage assertions Generation fails — instead of emitting something quietly wrong — on: @@ -107,7 +145,7 @@ Generation fails — instead of emitting something quietly wrong — on: * a target whose FQCN is also provided by `php/runtime/`. `generate-stubs` (in both modes) additionally fails when a `.php` file exists -under the stubs directory that no target produces, or when `STUB_FILES` / +under the stubs or guards directory that no target produces, or when `STUB_FILES` / `RUNTIME_FILES` in `crates/shirabe-php-rpc/src/lib.rs` does not embed every generated stub / runtime file. It also cross-checks the handoff property table for `Composer\Console\Application` (declared in `generate-stubs` itself) against diff --git a/scripts/plugin-stub-generator/generate-stubs b/scripts/plugin-stub-generator/generate-stubs index 5db83a27..c58e6a92 100755 --- a/scripts/plugin-stub-generator/generate-stubs +++ b/scripts/plugin-stub-generator/generate-stubs @@ -7,6 +7,8 @@ require __DIR__ . '/vendor/autoload.php'; use Shirabe\PluginStubGenerator\GenerationError; use Shirabe\PluginStubGenerator\Generator; +use Shirabe\PluginStubGenerator\GuardGenerator; +use Shirabe\PluginStubGenerator\NamePrinter; use Shirabe\PluginStubGenerator\Project; use Shirabe\PluginStubGenerator\Report; @@ -14,6 +16,7 @@ $repoRoot = dirname(__DIR__, 2); $composerRoot = $repoRoot . '/composer'; $reportPath = $repoRoot . '/scripts/plugin-class-classifier/report.json'; $stubsDir = $repoRoot . '/crates/shirabe-php-rpc/php/stubs'; +$guardsDir = $repoRoot . '/crates/shirabe-php-rpc/php/guards'; $libRs = $repoRoot . '/crates/shirabe-php-rpc/src/lib.rs'; $check = false; @@ -24,21 +27,31 @@ foreach (array_slice($argv, 1) as $arg) { $reportPath = substr($arg, strlen('--report=')); } elseif (str_starts_with($arg, '--stubs-dir=')) { $stubsDir = substr($arg, strlen('--stubs-dir=')); + } elseif (str_starts_with($arg, '--guards-dir=')) { + $guardsDir = substr($arg, strlen('--guards-dir=')); } elseif ($arg === '--check') { $check = true; } else { - fwrite(STDERR, "usage: generate-stubs [--composer-root=DIR] [--report=FILE] [--stubs-dir=DIR] [--check]\n"); + fwrite(STDERR, "usage: generate-stubs [--composer-root=DIR] [--report=FILE] [--stubs-dir=DIR]" + . " [--guards-dir=DIR] [--check]\n"); exit(2); } } -$targets = []; -foreach (file(__DIR__ . '/targets.list', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line) { - $line = trim($line); - if ($line !== '' && !str_starts_with($line, '#')) { - $targets[] = $line; +/** @return list<string> */ +$readList = static function (string $path): array { + $entries = []; + foreach (file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) as $line) { + $line = trim($line); + if ($line !== '' && !str_starts_with($line, '#')) { + $entries[] = $line; + } } -} + return $entries; +}; + +$targets = $readList(__DIR__ . '/targets.list'); +$exemptions = $readList(__DIR__ . '/guard-exemptions.list'); // Hand-written dual-mode classes (php/runtime/) resolve through the same worker autoloader as // the generated stubs; the generator must know them so they can serve as stub base classes and @@ -61,9 +74,45 @@ if (is_dir($runtimeDir)) { sort($runtimeProvided); sort($runtimeFiles); +$problems = []; +$report = Report::load($reportPath); +$project = new Project($composerRoot); + +// Every class the Rust side owns and neither a stub nor a runtime class shadows gets a guard, so +// that the worker cannot fall through to the real implementation and run a second instance. +// Exempt entries stay real because the worker has a mechanism that makes a native instance +// correct; each one is justified where it is listed. +$exempt = array_flip($exemptions); +$guardTargets = []; +foreach ($report->inCategories(['rust-proxy', 'rust-snapshot', 'unsupported']) as $fqcn) { + if (in_array($fqcn, $targets, true) || in_array($fqcn, $runtimeProvided, true)) { + continue; + } + if (isset($exempt[$fqcn])) { + unset($exempt[$fqcn]); + continue; + } + if ($report->kind($fqcn) !== 'class') { + $problems[] = "$fqcn is a {$report->kind($fqcn)} in a Rust-owned category; a guard can only" + . ' shadow a class'; + continue; + } + $guardTargets[] = $fqcn; +} +foreach (array_keys($exempt) as $fqcn) { + $problems[] = "stale guard exemption in guard-exemptions.list: $fqcn needs no guard"; +} + try { - $generator = new Generator($composerRoot, Report::load($reportPath), $targets, $runtimeProvided); + $generator = new Generator($composerRoot, $report, $targets, $runtimeProvided); $files = $generator->generate(); + $guardGenerator = new GuardGenerator( + $project, + new NamePrinter(), + $guardTargets, + array_merge($targets, $runtimeProvided), + ); + $guardFiles = $guardGenerator->generate(); } catch (GenerationError $e) { foreach ($e->errors as $error) { fwrite(STDERR, "error: $error\n"); @@ -71,8 +120,6 @@ try { exit(1); } -$problems = []; - // Handoff classification of Composer\Console\Application's declared properties. The worker-side // runtime definition (php/runtime/Composer/Console/Application.php) hands off exactly the state // a plugin-visible application exposes; a property the upstream class declares and this table @@ -87,7 +134,7 @@ $applicationPropertyTable = [ 'hasPluginCommands' => 'rust-local', // Rust-side runtime state, never shared 'logo' => 'static-config', // static rendering data, the worker never needs it ]; -$applicationFile = (new Project($composerRoot))->sourceFor('Composer\\Console\\Application'); +$applicationFile = $project->sourceFor('Composer\\Console\\Application'); $declaredProperties = []; foreach ($applicationFile->classLike->getProperties() as $property) { foreach ($property->props as $prop) { @@ -105,14 +152,23 @@ foreach ($applicationPropertyTable as $name => $_) { } } -$iterator = new RecursiveIteratorIterator( - new RecursiveDirectoryIterator($stubsDir, FilesystemIterator::SKIP_DOTS) -); -foreach ($iterator as $entry) { - if ($entry->isFile() && str_ends_with($entry->getFilename(), '.php')) { - $relative = substr($entry->getPathname(), strlen($stubsDir) + 1); - if (!isset($files[$relative])) { - $problems[] = "stale stub not covered by targets.list: $stubsDir/$relative"; +$generatedSets = [ + [$stubsDir, $files, 'targets.list'], + [$guardsDir, $guardFiles, 'the classifier report'], +]; +foreach ($generatedSets as [$dir, $generated, $source]) { + if (!is_dir($dir)) { + continue; + } + $iterator = new RecursiveIteratorIterator( + new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS) + ); + foreach ($iterator as $entry) { + if ($entry->isFile() && str_ends_with($entry->getFilename(), '.php')) { + $relative = substr($entry->getPathname(), strlen($dir) + 1); + if (!isset($generated[$relative])) { + $problems[] = "stale file not covered by $source: $dir/$relative"; + } } } } @@ -131,24 +187,26 @@ foreach ($runtimeFiles as $relative) { } } -if ($check) { - foreach ($files as $relative => $content) { - $current = @file_get_contents("$stubsDir/$relative"); - if ($current === false) { - $problems[] = "missing stub (regenerate): $stubsDir/$relative"; - } elseif ($current !== $content) { - $problems[] = "stale stub (regenerate): $stubsDir/$relative"; +foreach ([[$stubsDir, $files, 'stubs'], [$guardsDir, $guardFiles, 'guards']] as [$dir, $generated, $what]) { + if ($check) { + foreach ($generated as $relative => $content) { + $current = @file_get_contents("$dir/$relative"); + if ($current === false) { + $problems[] = "missing file (regenerate): $dir/$relative"; + } elseif ($current !== $content) { + $problems[] = "stale file (regenerate): $dir/$relative"; + } } + continue; } -} else { - foreach ($files as $relative => $content) { - $path = "$stubsDir/$relative"; + foreach ($generated as $relative => $content) { + $path = "$dir/$relative"; if (!is_dir(dirname($path))) { mkdir(dirname($path), 0777, true); } file_put_contents($path, $content); } - fwrite(STDERR, count($files) . " stubs written to $stubsDir\n"); + fwrite(STDERR, count($generated) . " $what written to $dir\n"); } foreach ($problems as $problem) { diff --git a/scripts/plugin-stub-generator/guard-exemptions.list b/scripts/plugin-stub-generator/guard-exemptions.list new file mode 100644 index 00000000..90adcb20 --- /dev/null +++ b/scripts/plugin-stub-generator/guard-exemptions.list @@ -0,0 +1,14 @@ +# Classes the Rust side owns that the worker still resolves to the real Composer implementation, +# so no guard is emitted for them. An entry belongs here only when the worker has a mechanism that +# makes a natively constructed instance correct; without one the class must be guarded, or code +# running here would silently work on an instance the Rust side never sees. One FQCN per line, +# each with the mechanism that justifies it. + +# The wire codec revives values of this class from the object record serialize() writes for them +# (php/runtime/Shirabe/MaterializedValue.php), so the real declaration has to stay loadable. +Composer\Package\Link + +# Real Composer\Command code running in this worker constructs one (BaseCommand::initialize), and +# the dual-mode Composer\EventDispatcher\Event (php/runtime/) carries a natively constructed event +# to the Rust side as a P-table entity. +Composer\Plugin\PreCommandRunEvent diff --git a/scripts/plugin-stub-generator/src/Generator.php b/scripts/plugin-stub-generator/src/Generator.php index dd62da60..0b8ef037 100644 --- a/scripts/plugin-stub-generator/src/Generator.php +++ b/scripts/plugin-stub-generator/src/Generator.php @@ -159,7 +159,7 @@ final class Generator return []; } $surface = []; - $parentFqcn = $class->extends === null ? null : $this->resolvedName($class->extends); + $parentFqcn = $class->extends === null ? null : SourceFile::resolvedName($class->extends); if ($parentFqcn !== null) { $surface = $this->surfaces[$parentFqcn] ?? $this->surfaceFromRealClass($parentFqcn); } @@ -195,7 +195,7 @@ final class Generator . '; only rust-proxy and contract classes can become proxy stubs'; } - $parentFqcn = $class->extends === null ? null : $this->resolvedName($class->extends); + $parentFqcn = $class->extends === null ? null : SourceFile::resolvedName($class->extends); $isRoot = $parentFqcn === null; if ($parentFqcn !== null && !isset($this->targetSet[$parentFqcn])) { if (isset($this->runtimeSet[$parentFqcn])) { @@ -348,7 +348,7 @@ final class Generator $header = "// Generated by scripts/plugin-stub-generator; do not edit by hand.\n" . "// Proxy stub for $fqcn: the public surface forwards to the Rust-side entity over RPC."; $text = "<?php\n\n$header\n\nnamespace {$file->namespace};\n\n"; - $uses = $this->usedImports($file, $decl . "\n" . $body); + $uses = $file->importsUsedBy($decl . "\n" . $body); if ($uses !== '') { $text .= $uses . "\n\n"; } @@ -446,11 +446,11 @@ final class Generator } $out[] = $file; foreach ($file->classLike->extends as $parent) { - $visit($this->resolvedName($parent)); + $visit(SourceFile::resolvedName($parent)); } }; foreach ($class->implements as $interface) { - $visit($this->resolvedName($interface)); + $visit(SourceFile::resolvedName($interface)); } return $out; } @@ -527,23 +527,4 @@ final class Generator } return $fingerprint; } - - /** The original file's imports, restricted to names the emitted stub actually uses. */ - private function usedImports(SourceFile $file, string $emittedText): string - { - $kept = []; - foreach ($file->aliases as $alias => $fqcn) { - if (preg_match('/(?<![\\\\$\w])' . preg_quote($alias, '/') . '\b/', $emittedText) === 1) { - $kept[] = 'use ' . $fqcn - . (str_ends_with($fqcn, '\\' . $alias) || $fqcn === $alias ? '' : " as $alias") . ';'; - } - } - return implode("\n", $kept); - } - - private function resolvedName(Name $name): string - { - $resolved = $name->getAttribute('resolvedName'); - return $resolved instanceof Name ? $resolved->toString() : $name->toString(); - } } diff --git a/scripts/plugin-stub-generator/src/GuardGenerator.php b/scripts/plugin-stub-generator/src/GuardGenerator.php new file mode 100644 index 00000000..e471f1a3 --- /dev/null +++ b/scripts/plugin-stub-generator/src/GuardGenerator.php @@ -0,0 +1,215 @@ +<?php + +declare(strict_types=1); + +namespace Shirabe\PluginStubGenerator; + +use PhpParser\Node\Name; +use PhpParser\Node\Stmt\Class_; +use PhpParser\Node\Stmt\ClassMethod; + +/** + * Emits the guard classes: same FQCN, same hierarchy and constants as the real Composer class, + * but every constructor and method raises an explicit error. They cover the classes whose entity + * the Rust side owns and that have no proxy stub, so the worker's autoloader can no longer fall + * through to the real implementation and run a second instance the Rust side never sees. + * + * A declaration-only reference (`instanceof`, `X::class`, a constant) keeps working; only running + * the code fails. + */ +final class GuardGenerator +{ + /** @var list<string> */ + private array $errors = []; + + /** @var array<string, true> */ + private array $guardSet = []; + + /** @var array<string, true> */ + private array $providedSet = []; + + /** @var list<string> `Ancestor::member` entries the class being emitted cannot redeclare */ + private array $inheritedFinals = []; + + /** + * @param list<string> $targets FQCNs to emit a guard for + * @param list<string> $provided FQCNs the worker resolves to a proxy stub or a hand-written + * runtime class; a guard never reproduces their members, since + * those declarations already shadow the real class + */ + public function __construct( + private readonly Project $project, + private readonly NamePrinter $printer, + private readonly array $targets, + array $provided, + ) { + foreach ($targets as $fqcn) { + $this->guardSet[$fqcn] = true; + } + foreach ($provided as $fqcn) { + $this->providedSet[$fqcn] = true; + } + } + + /** @return array<string, string> relative guard path => file content */ + public function generate(): array + { + $files = []; + foreach ($this->targets as $fqcn) { + $files[str_replace('\\', '/', $fqcn) . '.php'] = $this->emitClass($fqcn); + } + if ($this->errors !== []) { + throw new GenerationError($this->errors); + } + return $files; + } + + private function emitClass(string $fqcn): string + { + $file = $this->project->sourceFor($fqcn); + $class = $file->classLike; + if (!$class instanceof Class_) { + $this->errors[] = "$fqcn is not a class"; + return ''; + } + + // Constants and public static properties are compile-time data with no instance behind + // them; they are copied verbatim, visibility included, so that the references a guard is + // meant to keep working (`Link::TYPE_REQUIRE` and friends) resolve to the real values. + $data = []; + foreach ($class->getConstants() as $constant) { + $data[] = $file->verbatim($constant->getStartLine(), $constant->getEndLine()); + } + foreach ($class->getProperties() as $property) { + if ($property->isPublic() && $property->isStatic()) { + $data[] = $file->verbatim($property->getStartLine(), $property->getEndLine()); + } + } + + $methods = []; + $this->inheritedFinals = []; + $closure = $this->methodClosure($fqcn); + if (!isset($closure['__construct'])) { + // Nothing in the hierarchy declares one, so PHP would hand out the implicit + // constructor. The guard declares its own to close that door. + $methods[] = " public function __construct()\n {\n" + . " \\ShirabeUnsupportedClass::fail(self::class, '__construct');\n }"; + } + foreach ($closure as $lowerName => [$method, $declaringFile]) { + if ($method->isPrivate() || $lowerName === '__destruct') { + // A private method is reachable only from the code the guard replaces, and a + // destructor that throws would fire while an exception is already unwinding. + continue; + } + $methods[] = $this->renderMethod($class, $method, $declaringFile); + } + + $decl = ($class->isAbstract() ? 'abstract ' : '') . ($class->isFinal() ? 'final ' : '') + . 'class ' . $class->name?->toString(); + if ($class->extends !== null) { + $decl .= ' extends ' . $this->printer->renderName($class->extends, $file); + } + $interfaces = array_map(fn (Name $n): string => $this->printer->renderName($n, $file), $class->implements); + if ($interfaces !== []) { + $decl .= ' implements ' . implode(', ', $interfaces); + } + + $body = implode("\n\n", array_merge($data === [] ? [] : [implode("\n", $data)], $methods)); + + $header = "// Generated by scripts/plugin-stub-generator; do not edit by hand.\n" + . "// Guard for $fqcn.\n" + . "// The Rust side owns this class and the worker has no proxy for it, so this\n" + . "// declaration shadows the real one: the constants and the hierarchy stay, while\n" + . "// constructing it or calling anything on it raises an explicit error."; + foreach ($this->inheritedFinals as $member) { + $header .= "\n// $member() is final, so it keeps running the real implementation here."; + } + $text = "<?php\n\n$header\n\nnamespace {$file->namespace};\n\n"; + $uses = $file->importsUsedBy($decl . "\n" . $body); + if ($uses !== '') { + $text .= $uses . "\n\n"; + } + return $text . $decl . "\n{\n" . ($body === '' ? '' : $body . "\n") . "}\n"; + } + + /** + * Every method a guard must redeclare: its own (traits included), plus the ones it would + * otherwise inherit from real ancestors. The walk stops at an ancestor that is guarded or + * shadowed by a stub, since that declaration carries the members from there on up. + * + * @return array<string, array{ClassMethod, SourceFile}> lowercased name => method and the + * file its signature is written in + */ + private function methodClosure(string $fqcn): array + { + $file = $this->project->sourceFor($fqcn); + $class = $file->classLike; + $methods = []; + foreach ($class->getMethods() as $method) { + $methods[strtolower($method->name->toString())] ??= [$method, $file]; + } + foreach ($class->getTraitUses() as $traitUse) { + foreach ($traitUse->traits as $trait) { + foreach ($this->methodClosure(SourceFile::resolvedName($trait)) as $name => $entry) { + $methods[$name] ??= $entry; + } + } + } + $parent = $class instanceof Class_ && $class->extends !== null + ? SourceFile::resolvedName($class->extends) + : null; + // A PHP builtin ancestor (FilterIterator, ...) has no source file to read; its methods + // work on internal state that only its own constructor sets up, which the guard blocks. + $isInternal = $parent !== null && class_exists($parent, false) + && (new \ReflectionClass($parent))->isInternal(); + if ($parent !== null && !$isInternal + && !isset($this->guardSet[$parent]) && !isset($this->providedSet[$parent])) { + foreach ($this->methodClosure($parent) as $name => $entry) { + if (isset($methods[$name])) { + continue; + } + if ($entry[0]->isFinal()) { + // PHP refuses the redeclaration, so this member keeps running the real + // implementation; emitClass records it in the guard's header. + $this->inheritedFinals[] = $parent . '::' . $entry[0]->name->toString(); + continue; + } + $methods[$name] = $entry; + } + } + return $methods; + } + + private function renderMethod(Class_ $class, ClassMethod $method, SourceFile $target): string + { + $name = $method->name->toString(); + $params = []; + foreach ($method->params as $param) { + $rendered = ''; + if ($param->type !== null) { + $rendered = $this->printer->renderType($param->type, $target) . ' '; + } + // A promoted constructor property declares state the guard has no use for; the + // parameter itself is kept so the signature a caller sees does not change. + $rendered .= ($param->byRef ? '&' : '') . ($param->variadic ? '...' : '') . '$' . $param->var->name; + if ($param->default !== null) { + $rendered .= ' = ' . $this->printer->renderExpr($param->default, $target); + } + $params[] = $rendered; + } + + $abstract = $method->isAbstract() && $class->isAbstract(); + $returnType = $this->printer->renderType($method->returnType, $target); + $signature = ($abstract ? 'abstract ' : '') . ($method->isFinal() ? 'final ' : '') + . ($method->isPublic() ? 'public' : 'protected') + . ($method->isStatic() ? ' static' : '') + . ' function ' . ($method->byRef ? '&' : '') . $name . '(' . implode(', ', $params) . ')' + . ($returnType === '' ? '' : ": $returnType"); + if ($abstract) { + return " $signature;"; + } + return " $signature\n {\n" + . " \\ShirabeUnsupportedClass::fail(self::class, '$name');\n }"; + } + +} diff --git a/scripts/plugin-stub-generator/src/Report.php b/scripts/plugin-stub-generator/src/Report.php index 92e0565e..758a1768 100644 --- a/scripts/plugin-stub-generator/src/Report.php +++ b/scripts/plugin-stub-generator/src/Report.php @@ -7,8 +7,11 @@ namespace Shirabe\PluginStubGenerator; /** The classifier report (scripts/plugin-class-classifier/report.json). */ final class Report { - /** @param array<string, string> $categories fqcn => category */ - private function __construct(private readonly array $categories) + /** + * @param array<string, string> $categories fqcn => category + * @param array<string, string> $kinds fqcn => class / interface / trait / enum + */ + private function __construct(private readonly array $categories, private readonly array $kinds) { } @@ -24,14 +27,38 @@ final class Report throw new GenerationError(["$path records classification violations; fix the classifier lists first"]); } $categories = []; + $kinds = []; foreach ($data['classes'] as $class) { $categories[$class['fqcn']] = $class['category']; + $kinds[$class['fqcn']] = $class['kind']; } - return new self($categories); + return new self($categories, $kinds); } public function category(string $fqcn): ?string { return $this->categories[$fqcn] ?? null; } + + public function kind(string $fqcn): ?string + { + return $this->kinds[$fqcn] ?? null; + } + + /** + * The FQCNs of the given categories, in report order. + * + * @param list<string> $categories + * @return list<string> + */ + public function inCategories(array $categories): array + { + $out = []; + foreach ($this->categories as $fqcn => $category) { + if (in_array($category, $categories, true)) { + $out[] = $fqcn; + } + } + return $out; + } } diff --git a/scripts/plugin-stub-generator/src/SourceFile.php b/scripts/plugin-stub-generator/src/SourceFile.php index 771e83a8..e20bf00f 100644 --- a/scripts/plugin-stub-generator/src/SourceFile.php +++ b/scripts/plugin-stub-generator/src/SourceFile.php @@ -4,6 +4,7 @@ declare(strict_types=1); namespace Shirabe\PluginStubGenerator; +use PhpParser\Node\Name; use PhpParser\Node\Stmt\ClassLike; use PhpParser\Node\Stmt\GroupUse; use PhpParser\Node\Stmt\Namespace_; @@ -83,4 +84,24 @@ final class SourceFile { return implode("\n", array_slice($this->lines, $startLine - 1, $endLine - $startLine + 1)); } + + /** This file's imports, restricted to the names the emitted text actually uses. */ + public function importsUsedBy(string $emittedText): string + { + $kept = []; + foreach ($this->aliases as $alias => $fqcn) { + if (preg_match('/(?<![\\\\$\w])' . preg_quote($alias, '/') . '\b/', $emittedText) === 1) { + $kept[] = 'use ' . $fqcn + . (str_ends_with($fqcn, '\\' . $alias) || $fqcn === $alias ? '' : " as $alias") . ';'; + } + } + return implode("\n", $kept); + } + + /** The FQCN a Name node resolved to, the NameResolver having left the node itself alone. */ + public static function resolvedName(Name $name): string + { + $resolved = $name->getAttribute('resolvedName'); + return $resolved instanceof Name ? $resolved->toString() : $name->toString(); + } } |
