zf1/zend-exception
Zend Framework 1 Exception component repackaged for Composer. Lets you install only the exception-related pieces of ZF1 with optimized autoloading and smaller footprint, easing incremental migration without pulling the full framework.
Throwable-based) is fundamentally incompatible with ZF1’s legacy Zend_Exception hierarchy. The package lacks integration with Laravel’s ExceptionHandler, ErrorException, or PSR-15 middleware stack.throw_if, fail(), report()). Introducing ZF1 exceptions adds unnecessary complexity without clear value.symfony/error-handler) are superior for new code.Zend_ conflicts with Laravel’s Zend aliases (if any).Zend_Exception to Throwable for Laravel’s ExceptionHandler.Zend_Exception → Laravel exceptions.ExceptionHandler expects Throwable. Zend_Exception (pre-PSR) may not trigger Laravel’s report()/render() hooks correctly.phpstan to detect Zend_Exception usages pre-integration.Zend_Exception::formatStackTrace()) that Laravel lacks? Could they be reimplemented in a Laravel-compatible way?Zend_Exception interact with Laravel’s:
try/catch blocks?ExceptionHandler::render()?ExceptionHandler.Zend_Exception provides stack trace formatting, but Laravel’s ExceptionHandler already supports this via render().Illuminate\Support\Exception or custom classes are better suited.Zend_Exception usages. Categorize as:
Zend_Exception for legacy paths).Zend_Exception and convert it to a Laravel-compatible format:
class LegacyException extends \Exception {
public static function fromZend(Zend_Exception $e): self {
return new self($e->getMessage(), $e->getCode(), $e);
}
}
Zend_ namespaces may conflict with Laravel’s Zend aliases.composer.json replace or conflict directives:
"replace": {
"zendframework/zend-exception": "zf1/zend-exception"
}
ExceptionHandler::render() to handle Zend_Exception:
public function render($request, Throwable $exception) {
if ($exception instanceof Zend_Exception) {
return response()->json(['error' => $exception->getMessage()], 500);
}
// Default Laravel handling
}
zf1/zend-exception in a non-production environment.Zend_Exception is thrown.zf1/zend-exception to a specific version.Zend_Exception in logs, APIs, and CLI.Zend_Exception to non-critical legacy code.Zend_Exception may not trigger Laravel’s report()/render().zf1/zend-exception and revert to Laravel exceptions.How can I help you explore Laravel packages today?