add modifier \u in phpheader
This commit is contained in:
parent
ae12e53215
commit
f9ba34adc1
3 changed files with 21 additions and 15 deletions
|
@ -1,5 +1,6 @@
|
||||||
0.0.2
|
0.0.2
|
||||||
- [ ] add global config for file size limit
|
- [ ] add global config for file size limit
|
||||||
|
- [x] add modifier _first upper case_ : _\u_ in bloc content
|
||||||
|
|
||||||
0.0.1
|
0.0.1
|
||||||
- First pre-release
|
- First pre-release
|
|
@ -5,7 +5,7 @@
|
||||||
**improve** is a plugin for the open-source
|
**improve** is a plugin for the open-source
|
||||||
web publishing software called Dotclear.
|
web publishing software called Dotclear.
|
||||||
|
|
||||||
It helps dev to clean up his plugin or theme before publishing its code.
|
It helps dev to clean up plugin or theme before publishing code.
|
||||||
|
|
||||||
* Open to third party plugin
|
* Open to third party plugin
|
||||||
* Easy and fast to use
|
* Easy and fast to use
|
||||||
|
|
|
@ -156,7 +156,11 @@ class ImproveActionPhpheader extends ImproveAction
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$this->bloc = str_replace(
|
$this->bloc = preg_replace_callback(
|
||||||
|
// use \u in bloc content for first_upper_case
|
||||||
|
'/(\\\u([a-z]{1}))/',
|
||||||
|
function($str) { return ucfirst($str[2]); },
|
||||||
|
str_replace(
|
||||||
$this->bloc_wildcards,
|
$this->bloc_wildcards,
|
||||||
[
|
[
|
||||||
date('Y'),
|
date('Y'),
|
||||||
|
@ -170,6 +174,7 @@ class ImproveActionPhpheader extends ImproveAction
|
||||||
$this->core->auth->getInfo('user_url')
|
$this->core->auth->getInfo('user_url')
|
||||||
],
|
],
|
||||||
$bloc
|
$bloc
|
||||||
|
)
|
||||||
);
|
);
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
self::notice(__('failed to parse bloc'));
|
self::notice(__('failed to parse bloc'));
|
||||||
|
|
Loading…
Reference in a new issue