CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 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

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • BaseErrorHandler
  • Debugger
  • ErrorHandler
  • ExceptionRenderer

Interfaces

  • ExceptionRendererInterface

Exceptions

  • FatalErrorException
  • PHP7ErrorException
 1: <?php
 2: /**
 3:  * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
 4:  * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
 5:  *
 6:  * Licensed under The MIT License
 7:  * Redistributions of files must retain the above copyright notice.
 8:  *
 9:  * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
10:  * @since         3.1.5
11:  * @license       https://opensource.org/licenses/mit-license.php MIT License
12:  */
13: namespace Cake\Error;
14: 
15: use Exception;
16: 
17: /**
18:  * Wraps a PHP 7 Error object inside a normal Exception
19:  * so it can be handled correctly by the rest of the
20:  * error handling system
21:  */
22: class PHP7ErrorException extends Exception
23: {
24:     /**
25:      * The wrapped error object
26:      *
27:      * @var \Error
28:      */
29:     protected $_error;
30: 
31:     /**
32:      * Wraps the passed Error class
33:      *
34:      * @param \Error $error the Error object
35:      */
36:     public function __construct($error)
37:     {
38:         $this->_error = $error;
39:         $this->message = $error->getMessage();
40:         $this->code = $error->getCode();
41:         $this->file = $error->getFile();
42:         $this->line = $error->getLine();
43:         $msg = sprintf(
44:             '(%s) - %s in %s on %s',
45:             get_class($error),
46:             $this->message,
47:             $this->file ?: 'null',
48:             $this->line ?: 'null'
49:         );
50:         parent::__construct($msg, $this->code, $error->getPrevious());
51:     }
52: 
53:     /**
54:      * Returns the wrapped error object
55:      *
56:      * @return \Error
57:      */
58:     public function getError()
59:     {
60:         return $this->_error;
61:     }
62: }
63: 
Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs