This repository was archived by the owner on Jul 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +34
-3
lines changed
Expand file tree Collapse file tree 2 files changed +34
-3
lines changed Original file line number Diff line number Diff line change 11<?php
22$ stdin = fopen ('php://stdin ' , 'r ' );
3+ $ input = stream_get_contents ($ stdin );
4+ fclose ($ stdin );
35
4- while ( $ file = fgets ( $ stdin ) ) {
6+ foreach ( explode ( "\n" , $ input ) as $ file ) {
57 $ skip = false ;
6- $ file = rtrim ($ file );
78 $ f = @fopen ($ file , 'r ' );
89 if ($ f ) {
910 $ firstLine = fgets ($ f );
1920 echo "$ file; " . ($ skip ? '1 ' : '0 ' ) . "\n" ;
2021}
2122
22- fclose ($ stdin );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ /**
4+ * @testCase
5+ */
6+
7+ require __DIR__ . '/../vendor/nette/tester/Tester/bootstrap.php ' ;
8+ require_once __DIR__ . '/../src/Process.php ' ;
9+
10+ use Tester \Assert ;
11+
12+ $ filesToCheck = [
13+ __DIR__ . '/skip-on-5.3/class.php ' ,
14+ __DIR__ . '/skip-on-5.3/trait.php ' ,
15+ ];
16+
17+ for ($ i = 0 ; $ i < 15 ; $ i ++) {
18+ $ filesToCheck = array_merge ($ filesToCheck , $ filesToCheck );
19+ }
20+
21+ $ process = new \JakubOnderka \PhpParallelLint \SkipLintProcess ('php ' , $ filesToCheck );
22+
23+ while (!$ process ->isFinished ()) {
24+ usleep (100 );
25+ $ process ->getChunk ();
26+ }
27+
28+ foreach ($ filesToCheck as $ fileToCheck ) {
29+ $ status = $ process ->isSkipped ($ fileToCheck );
30+ Assert::notEqual (null , $ status );
31+ }
You can’t perform that action at this time.
0 commit comments