diff --git a/CHANGELOG.md b/CHANGELOG.md index 8fdd4b0..c1dc69f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ dev - [ ] add module to check directory structure - [ ] add module to create full README file - [ ] write documentation of php class +- update structure to php namespace +- update php cs fixer rules to dc2.21 / php7.4 +- update phpstan to 1.1.2 0.7.1 - 2021.11.08 - Fix php < 8 _ thanks @Gvx- _ closes #5 diff --git a/_admin.php b/_admin.php index 0095e0f..e3b9222 100644 --- a/_admin.php +++ b/_admin.php @@ -10,33 +10,73 @@ * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ -$core->blog->settings->addNamespace('improve'); +declare(strict_types=1); -$core->addBehavior('adminDashboardFavorites', ['ImproveBehaviors', 'adminDashboardFavorites']); +namespace plugins\improve; -$core->addBehavior('improveAddAction', ['ImproveActionDcdeprecated', 'create']); -$core->addBehavior('improveAddAction', ['ImproveActionDcstore', 'create']); -$core->addBehavior('improveAddAction', ['ImproveActionEndoffile', 'create']); -$core->addBehavior('improveAddAction', ['ImproveActionGitshields', 'create']); -$core->addBehavior('improveAddAction', ['ImproveActionLicensefile', 'create']); -//$core->addBehavior('improveAddAction', ['ImproveActionLicense', 'create']); -$core->addBehavior('improveAddAction', ['ImproveActionNewline', 'create']); -$core->addBehavior('improveAddAction', ['ImproveActionPhpcsfixer', 'create']); -$core->addBehavior('improveAddAction', ['ImproveActionPhpheader', 'create']); -$core->addBehavior('improveAddAction', ['ImproveActionPhpstan', 'create']); -$core->addBehavior('improveAddAction', ['ImproveActionTab', 'create']); -$core->addBehavior('improveAddAction', ['ImproveActionZip', 'create']); +if (!defined('DC_CONTEXT_ADMIN')) { + return; +} -$_menu['Plugins']->addItem( - __('improve'), - $core->adminurl->get('admin.plugin.improve'), - dcPage::getPF('improve/icon.png'), - preg_match('/' . preg_quote($core->adminurl->get('admin.plugin.improve')) . '(&.*)?$/', $_SERVER['REQUEST_URI']), - $core->auth->isSuperAdmin() -); +/* dotclear */ +use dcCore; +use dcPage; +use dcFavorites; -class ImproveBehaviors +/* clearbricks */ +use files; + +/* php */ +use ArrayObject; + +/** + * Improve admin class + * + * Add menu and dashboard icons, load Improve action modules. + */ +class admin { + public static function process(dcCore $core, ArrayObject $_menu): void + { + self::addSettingsNamespace($core); + self::addAdminBehaviors($core); + self::addAdminMenu($core, $_menu); + self::addImproveActions($core); + } + + private static function addSettingsNamespace(dcCore $core): void + { + $core->blog->settings->addNamespace('improve'); + } + + private static function addAdminBehaviors(dcCore $core): void + { + $core->addBehavior('adminDashboardFavorites', __NAMESPACE__ . '\admin::adminDashboardFavorites'); + } + + private static function addAdminMenu(dcCore $core, ArrayObject $_menu): void + { + $_menu['Plugins']->addItem( + __('improve'), + $core->adminurl->get('admin.plugin.improve'), + dcPage::getPF('improve/icon.png'), + preg_match('/' . preg_quote($core->adminurl->get('admin.plugin.improve')) . '(&.*)?$/', $_SERVER['REQUEST_URI']), + $core->auth->isSuperAdmin() + ); + } + + private static function addImproveActions(dcCore $core): void + { + global $__autoload; + + foreach (files::scandir(prepend::getActionsDir()) as $file) { + if (is_file(prepend::getActionsDir() . $file) && '.php' == substr($file, -4)) { + $__autoload[prepend::getActionsNS() . substr($file, 0, -4)] = prepend::getActionsDir() . $file; + $core->addBehavior('improveAddAction', [prepend::getActionsNS() . substr($file, 0, -4), 'create']); /* @phpstan-ignore-line */ + } + } + } + public static function adminDashboardFavorites(dcCore $core, dcFavorites $favs): void { $favs->register( @@ -46,8 +86,11 @@ class ImproveBehaviors 'url' => $core->adminurl->get('admin.plugin.improve'), 'small-icon' => dcPage::getPF('improve/icon.png'), 'large-icon' => dcPage::getPF('improve/icon-b.png'), - 'permissions' => null + 'permissions' => null, ] ); } } + +/* process */ +admin::process($core, $_menu); diff --git a/_config.php b/_config.php index 0a15a3e..2a4afbd 100644 --- a/_config.php +++ b/_config.php @@ -10,54 +10,105 @@ * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ +declare(strict_types=1); + +namespace plugins\improve; + if (!defined('DC_CONTEXT_ADMIN')) { return; } -# Check user perms -dcPage::checkSuper(); +/* dotclear */ +use dcCore; +use adminModulesList; +use dcPage; -$improve = new Improve($core); +/* clearbricks */ +use form; -$combo_actions = []; -foreach ($improve->modules() as $action) { - $combo_actions[$action->name()] = $action->id(); -} -$disabled = $improve->disabled(); -if (!empty($disabled)) { - $combo_actions = array_merge($combo_actions, array_flip($disabled)); -} +/* php */ +use Exception; -if (!empty($_POST['save'])) { - try { - $pdisabled = ''; - if (!empty($_POST['disabled'])) { - $pdisabled = implode(';', $_POST['disabled']); +/** + * Admin Improve configuration class + * + * Set preference for this plugin. + */ +class config +{ + /** @var dcCore $core dcCore instance */ + private $core = null; + /** @var adminModulesList $list adminModulesList instance */ + private $list = null; + /** @var improve $improve improve core instance */ + private $improve = null; + + public function __construct(dcCore $core, adminModulesList $list) + { + dcPage::checkSuper(); + + $this->core = $core; + $this->list = $list; + $this->improve = new improve($core); + + $this->saveConfig(); + $this->displayConfig(); + } + + private function getModules(): array + { + $modules = []; + foreach ($this->improve->modules() as $action) { + $modules[$action->name()] = $action->id(); } - $core->blog->settings->improve->put('disabled', $pdisabled); - $core->blog->settings->improve->put('nodetails', !empty($_POST['nodetails'])); - dcPage::addSuccessNotice(__('Configuration successfully updated')); + $modules = array_merge($modules, array_flip($this->improve->disabled())); - $core->adminurl->redirect( - 'admin.plugins', - ['module' => 'improve', 'conf' => 1, 'chk' => 1, 'redir' => $list->getRedir()] - ); - } catch (Exception $e) { - $core->error->add($e->getMessage()); + return $modules; + } + + private function saveConfig(): void + { + if (empty($_POST['save'])) { + return; + } + + try { + $pdisabled = ''; + if (!empty($_POST['disabled']) && is_array($_POST['disabled'])) { + $pdisabled = implode(';', $_POST['disabled']); + } + $this->core->blog->settings->improve->put('disabled', $pdisabled); + $this->core->blog->settings->improve->put('nodetails', !empty($_POST['nodetails'])); + + dcPage::addSuccessNotice(__('Configuration successfully updated')); + + $this->core->adminurl->redirect( + 'admin.plugins', + ['module' => 'improve', 'conf' => 1, 'chk' => 1, 'redir' => $this->list->getRedir()] + ); + } catch (Exception $e) { + $this->core->error->add($e->getMessage()); + } + } + + private function displayConfig(): void + { + echo '
' . - __('Use comma separated list of extensions without dot, recommand "php,js,xml,txt,md".') . - '
'; - } - - public function readFile(string &$content): ?bool - { - $ext = $this->getSetting('extensions'); - if (!is_array($ext) || !in_array($this->path_extension, $ext)) { - return null; - } - $clean = (string) preg_replace( - '/(\n\s+\n)/', - "\n\n", - (string) preg_replace( - '/(\n\n+)/', - "\n\n", - (string) str_replace( - ["\r\n", "\r"], - "\n", - $content - ) - ) - ); - if ($content != $clean) { - $this->setSuccess(__('Replace bad new lines')); - $content = $clean; - } - - return true; - } -} - -class ImproveActionEndoffile extends ImproveAction -{ - protected function init(): bool - { - $this->setProperties([ - 'id' => 'endoffile', - 'name' => __('End of files'), - 'description' => __('Remove php tag and empty lines from end of files'), - 'priority' => 860, - 'configurator' => true, - 'types' => ['plugin', 'theme'] - ]); - - return true; - } - - public function isConfigured(): bool - { - return true; - } - - public function configure($url): ?string - { - if (!empty($_POST['save'])) { - $this->setSettings('psr2', !empty($_POST['endoffile_psr2'])); - $this->redirect($url); - } - - return - '' . - __('PSR2 must have a blank line, whereas PSR12 must not.') . - '
'; - } - - public function readFile(&$content): ?bool - { - if (!in_array($this->path_extension, ['php', 'md'])) { - return null; - } - $clean = preg_replace( - ['/(\s*)(\?>\s*)$/', '/\n+$/'], - '', - $content - ) . ($this->getSetting('psr2') ? "\n" : ''); - if ($content != $clean) { - $this->setSuccess(__('Replace end of file')); - $content = $clean; - } - - return true; - } -} diff --git a/inc/lib.improve.action.dcdeprecated.php b/inc/module/dcdeprecated.php similarity index 92% rename from inc/lib.improve.action.dcdeprecated.php rename to inc/module/dcdeprecated.php index cbaa528..1e362ea 100644 --- a/inc/lib.improve.action.dcdeprecated.php +++ b/inc/module/dcdeprecated.php @@ -10,7 +10,17 @@ * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ -class ImproveActionDcdeprecated extends ImproveAction +declare(strict_types=1); + +namespace plugins\improve\module; + +/* improve */ +use plugins\improve\action; + +/** + * Improve action module Dotclear depreciated + */ +class dcdeprecated extends action { /** @var array Deprecated functions [filetype [pattern, deprecated, replacement, version]] */ private static $deprecated = [ @@ -44,7 +54,7 @@ class ImproveActionDcdeprecated extends ImproveAction ['adminPostForm[^I]', 'adminPostForm', 'adminPostFormItems'], ['adminPostFormSidebar', 'adminPostFormSidebar', 'adminPostFormItems'], - ['three-cols', 'three-cols', 'three-boxes', '2.6'] + ['three-cols', 'three-cols', 'three-boxes', '2.6'], ], 'js' => [ ['\sstoreLocalData', 'storeLocalData', 'dotclear.storeLocalData'], @@ -55,8 +65,8 @@ class ImproveActionDcdeprecated extends ImproveAction ['\smergeDeep', 'mergeDeep', 'dotclear.mergeDeep'], ['\sgetCookie', 'getCookie', 'dotclear.getCookie'], ['\ssetCookie', 'setCookie', 'dotclear.setCookie'], - ['\sdeleteCookie', 'deleteCookie', 'dotclear.deleteCookie'] - ] + ['\sdeleteCookie', 'deleteCookie', 'dotclear.deleteCookie'], + ], ]; protected function init(): bool @@ -66,7 +76,7 @@ class ImproveActionDcdeprecated extends ImproveAction 'name' => __('Dotclear deprecated'), 'description' => __('Search for use of deprecated Dotclear functions'), 'priority' => 520, - 'types' => ['plugin', 'theme'] + 'types' => ['plugin', 'theme'], ]); return true; diff --git a/inc/lib.improve.action.dcstore.php b/inc/module/dcstore.php similarity index 89% rename from inc/lib.improve.action.dcstore.php rename to inc/module/dcstore.php index b77173d..6414fcc 100644 --- a/inc/lib.improve.action.dcstore.php +++ b/inc/module/dcstore.php @@ -10,8 +10,31 @@ * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ -class ImproveActionDcstore extends ImproveAction +declare(strict_types=1); + +namespace plugins\improve\module; + +/* improve */ +use plugins\improve\action; + +/* clearbricks */ +use form; +use files; +use text; +use xmlTag; +use DOMDocument; + +/* php */ +use Exception; + +/** + * Improve action module dcstore.xml + */ +class dcstore extends action { + /** @var string Settings dcstore zip url pattern */ + private $pattern = ''; + protected function init(): bool { $this->setProperties([ @@ -20,9 +43,12 @@ class ImproveActionDcstore extends ImproveAction 'description' => __('Re-create dcstore.xml file according to _define.php variables'), 'priority' => 420, 'configurator' => true, - 'types' => ['plugin', 'theme'] + 'types' => ['plugin', 'theme'], ]); + $pattern = $this->getSetting('pattern'); + $this->pattern = is_string($pattern) ? $pattern : ''; + return true; } @@ -42,7 +68,7 @@ class ImproveActionDcstore extends ImproveAction '' . __('File will be overwritten if it exists') . '
' . '' . + form::field('dcstore_pattern', 160, 255, $this->pattern) . '' . '
' . '' . sprintf(__('You can use wildcards %s'), '%author%, %type%, %id%, %version%.') . @@ -187,25 +213,20 @@ class ImproveActionDcstore extends ImproveAction private function parseFilePattern(): string { - $str = $this->getSetting('pattern'); - if (!is_string($str)) { - return ''; - } - return text::tidyURL(str_replace( [ '%type%', '%id%', '%version%', - '%author%' + '%author%', ], [ $this->module['type'], $this->module['id'], $this->module['version'], - $this->module['author'] + $this->module['author'], ], - $str + $this->pattern )); } } diff --git a/inc/module/endoffile.php b/inc/module/endoffile.php new file mode 100644 index 0000000..96c2b25 --- /dev/null +++ b/inc/module/endoffile.php @@ -0,0 +1,80 @@ +setProperties([ + 'id' => 'endoffile', + 'name' => __('End of files'), + 'description' => __('Remove php tag and empty lines from end of files'), + 'priority' => 860, + 'configurator' => true, + 'types' => ['plugin', 'theme'], + ]); + + return true; + } + + public function isConfigured(): bool + { + return true; + } + + public function configure($url): ?string + { + if (!empty($_POST['save'])) { + $this->setSettings('psr2', !empty($_POST['endoffile_psr2'])); + $this->redirect($url); + } + + return + '
' . + __('PSR2 must have a blank line, whereas PSR12 must not.') . + '
'; + } + + public function readFile(&$content): ?bool + { + if (!in_array($this->path_extension, ['php', 'md'])) { + return null; + } + $clean = preg_replace( + ['/(\s*)(\?>\s*)$/', '/\n+$/'], + '', + $content + ) . ($this->getSetting('psr2') ? "\n" : ''); + if ($content != $clean) { + $this->setSuccess(__('Replace end of file')); + $content = $clean; + } + + return true; + } +} diff --git a/inc/lib.improve.action.gitshields.php b/inc/module/gitshields.php similarity index 83% rename from inc/lib.improve.action.gitshields.php rename to inc/module/gitshields.php index eba9080..3bafafd 100644 --- a/inc/lib.improve.action.gitshields.php +++ b/inc/module/gitshields.php @@ -10,8 +10,27 @@ * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ -class ImproveActionGitshields extends ImproveAction +declare(strict_types=1); + +namespace plugins\improve\module; + +/* improve */ +use plugins\improve\action; + +/* clearbricks */ +use form; + +/** + * Improve action module Github shields.io + */ +class gitshields extends action { + /** @var string Username of git repo */ + private $username = ''; + + /** @var boolean add Dotaddict shield */ + private $dotaddict = false; + /** @var boolean Stop scaning files */ private $stop_scan = false; @@ -21,7 +40,7 @@ class ImproveActionGitshields extends ImproveAction /** @var array Search patterns */ protected $bloc_pattern = [ 'remove' => '/\[!\[Release(.*)LICENSE\)/ms', - 'target' => '/^([^\n]+)[\r\n|\n]{1,}/ms' + 'target' => '/^([^\n]+)[\r\n|\n]{1,}/ms', ]; /** @var array Shields patterns */ @@ -31,7 +50,7 @@ class ImproveActionGitshields extends ImproveAction 'issues' => '[![Issues](https://img.shields.io/github/issues/%username%/%module%)](https://github.com/%username%/%module%/issues)', 'dotclear' => '[![Dotclear](https://img.shields.io/badge/dotclear-v%dotclear%-blue.svg)](https://fr.dotclear.org/download)', 'dotaddict' => '[![Dotaddict](https://img.shields.io/badge/dotaddict-official-green.svg)](https://%type%s.dotaddict.org/dc2/details/%module%)', - 'license' => '[![License](https://img.shields.io/github/license/%username%/%module%)](https://github.com/%username%/%module%/blob/master/LICENSE)' + 'license' => '[![License](https://img.shields.io/github/license/%username%/%module%)](https://github.com/%username%/%module%/blob/master/LICENSE)', ]; protected function init(): bool @@ -42,9 +61,13 @@ class ImproveActionGitshields extends ImproveAction 'description' => __('Add and maintain shields.io badges to the REDAME.md file'), 'priority' => 380, 'configurator' => true, - 'types' => ['plugin', 'theme'] + 'types' => ['plugin', 'theme'], ]); + $username = $this->getSetting('username'); + $this->username = is_string($username) ? $username : ''; + $this->dotaddict = (bool) $this->getSetting('dotaddict'); + return true; } @@ -58,19 +81,19 @@ class ImproveActionGitshields extends ImproveAction if (!empty($_POST['save']) && !empty($_POST['username'])) { $this->setSettings([ 'username' => (string) $_POST['username'], - 'dotaddict' => !empty($_POST['dotaddict']) + 'dotaddict' => !empty($_POST['dotaddict']), ]); $this->redirect($url); } return '' . - form::field('username', 60, 100, $this->getSetting('username')) . ' + form::field('username', 60, 100, $this->username) . '
' . __('Used in your Github URL: http://github.com/username/module_id.') . '
' .
__('If you have badges not created by this tool in the README.md file you should remove them manually.') . '
' . __('If your plugin or theme is on Dotaddict, you can add a badge to link to its details in Dotaddict.') . '
'; } @@ -99,7 +122,7 @@ class ImproveActionGitshields extends ImproveAction { $blocs = []; foreach ($this->bloc_content as $k => $v) { - if ($k == 'dotaddict' && empty($this->getSetting('dotaddict'))) { + if ($k == 'dotaddict' && !$this->dotaddict) { continue; } $blocs[$k] = trim(str_replace( @@ -108,14 +131,14 @@ class ImproveActionGitshields extends ImproveAction '%module%', '%dotclear%', '%type%', - "\r\n", "\n" + "\r\n", "\n", ], [ - $this->getSetting('username'), + $this->username, $this->module['id'], $dotclear = $this->getDotclearVersion(), $this->module['type'], - '', '' + '', '', ], $v )); diff --git a/inc/lib.improve.action.licensefile.php b/inc/module/licensefile.php similarity index 90% rename from inc/lib.improve.action.licensefile.php rename to inc/module/licensefile.php index bc6f180..3063ec3 100644 --- a/inc/lib.improve.action.licensefile.php +++ b/inc/module/licensefile.php @@ -10,13 +10,30 @@ * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ -class ImproveActionLicensefile extends ImproveAction +declare(strict_types=1); + +namespace plugins\improve\module; + +/* improve */ +use plugins\improve\action; + +/* clearbricks */ +use form; +use files; + +/* php */ +use Exception; + +/** + * Improve action module license file + */ +class licensefile extends action { /** @var array Possible license filenames */ protected static $license_filenames = [ 'license', 'license.md', - 'license.txt' + 'license.txt', ]; /** @var array Possible license names */ @@ -33,21 +50,21 @@ class ImproveActionLicensefile extends ImproveAction 'description' => __('Add or remove full license file to module root'), 'priority' => 330, 'configurator' => true, - 'types' => ['plugin', 'theme'] + 'types' => ['plugin', 'theme'], ]); $this->action_version = [ __('no version selected') => '', __('gpl2 - GNU General Public License v2') => 'gpl2', __('gpl3 - GNU General Public License v3') => 'gpl3', __('lgpl3 - GNU Lesser General Public License v3') => 'lgpl3', - __('Massachusetts Institute of Technolog mit') => 'mit' + __('Massachusetts Institute of Technolog mit') => 'mit', ]; $this->action_full = [ __('Do nothing') => 0, __('Add file if it does not exist') => 'create', __('Add file even if it exists') => 'overwrite', __('Add file and remove others') => 'full', - __('Remove license files') => 'remove' + __('Remove license files') => 'remove', ]; return true; @@ -63,7 +80,7 @@ class ImproveActionLicensefile extends ImproveAction if (!empty($_POST['save'])) { $this->setSettings([ 'action_version' => !empty($_POST['action_version']) ? $_POST['action_version'] : '', - 'action_full' => !empty($_POST['action_full']) ? $_POST['action_full'] : '' + 'action_full' => !empty($_POST['action_full']) ? $_POST['action_full'] : '', ]); $this->redirect($url); } @@ -97,7 +114,7 @@ class ImproveActionLicensefile extends ImproveAction private function writeFullLicense(): ?bool { try { - $full = file_get_contents(dirname(__FILE__) . '/license/' . $this->getSetting('action_version') . '.full.txt'); + $full = file_get_contents(dirname(__FILE__) . '/licensefile/' . $this->getSetting('action_version') . '.full.txt'); if (empty($full)) { $this->setError(__('Failed to load license content')); diff --git a/inc/license/gpl2.full.txt b/inc/module/licensefile/gpl2.full.txt similarity index 100% rename from inc/license/gpl2.full.txt rename to inc/module/licensefile/gpl2.full.txt diff --git a/inc/license/gpl3.full.txt b/inc/module/licensefile/gpl3.full.txt similarity index 100% rename from inc/license/gpl3.full.txt rename to inc/module/licensefile/gpl3.full.txt diff --git a/inc/license/lgpl3.full.txt b/inc/module/licensefile/lgpl3.full.txt similarity index 100% rename from inc/license/lgpl3.full.txt rename to inc/module/licensefile/lgpl3.full.txt diff --git a/inc/license/mit.full.txt b/inc/module/licensefile/mit.full.txt similarity index 100% rename from inc/license/mit.full.txt rename to inc/module/licensefile/mit.full.txt diff --git a/inc/module/newline.php b/inc/module/newline.php new file mode 100644 index 0000000..949633f --- /dev/null +++ b/inc/module/newline.php @@ -0,0 +1,104 @@ +setProperties([ + 'id' => 'newline', + 'name' => __('Newlines'), + 'description' => __('Replace bad and repetitive and empty newline by single newline in files'), + 'priority' => 840, + 'configurator' => true, + 'types' => ['plugin', 'theme'], + ]); + /* + $ext = @unserialize($this->core->blog->settings->improve->newline_extensions); + $ext = Improve::cleanExtensions($ext); + if (!empty($ext)) { + $this->extensions = $ext; + } + */ + return true; + } + + public function isConfigured(): bool + { + return !empty($this->getSetting('extensions')); + } + + public function configure($url): ?string + { + if (!empty($_POST['save']) && !empty($_POST['newline_extensions'])) { + $this->setSettings( + 'extensions', + improve::cleanExtensions($_POST['newline_extensions']) + ); + $this->redirect($url); + } + + $ext = $this->getSetting('extensions'); + if (!is_array($ext)) { + $ext = []; + } + + return + '' . + __('Use comma separated list of extensions without dot, recommand "php,js,xml,txt,md".') . + '
'; + } + + public function readFile(string &$content): ?bool + { + $ext = $this->getSetting('extensions'); + if (!is_array($ext) || !in_array($this->path_extension, $ext)) { + return null; + } + $clean = (string) preg_replace( + '/(\n\s+\n)/', + "\n\n", + (string) preg_replace( + '/(\n\n+)/', + "\n\n", + (string) str_replace( + ["\r\n", "\r"], + "\n", + $content + ) + ) + ); + if ($content != $clean) { + $this->setSuccess(__('Replace bad new lines')); + $content = $clean; + } + + return true; + } +} diff --git a/inc/lib.improve.action.phpcsfixer.php b/inc/module/phpcsfixer.php similarity index 85% rename from inc/lib.improve.action.phpcsfixer.php rename to inc/module/phpcsfixer.php index a88ef09..dfa6f4c 100644 --- a/inc/lib.improve.action.phpcsfixer.php +++ b/inc/module/phpcsfixer.php @@ -10,7 +10,28 @@ * @copyright Jean-Christian Denis * @copyright GPL-2.0 https://www.gnu.org/licenses/gpl-2.0.html */ -class ImproveActionPhpcsfixer extends ImproveAction +declare(strict_types=1); + +namespace plugins\improve\module; + +/* improve */ +use plugins\improve\action; + +/* dotclear */ +use dcPage; + +/* clearbricks */ +use html; +use form; +use path; + +/* php */ +use Exception; + +/** + * Improve action module PHP CS Fixer + */ +class phpcsfixer extends action { /** @var array