public function setSilentErrorHandler() {

        set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) {
            if (0 === error_reporting()) {
                return false;
            }

            if($this->logger != null) {
                // logging all warnings & notices
                $this->getLogger()->log($errstr, Logger::CRITICAL);
            }
        });
    }
public function setSilentErrorHandler() {

        set_error_handler(function($errno, $errstr, $errfile, $errline, array $errcontext) {
            if (0 === error_reporting()) {
                return false;
            }

            if($this->logger != null) {
                // logging all warnings & notices
                $this->getLogger()->log($errstr, Logger::CRITICAL);
            }
        });
    }
public function setSilentErrorHandler ( ) { set_error_handler ( function ( $ errno , $ errstr , $ errfile , $ errline , array $ errcontext ) { if ( 0 === error_reporting ( ) ) { return false ; } if ( $ this -> logger != null ) { // logging all warnings & notices $ this -> getLogger ( ) -> log ( $ errstr , Logger :: CRITICAL ) ; } } ) ; }
Silent error handler
catching WARNINGS & NOTICIES
Silent error handler catching WARNINGS & NOTICIES