CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 4.6 Strawberry API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 4.6
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
    • Datasource
    • Error
      • Debug
      • Middleware
      • Renderer
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class PhpError

Object wrapper around PHP errors that are emitted by trigger_error()

Namespace: Cake\Error

Method Summary

  • __construct() public

    Constructor

  • getCode() public

    Get the PHP error constant.

  • getFile() public

    Get the error file

  • getLabel() public

    Get the error code label

  • getLine() public

    Get the error line number.

  • getLogLevel() public

    Get the mapped LOG_ constant.

  • getMessage() public

    Get the error message.

  • getTrace() public

    Get the stacktrace as an array.

  • getTraceAsString() public

    Get the stacktrace as a string.

Method Detail

__construct() ¶ public

__construct(int $code, string $message, string|null $file = null, int|null $line = null, array $trace = [])

Constructor

Parameters
int $code

The PHP error code constant

string $message

The error message.

string|null $file optional

The filename of the error.

int|null $line optional

The line number for the error.

array $trace optional

The backtrace for the error.

getCode() ¶ public

getCode(): int

Get the PHP error constant.

Returns
int

getFile() ¶ public

getFile(): string|null

Get the error file

Returns
string|null

getLabel() ¶ public

getLabel(): string

Get the error code label

Returns
string

getLine() ¶ public

getLine(): int|null

Get the error line number.

Returns
int|null

getLogLevel() ¶ public

getLogLevel(): int

Get the mapped LOG_ constant.

Returns
int

getMessage() ¶ public

getMessage(): string

Get the error message.

Returns
string

getTrace() ¶ public

getTrace(): array

Get the stacktrace as an array.

Returns
array

getTraceAsString() ¶ public

getTraceAsString(): string

Get the stacktrace as a string.

Returns
string
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs