@@ -44,25 +44,19 @@ public function validate(OutputInterface $output, SymfonyStyle $io): int
4444 }
4545
4646 $ failedUrls = [];
47- foreach ($ client -> stream ( $ allResponses) as $ response => $ chunk ) {
47+ foreach ($ allResponses as $ response ) {
4848 try {
4949 $ url = $ response ->getInfo ('url ' );
5050
51- if ($ chunk ->isTimeout ()) {
52- if (!isset ($ failedUrls [$ url ])) {
53- $ failedUrls [$ url ] = "Timeout for: {$ url }" ;
54- }
55- } elseif ($ chunk ->isFirst ()) {
56- $ statusCode = $ response ->getStatusCode ();
57- if (200 !== $ statusCode ) {
58- $ failedUrls [$ url ] = "HTTP {$ statusCode } error for: {$ url }" ;
59- }
60- } elseif ($ chunk ->isLast ()) {
61- if (!\array_key_exists ($ url , $ failedUrls )) {
62- $ checkError = $ this ->checkContentResponse ($ response ->getInfo ('url ' ), $ response ->getContent ());
63- if (\is_string ($ checkError )) {
64- $ failedUrls [$ url ] = $ checkError ;
65- }
51+ $ statusCode = $ response ->getStatusCode ();
52+ if (200 !== $ statusCode ) {
53+ $ failedUrls [$ url ] = "HTTP {$ statusCode } error for: {$ url }" ;
54+ }
55+
56+ if (!\array_key_exists ($ url , $ failedUrls )) {
57+ $ checkError = $ this ->checkContentResponse ($ response ->getInfo ('url ' ), $ response ->getContent ());
58+ if (\is_string ($ checkError )) {
59+ $ failedUrls [$ url ] = $ checkError ;
6660 }
6761 }
6862 } catch (Throwable $ e ) {
0 commit comments