Sync upstream updates: queue inspection contract, prompt output outside terminals and Larastan fixes

Merged
BI
3d ago
+1391-131

Upstream Updates

  • laravel/framework#62403, facade docblocks — Add the queue size and job inspection methods to the Queue contract. Every Hypervel driver already implemented them, so the stale analysis ignores in FailoverQueue are gone, the queue connection fake forwards them explicitly, and the Queue facade lists them with the contract.
  • laravel/framework#62399 — Call isReporting() and buildContextForException() directly in JsonFormatter, since the ExceptionHandler contract declares them.
  • laravel/prompts#280 — Render spinners and tasks statically when decorated output is not a terminal, such as --ansi output in CI and build logs. Progress bars and streams make the same check, decided once per run.
  • larastan/larastan#2634, larastan/larastan#2617, larastan/larastan@ad65a795d8 — Port the custom pivot accessor, SoftDeletes builder and insertOrIgnoreReturning passthru type tests. Hypervel already infers these types. The Collection Types docs now show that many-to-many results keep their pivot, including a custom as() accessor.
  • larastan/larastan#2638 — Port the foreignIdFor(), foreignUuidFor() and foreignUlidFor() schema tests. For a model that can't be loaded, Hypervel adds no column and marks the table incomplete instead of guessing an integer column named after the class.
  • larastan/larastan@392336282c, larastan/larastan@ffb2968070 — Port the named-argument cases for rules and collectors. Hypervel's rules and collectors already read arguments by parameter name. The useless value() fix now also drops literal arguments, so value(foo: 1, value: 'bar') becomes 'bar', but it keeps the call when another argument could have side effects.
  • larastan/larastan#2648 — Port the Collection offset type tests.
  • larastan/larastan#2649 — Port the getArrayableAttributes() type test.
  • larastan/larastan#2647 — Type base_path() as a non-empty string when given a non-empty path, so calls such as simplexml_load_file(storage_path('feeds/catalog.xml')) are no longer reported. The other path helpers and the application contract's path methods declare the same type.

Additional Hypervel changes

  • Require shouldStopRetries() on the ExceptionHandler contract. The queue worker only called it when method_exists() found it, so under Exceptions::fake() or withoutExceptionHandling() it ignored dontRetry() and dontRetryWhen() and released the job. The exception fake and the without-handling handler now pass the call to the real handler. The porting guide tells custom handler authors to implement it.
  • Check whether prompt output is a terminal at its real destination. Artisan's output style and buffered outputs used to fall back to STDOUT, so captured command output animated whenever the process ran in a terminal. Output that isn't a terminal also no longer receives cursor, erase, clear or title sequences, so logs keep only the text and colors.
  • Size prompts from the first standard stream that is a terminal, in the order stdout, stderr, stdin. Symfony's Terminal only asked stdin, so with piped input prompts assumed 80x50 and started a new stty process on every redraw. The size is now read once before the first redraw, a failed query keeps its fallback, and COLUMNS and LINES skip the query.
  • Redraw a progress bar at most every 40 ms while it advances, matching Symfony's ProgressBar. Each step still counts straight away, and the final step, start(), finish() and explicit render() calls draw immediately. 3,000 fast steps now start 3 processes instead of 3,002.
  • Treat makeWith() as a container resolution in the worker-lifetime analysis, so resolving the request through makeWith() in a #[BindWhen] condition is reported like make().
  • Point the porting guide's static analysis entry at the Static Analysis guide for setup, and remove notes about Larastan settings Hypervel doesn't have.

[!NOTE]

Sync upstream: queue inspection contract, prompt output outside terminals, Larastan fixes

  • Adds 10 job-inspection methods to the Queue contract (totalSize, pendingJobs, allReservedJobs, etc.) and implements them in QueueConnectionFake and test doubles
  • Makes prompt rendering detect real terminals via new Prompt.canControlTerminal() and Terminal.isOutputTty(); prompts, cursor/erase helpers, Spinner, Stream, Task, and Progress now render statically when output is decorated but not a TTY
  • Progress redraws at most every 40 ms unless the total is reached; Terminal initializes dimensions lazily via stty and throws RuntimeException when proc_open is unavailable
  • Promotes shouldStopRetries() to an explicit ExceptionHandler interface method; Worker, ExceptionHandlerFake, and test fakes now call it directly without method_exists guards
  • Adds conditional non-empty-string PHPDoc return types to path helpers and Application path methods, plus many PHPStan type/rule fixture updates
  • Risk: custom ExceptionHandler implementations must now provide shouldStopRetries() (see src/contracts/src/Debug/ExceptionHandler.php and the porting guide); Terminal.execWithInput now throws instead of failing when proc_open is disabled
📊 Macroscope summarized 5b9d253. 1 file reviewed, 1 issue evaluated, 0 issues filtered, 1 comment posted

🗂️ Filtered Issues

Summary by CodeRabbit

  • New Features

    • Added queue size summaries and inspection of pending, delayed, and reserved jobs across individual or all queues.
    • Improved terminal detection and sizing for interactive prompts, with clearer static output and less frequent progress redraws when animation isn’t suitable.
    • Expanded static-analysis support for named arguments, queue resolution, and pivot data in collections.
  • Bug Fixes

    • Preserved exception retry policies when wrapping handlers.
    • Improved path return-type information and exception logging behavior.