File tree Expand file tree Collapse file tree 2 files changed +10
-47
lines changed
Expand file tree Collapse file tree 2 files changed +10
-47
lines changed Original file line number Diff line number Diff line change 1313 strategy :
1414 fail-fast : false
1515 matrix :
16- php : [ '8.1', '8. 2' ]
16+ php : [ '8.2' ]
1717 extensions : [ '' ]
1818 os : [ubuntu-latest]
1919 include :
5858
5959 - name : Run tests
6060 run : vendor/bin/phpunit --colors=always
61-
62- static_analysis :
63- name : Static analysis
64- runs-on : ubuntu-latest
65-
66- steps :
67- - name : Checkout
68- uses : actions/checkout@v4
69-
70- - name : Setup PHP
71- uses : shivammathur/setup-php@v2
72- with :
73- coverage : " none"
74- php-version : " 8.2"
75- ini-file : development
76-
77- - name : Install dependencies
78- run : composer update --ansi --no-progress
79-
80- - name : Install phpstan
81- run : composer bin phpstan update --ansi --no-progress
82-
83- - name : Run phpstan
84- run : vendor-bin/phpstan/vendor/bin/phpstan analyse --ansi --no-progress
85-
86- coding_styles :
87- name : Coding styles
88- runs-on : ubuntu-latest
89-
90- steps :
91- - name : Checkout
92- uses : actions/checkout@v4
93-
94- - name : Setup PHP
95- uses : shivammathur/setup-php@v2
96- with :
97- coverage : " none"
98- php-version : " 8.2"
99- ini-file : development
100-
101- - name : Install dependencies
102- run : composer update --ansi --no-progress
103-
104- - name : Run phpcs
105- run : vendor/bin/phpcs --extensions=php bin src tests *.php
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public function __construct($stream, $closeOnDestruct = false)
3737 */
3838 public function __destruct ()
3939 {
40- if ($ this ->closeOnDestruct ) {
40+ if ($ this ->closeOnDestruct && $ this -> stream ) {
4141 fclose ($ this ->stream );
4242 }
4343 }
@@ -47,6 +47,10 @@ public function __destruct()
4747 */
4848 public function warn ($ message , $ deprecation = false )
4949 {
50+ if (!$ this ->stream ) {
51+ return ;
52+ }
53+
5054 $ prefix = ($ deprecation ? 'DEPRECATION ' : '' ) . 'WARNING: ' ;
5155
5256 fwrite ($ this ->stream , $ prefix . $ message . "\n\n" );
@@ -57,6 +61,10 @@ public function warn($message, $deprecation = false)
5761 */
5862 public function debug ($ message )
5963 {
64+ if (!$ this ->stream ) {
65+ return ;
66+ }
67+
6068 fwrite ($ this ->stream , $ message . "\n" );
6169 }
6270}
You can’t perform that action at this time.
0 commit comments