donatj/drop
Lightweight PHP debug helper with drop() and see() for quickly printing one or more variables in a readable format on web or CLI. drop() dumps values and exits (status 1); see() dumps without halting. Ideal for quick “print statement” debugging.
drop() and see()) continues to align with Laravel’s simplicity and developer experience. The addition of @return never PHPDoc annotations improves IDE/tooling support without altering functionality.@return never) explicitly signal that drop() terminates execution, which is critical for static analysis tools (e.g., PHPStan, Psalm) and CI pipelines. This reduces false positives in type-checking and improves IDE autocompletion/validation.composer require donatj/drop --dev away from integration.drop() calls more aggressively due to the explicit @return never annotation. Mitigation: Update CI pipelines to handle "never-returning" functions appropriately (e.g., suppress warnings or document intentional usage).drop() calls with warnings about unreachable code. Mitigation: Add IDE-specific suppressions or document the intentional use case in team coding standards.@return never annotation? Should we configure them to ignore drop() calls or treat them as intentional termination points?drop() usage as errors? If so, should we add allowlists or suppressions?drop() calls (e.g., @phpstan-ignore-next-line) to avoid cluttering code with warnings?@return never behavior for developers new to the package?drop() in CI/CD contexts (e.g., debugging failed deployments)?drop() over dd() or var_dump() in new projects?@return never annotation is a game-changer for CI/CD integration. Tools like:
drop() is only used in development or debugging contexts.composer require donatj/drop --dev
drop() in static analyzers).var_dump()/exit() calls with drop() in critical paths, leveraging the new IDE support for better debugging.drop() in internal guidelines, emphasizing its @return never behavior for CI/CD safety.drop() calls (e.g., PHPStorm’s "Mark as TODO" or custom inspections).@return never functions gracefully. Example for PHPStan:
# .phpstan.neon
parameters:
ignoreErrors:
- '#Method drop\(\) should never return#'
see() in CI scripts for non-blocking debugging (e.g., capturing output in failed jobs).drop() as a termination point, reducing false positives.drop()/see().@return never annotations (e.g., suppress warnings or document intentional usage).var_dump()/exit() in high-impact areas (e.g., payment logic, API gateways) using the updated package.see() into CI/CD debugging workflows (e.g., capturing output in failed deployments or tests).drop()’s behavior explicit for static analysis tools.actions/checkout updates are unrelated to runtime behavior.@return never annotation makes drop()’s intent clearer, reducing accidental usage in production.see() can now be used more confidently in CI scripts, as its non-blocking nature is explicitly documented.drop()/see() safer to use in distributed systems (e.g., queues, microservices) where debugging is critical.drop() calls as errors. Mitigation: Configure allowlists or suppressions in static analysis rules.drop() as unreachable code. Mitigation: Use IDE-specific suppressions or document intentional usage.@return never, they may fail on drop() calls. Mitigation: Update CI configurations to ignore or allowlist these annotations.see() into CI/CD scripts for debugging failed jobs or deployments.@return never behavior and its implications for CI/CD.drop() gracefully.drop() in CI/CD contexts (e.g., feature flags, environment checks).How can I help you explore Laravel packages today?