@@ -34,7 +34,7 @@ |
||
34 | 34 | echo "$title \n"; |
35 | 35 | |
36 | 36 | $pageAction = new WikiPageAction($wiki, $title); |
37 | - if($pageAction->getNs() !== 0 ) { |
|
37 | + if ($pageAction->getNs() !== 0) { |
|
38 | 38 | throw new \Exception("La page n'est pas dans Main (ns!==0)"); |
39 | 39 | } |
40 | 40 | $text = $pageAction->getText(); |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | $editInfo = new EditInfo(static::BOT_TALK_SUMMARY); |
59 | 59 | $success = $page->addToBottomOfThePage($addText, $editInfo); |
60 | 60 | |
61 | - return (bool)$success; |
|
61 | + return (bool) $success; |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | return null; |
87 | 87 | } |
88 | 88 | |
89 | - return (string)trim($sentences[array_rand($sentences)]); |
|
89 | + return (string) trim($sentences[array_rand($sentences)]); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -88,7 +88,7 @@ |
||
88 | 88 | // const TRADE = '™'; // ™ |
89 | 89 | // const REG = '®'; // ® |
90 | 90 | // const COPY = '©'; // © |
91 | - const ALL_SPACES = "\xE2\x80\xAF|\xC2\xAD|\xC2\xA0|\\s"; // Used in regexps. Better than \s |
|
91 | + const ALL_SPACES = "\xE2\x80\xAF|\xC2\xAD|\xC2\xA0|\\s"; // Used in regexps. Better than \s |
|
92 | 92 | |
93 | 93 | /** |
94 | 94 | * UTF8 first letter in upper case. |
@@ -66,8 +66,8 @@ |
||
66 | 66 | return $this->api->volumes->get($googleId); |
67 | 67 | } |
68 | 68 | |
69 | - private function checkGoogleQuota(){ |
|
70 | - if($this->quotaCounter->getCount() > 1000 ){ |
|
69 | + private function checkGoogleQuota() { |
|
70 | + if ($this->quotaCounter->getCount() > 1000) { |
|
71 | 71 | throw new \DomainException('Quota Google 1000 dépassé'); |
72 | 72 | } |
73 | 73 | $this->quotaCounter->increment(); |
@@ -111,7 +111,7 @@ |
||
111 | 111 | { |
112 | 112 | // Style "auto1234" |
113 | 113 | if (empty($this->getParam('périodique') || empty($this->getParam('date')))) { |
114 | - return 'auto'.(string)rand(1000, 9999); |
|
114 | + return 'auto'.(string) rand(1000, 9999); |
|
115 | 115 | } |
116 | 116 | // Style "LeMonde15022017" |
117 | 117 | $periodique = str_replace( |
@@ -22,7 +22,7 @@ |
||
22 | 22 | { |
23 | 23 | public function process($data): array |
24 | 24 | { |
25 | - if(!isset($data['JSON-LD'])) { |
|
25 | + if (!isset($data['JSON-LD'])) { |
|
26 | 26 | return []; |
27 | 27 | } |
28 | 28 | $data = $data['JSON-LD']; |
@@ -21,7 +21,7 @@ |
||
21 | 21 | { |
22 | 22 | public function process($data): array |
23 | 23 | { |
24 | - if(!isset($data['JSON-LD'])) { |
|
24 | + if (!isset($data['JSON-LD'])) { |
|
25 | 25 | return []; |
26 | 26 | } |
27 | 27 | $ld = $data['JSON-LD']; |
@@ -52,9 +52,9 @@ discard block |
||
52 | 52 | /** |
53 | 53 | * @var AbstractWikiTemplate |
54 | 54 | */ |
55 | - try{ |
|
55 | + try { |
|
56 | 56 | $tplObject = WikiTemplateFactory::create($tplName); |
57 | - }catch (\Throwable $e){ |
|
57 | + } catch (\Throwable $e) { |
|
58 | 58 | unset($e); |
59 | 59 | continue; |
60 | 60 | } |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | ) { |
190 | 190 | array_walk( |
191 | 191 | $matches, |
192 | - function (&$value) { |
|
192 | + function(&$value) { |
|
193 | 193 | $value = str_replace(['CURLYBRACKETO', 'CURLYBRACKETC'], ['{', '}'], $value); |
194 | 194 | } |
195 | 195 | ); |
@@ -54,7 +54,7 @@ |
||
54 | 54 | */ |
55 | 55 | try{ |
56 | 56 | $tplObject = WikiTemplateFactory::create($tplName); |
57 | - }catch (\Throwable $e){ |
|
57 | + } catch (\Throwable $e){ |
|
58 | 58 | unset($e); |
59 | 59 | continue; |
60 | 60 | } |
@@ -69,13 +69,13 @@ |
||
69 | 69 | private $dataAnalysis; |
70 | 70 | |
71 | 71 | public function __construct(DbAdapter $dbAdapter, Bot $bot, Memory $memory, RefGoogleBook $refGoogleBook, |
72 | - ?DataAnalysis $dataAnalysis=null) |
|
72 | + ?DataAnalysis $dataAnalysis = null) |
|
73 | 73 | { |
74 | 74 | $this->db = $dbAdapter; |
75 | 75 | $this->bot = $bot; |
76 | 76 | $this->memory = $memory; |
77 | 77 | $this->refGooConverter = $refGoogleBook; |
78 | - if($dataAnalysis) { |
|
78 | + if ($dataAnalysis) { |
|
79 | 79 | $this->dataAnalysis = $dataAnalysis; |
80 | 80 | } |
81 | 81 |