mirror of
https://framagit.org/hubzilla/core.git
synced 2026-06-21 00:52:33 -04:00
Move named inner function out in po2php.php
While PHP seems to be able to handle this construct, PHPStan don't. In this case there's also no reason for this to be an inner function, so just move it out to the global scope.
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
<?php
|
||||
|
||||
function escape_s($match){
|
||||
return str_replace('$','\$',$match[0]);
|
||||
}
|
||||
|
||||
function po2php_run($argc,$argv) {
|
||||
|
||||
if ($argc < 2) {
|
||||
@@ -42,10 +46,6 @@ function po2php_run($argc,$argv) {
|
||||
$inv = False;
|
||||
$escape_s_exp = '|[^\\\\]\$[a-z]|';
|
||||
|
||||
function escape_s($match){
|
||||
return str_replace('$','\$',$match[0]);
|
||||
}
|
||||
|
||||
foreach ($infile as $l) {
|
||||
$l = str_replace(array('$projectname','$Projectname'),array('\$projectname','\$Projectname'),$l);
|
||||
$len = strlen($l);
|
||||
|
||||
Reference in New Issue
Block a user