aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-external-packages/src/symfony/console/helper
AgeCommit message (Collapse)Author
2026-06-29feat(console): implement output instanceof downcasts in process/progress helpersnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28refactor: add linternsfisis
2026-06-27refactor: fix compiler warnings and clippy warningsnsfisis
2026-06-26fix(check-platform-reqs-command): add PlatformRepository to existing compositensfisis
execute nested the already-built InstalledRepository inside a second InstalledRepository, tripping the assertion that an InstalledRepository may not contain another. PHP adds a PlatformRepository to the existing composite via addRepository; do the same. Un-ignores CheckPlatformReqsCommandTest::test_failed_platform_requirement. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-26refactor(symfony-table): model rows/cells with enums instead of PhpMixednsfisis
The Table helper modeled a row's cells as PhpMixed and recovered the concrete TableCell/TableSeparator types via runtime instance_of, leaving the entire mixed/array bridge (to_row_vec, cell_colspan, row_get, ...) as todo!(). Replace that with proper Row/Cell enums: Row = HeaderDivider | Separator(TableSeparator) | Cells(Vec<Cell>) Cell = Null | Value(String) | Cell(TableCell) | Separator(TableSeparator) The internal header/body boundary that PHP detects by object identity ($divider === $row) becomes the dedicated Row::HeaderDivider variant. Style arguments (PHP string|TableStyle) become a StyleName enum, so Table::new no longer panics in resolve_style's instance_of stub; TableStyle derives Clone so named styles resolve from the registry. PhpMixed-based callers (SymfonyStyle::table, render_table, auditor's sanitize) bridge via From<PhpMixed> for Cell/Row at the boundary. Un-ignores LicensesCommandTest text-format cases (4) and BaseDependencyCommandTest::why; output matches PHP exactly. Removes ~15 impl todo!()s in the Table helper. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25feat(external-packages,shim): implement impl todos across componentsnsfisis
Port seld/jsonlint JsonParser (+hand-written Lexer), unblocking 10 json_file parse-error tests verified byte-for-byte against PHP. Implement Symfony Finder SplFileInfo, executable finders, String classes (byte/code-point/unicode), ZipArchive shim (via the zip crate), SPDX license validation, and shim date/stream functions. Genuinely-blocked sites (reflection, PHP runtime constants, non-UTF-8 transcoding, recursive PCRE) stay todo!() with reasons. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24chore: unwrap meaningless PhpMixed::String()nsfisis
2026-06-24feat(process): redesign proc_* on PhpResource process handlesnsfisis
proc_open/proc_close/proc_get_status/proc_terminate represented the process handle as a PhpMixed, which cannot hold a live child process or its pipes, so they were stubs or todo!(). Model the handle as a new PhpResource::Process variant and child pipes as a StreamBacking::Pipe, with a native Descriptor enum for descriptorspec; proc_open now returns io::Result and fills pipes as IndexMap<i64, PhpResource>. Rewire the Symfony Process pipes and the Console terminal/cursor onto the new types, removing the "PhpMixed cannot carry a PhpResource" todo!()s. The remaining todo!()s are genuine syscall leaves (proc_terminate signal delivery, stream_select, stream_set_blocking, posix_kill, pty, fd>=3) left unimplemented since no syscall crate is introduced. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24feat(question): model Question hierarchy via QuestionInterface traitnsfisis
Introduce a QuestionInterface trait that the base Question and all its subclasses (ChoiceQuestion, ConfirmationQuestion, StrictConfirmationQuestion) implement, with as_choice/as_confirmation downcasts standing in for PHP's instanceof. Consumers (QuestionHelper, SymfonyQuestionHelper, SymfonyStyle, ConsoleIO) now take a QuestionInterface boundary generically. This fixes the instanceof emulation, which previously went through as_any().downcast_ref on a concrete &Question and always returned None, and unblocks the select/confirm/choice paths that were left as todo!() because a polymorphic ChoiceQuestion/ConfirmationQuestion could not be passed to ask. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23test(command): port InitCommandTestnsfisis
Port the pure-method cases (parse/namespace/formatAuthors/git/vendor-ignore) and build the ApplicationTester / initTempComposer harness the run cases need. Supporting production changes: - carry the streamable input stream as PhpResource (not PhpMixed) and add InputInterface::as_streamable so QuestionHelper reads the injected stream - add StreamOutput/ConsoleOutput __set_stream test helpers and ApplicationHandle::set_catch_exceptions for the tester - implement the interact() author validator via parse_author_string Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-23refactor(console): close HelperSet to a fixed set of four helpersnsfisis
Replace the dynamic, string-keyed HelperSet (set/has/get/get_iterator, HelperSetKey, deprecated set_command/get_command) with a closed set of FormatterHelper, DebugFormatterHelper, ProcessHelper and QuestionHelper instantiated by an argument-less constructor and exposed through typed getters (get_formatter/get_debug_formatter/get_process/get_question). The typed getters let ProcessHelper, QuestionHelper::write_error and InitCommand::interact drop their downcast/placeholder todo!() stubs. Dynamic registration of plugin-provided helpers is intentionally dropped for now and tracked via TODO(plugin) comments. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22feat(php-shim): implement fopen-family stream API on PhpResourcensfisis
Redesign PhpResource into a real stream handle (File/Memory backing with tracked position, eof, closed state) and unify the whole fopen family (fopen/fwrite/fread/fgets/fgetc/feof/fclose/ftell/fseek/rewind/fstat/ ftruncate/fflush and stream_get_contents/stream_copy_to_stream) on &PhpResource, replacing the split PhpMixed/PhpResource APIs and their todo!() stubs. fopen now returns Result; read functions stay String for now (TODO(phase-e) to move to byte strings). Propagate the signatures through callers: Process stdout/stderr, Cursor input, curl header/body handles (extracted into typed maps keyed by job id), Filesystem copy/safe_copy/files_are_equal, BufferIO, error_handler, platform, perforce, zip. The proc_open pipe paths cannot carry a PhpResource in a PhpMixed list, so they are left as todo!() with notes.
2026-06-21feat(php-shim): implement array sort/merge/unique/splice helpersnsfisis
Implement array_unique, array_splice, array_merge_recursive, krsort, ksort, asort, sort_with_flags and sort_natural_flag_case, plus the strnatcmp/strnatcasecmp port they rely on. Drop array_key_last and array_splice_mixed in favour of existing helpers at the call sites. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21feat(php-shim): implement microtimensfisis
Drop the get_as_float parameter; the Rust shim always returns f64. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21refactor(math): use method-style max/min/clamp over std::cmpnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20feat(symfony-process): port full Process class from PHPnsfisis
Faithfully port every method, field and constant of Symfony's Process.php into process.rs, replacing the reduced stub. Add the supporting pipes module (PipesInterface/AbstractPipes/UnixPipes/ WindowsPipes), ProcessUtils and the missing process exceptions (LogicException/InvalidArgumentException) with constructors. Methods now return anyhow::Result where PHP throws, take the env argument and a bool-returning callback, and borrow &mut for status-updating accessors; all callers are updated accordingly. Extend the php-shim with proc_open/proc_close (PHP-compatible signatures), proc_get_status, proc_terminate, posix_kill, uniqid, ftruncate, ftell_stream, fseek3, stream_get_contents3 and env helpers. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-20refactor(php-shim): drop Box wrapping from PhpMixed List/Arraynsfisis
The List and Array variants of PhpMixed boxed their elements unnecessarily. Store PhpMixed values directly and update all callers accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20refactor(clippy): resolve idiomatic lint warningsnsfisis
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20refactor: auto-fix clippy warningsnsfisis
2026-06-20feat(command): implement --help outputnsfisis
2026-06-14refactor: auto-fix clippy warningsnsfisis
2026-06-14refactor: fix warningsnsfisis
2026-06-14refactor(pcre): return bool from preg_match shimnsfisis
preg_match can only return 1 or 0 now that compile failure panics, so return bool and update all call sites accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14refactor(pcre): treat regex compile failure as fatal in shimnsfisis
The preg_* shim helpers wrapped their results in Option/Result solely to signal a regex that failed to compile. Composer never feeds a pattern that fails at runtime, so such a failure is a programming error: panic instead and drop the Option/Result wrappers, updating all callers. preg_replace_callback keeps its Result return type since the callback itself is fallible. preg_match_groups is removed in favor of preg_match at its sole call site. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14refactor(pcre): drop Result from Preg method return typesnsfisis
The Preg methods panic on PCRE failure (per the file header rationale), so their anyhow::Result wrappers never carried an Err. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-14chore: add "ref" comments to file headernsfisis
2026-06-12refactor(php-shim): replace literal sprintf calls with format!nsfisis
Convert every sprintf() call with a compile-time literal format string to format!, implementing Display for PhpMixed (delegating to php_to_string) so PhpMixed values render with PHP string semantics through {}. Also merge the format!-wrapped and conditional-literal dynamic sites into single format! calls. Genuinely runtime format strings (table styles, configurable error messages, command synopsis, progress-bar modifiers, regex-built messages) still go through sprintf. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12feat(symfony-console): port Symfony Console and make the workspace compilensfisis
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11feat(console): resolve phase-b TODOs in doRun and IO wiringnsfisis
Wire up ConsoleIO with HelperSet/QuestionHelper, register the ErrorHandler with the IO instance, and fall back to a default output in run(). Replace resolved phase-b TODOs across the console, command, io, factory, installer, dependency_resolver, and util modules; reclassify the remaining blockers (typed Symfony command registry, stdin resource caching) as phase-c. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-08refactor(external-packages): drop component segment from symfony pathsnsfisis
Align the Symfony namespace mapping with the documented convention (symfony::component::X -> symfony::X) and remove now-unused console stub files. Update all import paths across the workspace. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06refactor(command): share Input/OutputInterface via Rc<RefCell>nsfisis
Convert InputInterface and OutputInterface parameters from &dyn/&mut dyn references to Rc<RefCell<dyn ...>> shared ownership across the command, console, and IO layers, matching the Phase C shared-ownership approach already used for IOInterface. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-20refactor: re-export module items to shorten import pathsnsfisis
2026-05-20fix(compile): fix all remaining compile errorsnsfisis
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17chore: cargo clippy --fixnsfisis
2026-05-17feat(port): add stub implementations of shirabe-external-packagesnsfisis