@@ -71,7 +71,7 @@ |
||
71 | 71 | return; |
72 | 72 | } |
73 | 73 | $newTitle = preg_replace( |
74 | - '#[- ]*(vidéo|site de|site|sur) ?' . $siteName . '$#i', |
|
74 | + '#[- ]*(vidéo|site de|site|sur) ?'.$siteName.'$#i', |
|
75 | 75 | '', |
76 | 76 | $this->template->getParam('titre') |
77 | 77 | ); |
@@ -56,7 +56,7 @@ |
||
56 | 56 | continue; |
57 | 57 | } |
58 | 58 | |
59 | - $this->optiStatus->addSummaryLog('++' . $param); |
|
59 | + $this->optiStatus->addSummaryLog('++'.$param); |
|
60 | 60 | $this->optiStatus->setMajor(true); |
61 | 61 | $this->optiStatus->setNotCosmetic(true); |
62 | 62 | } |
@@ -62,10 +62,10 @@ |
||
62 | 62 | */ |
63 | 63 | private function concatParamsAuteur1(OuvrageTemplate $ouvrage, ?int $num = 1): ?string |
64 | 64 | { |
65 | - $auteur = $ouvrage->getParam('auteur' . $num) ?? ''; |
|
66 | - $prenom = $ouvrage->getParam('prénom' . $num) ?? ''; |
|
67 | - $nom = $ouvrage->getParam('nom' . $num) ?? ''; |
|
65 | + $auteur = $ouvrage->getParam('auteur'.$num) ?? ''; |
|
66 | + $prenom = $ouvrage->getParam('prénom'.$num) ?? ''; |
|
67 | + $nom = $ouvrage->getParam('nom'.$num) ?? ''; |
|
68 | 68 | |
69 | - return trim($auteur . ' ' . $prenom . ' ' . $nom); |
|
69 | + return trim($auteur.' '.$prenom.' '.$nom); |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | \ No newline at end of file |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | { |
50 | 50 | $data = $this->getFileData(); |
51 | 51 | $this->lastDate = new DateTime($data['date'], new DateTimeZone(static::REBOOT_TIMEZONE)); |
52 | - $this->count = (int)$data['count']; |
|
52 | + $this->count = (int) $data['count']; |
|
53 | 53 | |
54 | 54 | // Today reboot date/time of the quota |
55 | 55 | $todayBoot = new DateTime(); |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | |
71 | 71 | try { |
72 | 72 | $json = file_get_contents(static::JSON_FILENAME); |
73 | - $array = (array)json_decode($json, true, 512, JSON_THROW_ON_ERROR); |
|
73 | + $array = (array) json_decode($json, true, 512, JSON_THROW_ON_ERROR); |
|
74 | 74 | } catch (Throwable) { |
75 | 75 | throw new ConfigException('Error on Google Quota file : reading or JSON malformed.'); |
76 | 76 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | */ |
22 | 22 | class InternetDomainParser implements InternetDomainParserInterface |
23 | 23 | { |
24 | - private const PATH_CACHE_PUBLIC_SUFFIX_LIST = __DIR__ . '/resources/public_suffix_list.dat'; |
|
24 | + private const PATH_CACHE_PUBLIC_SUFFIX_LIST = __DIR__.'/resources/public_suffix_list.dat'; |
|
25 | 25 | |
26 | 26 | private readonly Rules $rules; |
27 | 27 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | public static function extractSubdomainString(string $httpURL): string |
56 | 56 | { |
57 | 57 | if (!ExternHttpClient::isHttpURL($httpURL)) { |
58 | - throw new Exception('string is not an URL ' . $httpURL); |
|
58 | + throw new Exception('string is not an URL '.$httpURL); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | return parse_url($httpURL, PHP_URL_HOST); |
@@ -48,7 +48,7 @@ |
||
48 | 48 | /** |
49 | 49 | * @throws Exception |
50 | 50 | */ |
51 | - public function insertPageOuvrages(array $datas): bool|array |
|
51 | + public function insertPageOuvrages(array $datas): bool | array |
|
52 | 52 | { |
53 | 53 | // check if article already in db |
54 | 54 | $page = $datas[0]['page']; |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | |
15 | 15 | class ExternHttpErrorLogic |
16 | 16 | { |
17 | - public const LOG_REQUEST_ERROR = __DIR__ . '/../../Application/resources/external_request_error.log'; |
|
17 | + public const LOG_REQUEST_ERROR = __DIR__.'/../../Application/resources/external_request_error.log'; |
|
18 | 18 | |
19 | 19 | public function __construct(private readonly LoggerInterface $log = new NullLogger()) |
20 | 20 | { |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | } |
41 | 41 | return $url; |
42 | 42 | } elseif (preg_match('#401 Unauthorized#i', $errorMessage)) { |
43 | - $this->log->notice('401 Unauthorized : skip ' . $url); |
|
43 | + $this->log->notice('401 Unauthorized : skip '.$url); |
|
44 | 44 | |
45 | 45 | return $url; |
46 | 46 | } else { |
47 | 47 | // autre : ne pas générer de {lien brisé}, car peut-être 404 temporaire |
48 | - $this->log->warning('erreur sur extractWebData ' . $errorMessage); |
|
48 | + $this->log->warning('erreur sur extractWebData '.$errorMessage); |
|
49 | 49 | |
50 | 50 | //file_put_contents(self::LOG_REQUEST_ERROR, $this->domain."\n", FILE_APPEND); |
51 | 51 | |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | $text = str_replace(['https://', 'http://', 'www.'], '', $url); |
74 | 74 | if (strlen($text) > 30) { |
75 | - $text = substr($text, 0, 30) . '…'; |
|
75 | + $text = substr($text, 0, 30).'…'; |
|
76 | 76 | } |
77 | 77 | |
78 | 78 | return $text; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | protected function log403(string $url): void |
82 | 82 | { |
83 | - $this->log->warning('403 Forbidden : ' . $url); |
|
84 | - file_put_contents(self::LOG_REQUEST_ERROR, '403 Forbidden : ' . $url . "\n", FILE_APPEND); |
|
83 | + $this->log->warning('403 Forbidden : '.$url); |
|
84 | + file_put_contents(self::LOG_REQUEST_ERROR, '403 Forbidden : '.$url."\n", FILE_APPEND); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | \ No newline at end of file |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $this->summary->memo['sites'][] = $this->externalPage->getPrettyDomainName(); // ??? |
33 | 33 | } |
34 | 34 | if (isset($mapData['accès url'])) { |
35 | - $this->log->debug('accès |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | ) |
55 | 55 | { |
56 | 56 | if (!ExternHttpClient::isHttpURL($url)) { |
57 | - throw new Exception('string is not an URL ' . $url); |
|
57 | + throw new Exception('string is not an URL '.$url); |
|
58 | 58 | } |
59 | 59 | $this->url = $url; |
60 | 60 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | { |
171 | 171 | try { |
172 | 172 | if (!ExternHttpClient::isHttpURL($this->url)) { |
173 | - throw new Exception('string is not an URL ' . $this->url); |
|
173 | + throw new Exception('string is not an URL '.$this->url); |
|
174 | 174 | } |
175 | 175 | if (!$this->domainParser instanceof InternetDomainParserInterface) { |
176 | 176 | $this->log->notice('InternetDomainParser is not set'); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | return $this->domainParser->getRegistrableDomainFromURL($this->url); |
182 | 182 | } catch (Exception $e) { |
183 | 183 | if ($this->log !== null) { |
184 | - $this->log->warning('InternetDomainParser->getRegistrableDomainFromURL NULL ' . $this->url); |
|
184 | + $this->log->warning('InternetDomainParser->getRegistrableDomainFromURL NULL '.$this->url); |
|
185 | 185 | } |
186 | 186 | throw new Exception('InternetDomainParser->getRegistrableDomainFromURL NULL', $e->getCode(), $e); |
187 | 187 | } |