Passed
Push — dev ( eba0dc...b8ced8 )
by Dispositif
02:52
created
src/Domain/ImportOuvrageFromApi.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -60,14 +60,14 @@
 block discarded – undo
60 60
          */
61 61
         $data = $this->mapping($volume);
62 62
 
63
-        if(isset($data['infos'])) {
63
+        if (isset($data['infos'])) {
64 64
             $infos = $data['infos'];
65 65
             unset($data['infos']);
66 66
         }
67 67
 
68 68
         try {
69 69
             $this->ouvrage->hydrate($data);
70
-            if(isset($infos)) {
70
+            if (isset($infos)) {
71 71
                 $this->ouvrage->setInfos($infos);
72 72
             }
73 73
         } catch (Throwable $e) {
Please login to merge, or discard this patch.
src/Infrastructure/WikidataAdapter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@
 block discarded – undo
40 40
             $res = $this->searchByISNI($infos['ISNIAuteur1']);
41 41
         }
42 42
         if (isset($infos['isbn'])) {
43
-            if(!empty($res)) {
43
+            if (!empty($res)) {
44 44
                 sleep(2);
45 45
             }
46 46
             $res = array_merge($res, $this->findArticleByISBN13($infos['isbn']));
Please login to merge, or discard this patch.
src/Application/Examples/avancement.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,10 +40,10 @@
 block discarded – undo
40 40
 $db = new Mysql($pdo);
41 41
 
42 42
 $monitor = $db->fetchRow('select count(id) from temprawopti where optidate is not null');
43
-$number = (int)$monitor['count(id)'];
43
+$number = (int) $monitor['count(id)'];
44 44
 
45 45
 $monitor = $db->fetchRow('select count(distinct page) as pages from temprawopti where optidate is not null and isbn<>""');
46
-$pageNb = (int)$monitor['pages'];
46
+$pageNb = (int) $monitor['pages'];
47 47
 
48 48
 $newText = <<<EOF
49 49
 <div style="background:#EBF6E9;border:2px solid grey;padding:10px;border-radius:10px;">
Please login to merge, or discard this patch.
src/Domain/TypoTokenizer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
         // PUNCTUATION conversion
53 53
         $punctuationColl = array_filter(
54 54
             TextUtil::ALL_PUNCTUATION,
55
-            function ($value) {
55
+            function($value) {
56 56
                 // skip punctuation chars from mixed names (example : "Pierre-Marie L'Anglois")
57 57
                 return !in_array($value, ["'", '-', '-']);
58 58
             }
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
             }
72 72
             if (preg_match('#^(PATTERNINITIAL|PATTERNURL|PATTERNAND|PATTERNCOMMA|PATTERNBIBABREV|PATTERNPUNCTUATION)$#', $tok, $matches) > 0) {
73 73
 
74
-                $shortpattern = str_replace('PATTERN','', $tok);
74
+                $shortpattern = str_replace('PATTERN', '', $tok);
75 75
                 $res['pattern'] .= ' '.$shortpattern; // PATTERNAND -> AND
76 76
                 if (in_array($matches[1], ['PATTERNCOMMA', 'PATTERNPUNCTUATION']) || empty($matches[1])) {
77 77
                     $res['value'][] = '*';
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $modText = preg_replace_callback_array(
129 129
             [
130 130
                 // URL
131
-                '#\bhttps?://[^ \]]+#i' => function ($match) {
131
+                '#\bhttps?://[^ \]]+#i' => function($match) {
132 132
                     // '#https?\:\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+\#]*[\w\-\@?^=%&amp;/~\+#])?#'
133 133
                     $this->tokenValue['URL'][] = $match[0];
134 134
 
@@ -136,26 +136,26 @@  discard block
 block discarded – undo
136 136
                 },
137 137
                 // BIBABREV : "dir.", "trad.", "(dir.)", "[dir.]", etc.
138 138
                 // TODO: regex flaw : "(" not evaluated in BIBABREV. Example : "(dir.)"
139
-                '#\b[(\[]?(collectif|coll\.|dir\.|trad\.|coord\.|ill\.)[)\]]?#i' => function ($match) {
139
+                '#\b[(\[]?(collectif|coll\.|dir\.|trad\.|coord\.|ill\.)[)\]]?#i' => function($match) {
140 140
                     $this->tokenValue['BIBABREV'][] = $match[0]; // [1] = dir
141 141
 
142 142
                     return ' PATTERNBIBABREV ';
143 143
                 },
144 144
                 // AND
145
-                '# (et|and|&|with|avec|e) #i' => function ($match) {
145
+                '# (et|and|&|with|avec|e) #i' => function($match) {
146 146
                     $this->tokenValue['AND'][] = $match[0];
147 147
 
148 148
                     return ' PATTERNAND ';
149 149
                 },
150 150
                 // COMMA
151
-                '#,#' => function () {
151
+                '#,#' => function() {
152 152
                     return ' PATTERNCOMMA ';
153 153
                 },
154 154
                 // INITIAL : 2) convert letter ("A.") or junior ("Jr.") or senior ("Sr.")
155 155
                 // extract initial before "." converted in PUNCTUATION
156 156
                 // Note : \b word boundary match between "L" and "'Amour" in "L'Amour"  (for [A-Z]\b)
157 157
                 // \b([A-Z]\. |[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)+ for grouping "A. B." in same INITIAL ?
158
-                "#\b([A-Z]\.|[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)#" => function ($match) {
158
+                "#\b([A-Z]\.|[A-Z] |JR|Jr\.|Jr\b|Sr\.|Sr\b)#" => function($match) {
159 159
                     $this->tokenValue['INITIAL'][] = $match[0];
160 160
 
161 161
                     return ' PATTERNINITIAL ';
Please login to merge, or discard this patch.
src/Application/Examples/Monitor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
             [
95 95
                 'page' => $title ?? '',
96 96
                 'verify' => date("Y-m-d H:i:s"),
97
-                'altered' => (int)$stat,
97
+                'altered' => (int) $stat,
98 98
             ]
99 99
         );
100 100
     }
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 
150 150
         }
151 151
 
152
-        return (int)round(($count - $found) / count($data) * 100);
152
+        return (int) round(($count - $found) / count($data) * 100);
153 153
     }
154 154
 
155 155
 }
Please login to merge, or discard this patch.
src/Application/Examples/plumeBot.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
src/Domain/Utils/TextUtil.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
     //    const TRADE = '™'; // &trade;
89 89
     //    const REG = '®'; // &reg;
90 90
     //    const COPY = '©'; // &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.
Please login to merge, or discard this patch.
src/Domain/Models/Wiki/ArticleTemplate.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -111,7 +111,7 @@
 block discarded – undo
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(
Please login to merge, or discard this patch.
src/Domain/Publisher/LiberationMapper.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
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'];
Please login to merge, or discard this patch.