@@ -41,15 +41,15 @@ |
||
41 | 41 | |
42 | 42 | public function trackUser(string $user): void |
43 | 43 | { |
44 | - echo "**** TRACK " . $user . "*****\n"; |
|
44 | + echo "**** TRACK ".$user."*****\n"; |
|
45 | 45 | |
46 | 46 | $titles = $this->getLastEditsbyUser($user); |
47 | 47 | |
48 | 48 | // filter titles already in edited.txt |
49 | 49 | $edited = file(self::ALREADY_EDITED_PATH, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); |
50 | 50 | $filtered = array_diff($titles, $edited); |
51 | - $list = new PageList( $filtered ); // TODO PageList factory in App ? |
|
52 | - echo ">" . $list->count() . " dans liste\n"; |
|
51 | + $list = new PageList($filtered); // TODO PageList factory in App ? |
|
52 | + echo ">".$list->count()." dans liste\n"; |
|
53 | 53 | |
54 | 54 | $this->consumeList($list); |
55 | 55 | } |
@@ -58,13 +58,13 @@ discard block |
||
58 | 58 | // idn_to_ascii('teßt.com',IDNA_NONTRANSITIONAL_TO_ASCII,INTL_IDNA_VARIANT_UTS46) |
59 | 59 | // checkdnsrr($string, "A") // check DNS record |
60 | 60 | if (!self::isHttpURL($url)) { |
61 | - throw new DomainException('URL not compatible : ' . $url); |
|
61 | + throw new DomainException('URL not compatible : '.$url); |
|
62 | 62 | } |
63 | 63 | $response = $this->client->get($url); |
64 | 64 | |
65 | 65 | if (200 !== $response->getStatusCode()) { |
66 | - echo 'HTTP error ' . $response->getStatusCode(); |
|
67 | - $this->log->error('HTTP error ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase()); |
|
66 | + echo 'HTTP error '.$response->getStatusCode(); |
|
67 | + $this->log->error('HTTP error '.$response->getStatusCode().' '.$response->getReasonPhrase()); |
|
68 | 68 | |
69 | 69 | return null; |
70 | 70 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public static function isHttpURL(string $url): bool |
83 | 83 | { |
84 | - return (bool)preg_match('#^https?://[^ ]+$#i', $url); |
|
84 | + return (bool) preg_match('#^https?://[^ ]+$#i', $url); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | /** |
@@ -103,19 +103,19 @@ discard block |
||
103 | 103 | $charset = $this->extractCharset($html) ?? 'WINDOWS-1252'; |
104 | 104 | |
105 | 105 | if (empty($charset)) { |
106 | - throw new DomainException('normalized html error and no charset found : ' . $url); |
|
106 | + throw new DomainException('normalized html error and no charset found : '.$url); |
|
107 | 107 | } |
108 | 108 | try { |
109 | 109 | $html2 = iconv($charset, 'UTF-8//TRANSLIT', $html); |
110 | 110 | if (false === $html2) { |
111 | - throw new DomainException("error iconv : $charset to UTF-8 on " . $url); |
|
111 | + throw new DomainException("error iconv : $charset to UTF-8 on ".$url); |
|
112 | 112 | } |
113 | 113 | $html2 = Normalizer::normalize($html2); |
114 | 114 | if (!is_string($html2)) { |
115 | - throw new DomainException("error normalizer : $charset to UTF-8 on " . $url); |
|
115 | + throw new DomainException("error normalizer : $charset to UTF-8 on ".$url); |
|
116 | 116 | } |
117 | 117 | } catch (Throwable $e) { |
118 | - throw new DomainException("error converting : $charset to UTF-8 on " . $url, $e->getCode(), $e); |
|
118 | + throw new DomainException("error converting : $charset to UTF-8 on ".$url, $e->getCode(), $e); |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | return $html2; |