src/Controller.php
public function log_php_errors( $error_types = NULL ) {

		static $done = FALSE;
		if ( $done ) {
			return $this;
		}

		$done = TRUE;
		is_int( $error_types ) or $error_types = E_ALL | E_STRICT;

		$controller = new PhpErrorController();
		register_shutdown_function( [ $controller, 'on_fatal', ] );
		set_error_handler( [ $controller, 'on_error' ], $error_types );
		set_exception_handler( [ $controller, 'on_exception', ] );

		// Ensure that channel Channels::PHP_ERROR error is there
		add_filter(
			Channels::FILTER_CHANNELS,
			function ( array $channels ) {

				$channels[] = Channels::PHP_ERROR;

				return $channels;
			},
			PHP_INT_MAX
		);

		return $this;
	}
public function log_php_errors( $error_types = NULL ) {

		static $done = FALSE;
		if ( $done ) {
			return $this;
		}

		$done = TRUE;
		is_int( $error_types ) or $error_types = E_ALL | E_STRICT;

		$controller = new PhpErrorController();
		register_shutdown_function( [ $controller, 'on_fatal', ] );
		set_error_handler( [ $controller, 'on_error' ], $error_types );
		set_exception_handler( [ $controller, 'on_exception', ] );

		// Ensure that channel Channels::PHP_ERROR error is there
		add_filter(
			Channels::FILTER_CHANNELS,
			function ( array $channels ) {

				$channels[] = Channels::PHP_ERROR;

				return $channels;
			},
			PHP_INT_MAX
		);

		return $this;
	}
public function log_php_errors ( $ error_types = NULL ) { static $ done = FALSE ; if ( $ done ) { return $ this ; } $ done = TRUE ; is_int ( $ error_types ) or $ error_types = E_ALL | E_STRICT ; $ controller = new PhpErrorController ( ) ; register_shutdown_function ( [ $ controller , 'on_fatal' , ] ) ; set_error_handler ( [ $ controller , 'on_error' ] , $ error_types ) ; set_exception_handler ( [ $ controller , 'on_exception' , ] ) ; // Ensure that channel Channels::PHP_ERROR error is there add_filter ( Channels :: FILTER_CHANNELS , function ( array $ channels ) { $ channels [ ] = Channels :: PHP_ERROR ; return $ channels ; } , PHP_INT_MAX ) ; return $ this ; }
Tell Wonolog to use the PHP errors handler.

@param int|null $error_types bitmask of error types constants, default to E_ALL | E_STRICT

@return Controller
Tell Wonolog to use the PHP errors handler .