Differences Between: [Versions 400 and 401] [Versions 400 and 402] [Versions 400 and 403]
1 <?php 2 3 /** 4 * SCSSPHP 5 * 6 * @copyright 2012-2020 Leaf Corcoran 7 * 8 * @license http://opensource.org/licenses/MIT MIT 9 * 10 * @link http://scssphp.github.io/scssphp 11 */ 12 13 namespace ScssPhp\ScssPhp\Logger; 14 15 /** 16 * A logger that prints to a PHP stream (for instance stderr) 17 */ 18 class StreamLogger implements LoggerInterface 19 { 20 private $stream; 21 private $closeOnDestruct; 22 23 /** 24 * @param resource $stream A stream resource 25 * @param bool $closeOnDestruct If true, takes ownership of the stream and close it on destruct to avoid leaks. 26 */ 27 public function __construct($stream, $closeOnDestruct = false) 28 { 29 $this->stream = $stream; 30 $this->closeOnDestruct = $closeOnDestruct; 31 } 32 33 /** 34 * @internal 35 */ 36 public function __destruct() 37 { 38 if ($this->closeOnDestruct) { 39 fclose($this->stream); 40 } 41 } 42 43 /** 44 * @inheritDoc 45 */ 46 public function warn($message, $deprecation = false) 47 { 48 $prefix = ($deprecation ? 'DEPRECATION ' : '') . 'WARNING: '; 49 50 fwrite($this->stream, $prefix . $message . "\n\n"); 51 } 52 53 /** 54 * @inheritDoc 55 */ 56 public function debug($message) 57 { 58 fwrite($this->stream, $message . "\n"); 59 } 60 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body