Skip to content

Commit 6a4a076

Browse files
committed
Refactor code style and improve documentation consistency across multiple files
1 parent f49f896 commit 6a4a076

File tree

14 files changed

+26
-111
lines changed

14 files changed

+26
-111
lines changed

.php-cs-fixer.dist.php

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -15,90 +15,7 @@
1515
return (new PhpCsFixer\Config())
1616
->setRules([
1717
'@PSR12' => true,
18-
'array_syntax' => ['syntax' => 'short'],
19-
'binary_operator_spaces' => [
20-
'default' => 'single_space',
21-
],
22-
'blank_line_after_namespace' => true,
23-
'blank_line_after_opening_tag' => true,
24-
'blank_line_before_statement' => [
25-
'statements' => ['return'],
26-
],
27-
'cast_spaces' => true,
28-
'class_attributes_separation' => [
29-
'elements' => [
30-
'method' => 'one',
31-
],
32-
],
33-
'concat_space' => [
34-
'spacing' => 'one',
35-
],
3618
'declare_strict_types' => true,
37-
'function_typehint_space' => true,
38-
'lowercase_cast' => true,
39-
'lowercase_static_reference' => true,
40-
'magic_constant_casing' => true,
41-
'magic_method_casing' => true,
42-
'method_argument_space' => [
43-
'on_multiline' => 'ensure_fully_multiline',
44-
],
45-
'native_function_casing' => true,
46-
'native_function_type_declaration_casing' => true,
47-
'no_blank_lines_after_class_opening' => true,
48-
'no_blank_lines_after_phpdoc' => true,
49-
'no_empty_comment' => true,
50-
'no_empty_phpdoc' => true,
51-
'no_empty_statement' => true,
52-
'no_extra_blank_lines' => [
53-
'tokens' => [
54-
'extra',
55-
'throw',
56-
'use',
57-
],
58-
],
59-
'no_leading_import_slash' => true,
60-
'no_leading_namespace_whitespace' => true,
61-
'no_mixed_echo_print' => [
62-
'use' => 'echo',
63-
],
64-
'no_multiline_whitespace_around_double_arrow' => true,
65-
'no_short_bool_cast' => true,
66-
'no_singleline_whitespace_before_semicolons' => true,
67-
'no_spaces_around_offset' => true,
68-
'no_trailing_comma_in_singleline' => true,
69-
'no_unneeded_control_parentheses' => true,
70-
'no_unused_imports' => true,
71-
'no_whitespace_before_comma_in_array' => true,
72-
'no_whitespace_in_blank_line' => true,
73-
'normalize_index_brace' => true,
74-
'object_operator_without_whitespace' => true,
75-
'ordered_imports' => ['sort_algorithm' => 'alpha'],
76-
'phpdoc_indent' => true,
77-
'phpdoc_inline_tag_normalizer' => true,
78-
'phpdoc_no_access' => true,
79-
'phpdoc_no_package' => true,
80-
'phpdoc_no_useless_inheritdoc' => true,
81-
'phpdoc_scalar' => true,
82-
'phpdoc_single_line_var_spacing' => true,
83-
'phpdoc_summary' => true,
84-
'phpdoc_trim' => true,
85-
'phpdoc_types' => true,
86-
'phpdoc_var_without_name' => true,
87-
'return_type_declaration' => true,
88-
'short_scalar_cast' => true,
89-
'single_class_element_per_statement' => true,
90-
'single_line_comment_style' => [
91-
'comment_types' => ['hash'],
92-
],
93-
'single_quote' => true,
94-
'space_after_semicolon' => [
95-
'remove_in_empty_for_expressions' => true,
96-
],
97-
'standardize_not_equals' => true,
98-
'ternary_operator_spaces' => true,
99-
'trim_array_spaces' => true,
100-
'unary_operator_spaces' => true,
101-
'whitespace_after_comma_in_array' => true,
10219
])
10320
->setFinder($finder)
10421
->setRiskyAllowed(true)

config/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* WebCodeFTP Configuration File
6+
* WebCodeFTP Configuration File.
77
*
88
* All application configuration must be defined here.
99
* PHP 8.0+ required.

public/index.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* WebCodeFTP - Web-Based FTP Client with Integrated Code Editor
6+
* WebCodeFTP - Web-Based FTP Client with Integrated Code Editor.
77
*
88
* Modern, secure, fast FTP client with CodeMirror editor built with PHP 8.0+
99
* Follows MVC pattern with enterprise-grade security.
@@ -41,23 +41,23 @@
4141
// Enable compression if configured
4242
if ($config['performance']['enable_compression'] && extension_loaded('zlib')) {
4343
ini_set('zlib.output_compression', '1');
44-
ini_set('zlib.output_compression_level', (string)$config['performance']['compression_level']);
44+
ini_set('zlib.output_compression_level', (string) $config['performance']['compression_level']);
4545
}
4646

4747
// Load Composer autoloader
4848
require __DIR__ . '/../vendor/autoload.php';
4949

5050
// Import required classes
51-
use WebCodeFTP\Core\Router;
51+
use WebCodeFTP\Controllers\AuthController;
52+
use WebCodeFTP\Controllers\FileManagerController;
53+
use WebCodeFTP\Core\ConfigValidator;
54+
use WebCodeFTP\Core\CsrfToken;
55+
use WebCodeFTP\Core\Logger;
5256
use WebCodeFTP\Core\Request;
5357
use WebCodeFTP\Core\Response;
58+
use WebCodeFTP\Core\Router;
5459
use WebCodeFTP\Core\SecurityManager;
55-
use WebCodeFTP\Core\CsrfToken;
56-
use WebCodeFTP\Core\ConfigValidator;
57-
use WebCodeFTP\Core\Logger;
5860
use WebCodeFTP\Models\Session;
59-
use WebCodeFTP\Controllers\AuthController;
60-
use WebCodeFTP\Controllers\FileManagerController;
6161

6262
// Initialize Logger
6363
Logger::init($config);

src/Controllers/AuthController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
namespace WebCodeFTP\Controllers;
66

7-
use WebCodeFTP\Core\Request;
8-
use WebCodeFTP\Core\Response;
9-
use WebCodeFTP\Core\SecurityManager;
107
use WebCodeFTP\Core\CsrfToken;
118
use WebCodeFTP\Core\Language;
129
use WebCodeFTP\Core\Logger;
10+
use WebCodeFTP\Core\Request;
11+
use WebCodeFTP\Core\Response;
12+
use WebCodeFTP\Core\SecurityManager;
1313
use WebCodeFTP\Models\Session;
1414
use WebCodeFTP\Services\FtpConnectionService;
1515

1616
/**
17-
* Authentication Controller
17+
* Authentication Controller.
1818
*
1919
* Handles user authentication via FTP credentials.
2020
*/

src/Controllers/FileManagerController.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
namespace WebCodeFTP\Controllers;
66

7+
use WebCodeFTP\Core\Logger;
78
use WebCodeFTP\Core\Request;
89
use WebCodeFTP\Core\Response;
9-
use WebCodeFTP\Core\Logger;
1010
use WebCodeFTP\Models\Session;
1111
use WebCodeFTP\Services\FtpConnectionService;
1212
use WebCodeFTP\Services\FtpOperationsService;
1313

1414
/**
15-
* File Manager Controller
15+
* File Manager Controller.
1616
*
1717
* Handles the main FTP file manager interface for authenticated users.
1818
* Uses FtpConnectionService and FtpOperationsService for all FTP operations.
@@ -24,8 +24,7 @@ public function __construct(
2424
private Request $request,
2525
private Response $response,
2626
private Session $session
27-
) {
28-
}
27+
) {}
2928

3029
/**
3130
* Show file manager

src/Languages/ar.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* Arabic translations
6+
* Arabic translations.
77
*/
88

99
return [

src/Languages/de.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* German translations
6+
* German translations.
77
*/
88

99
return [

src/Languages/en.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* English translations
6+
* English translations.
77
*/
88

99
return [

src/Languages/es.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* Spanish translations
6+
* Spanish translations.
77
*/
88

99
return [

src/Languages/fr.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
declare(strict_types=1);
44

55
/**
6-
* French translations
6+
* French translations.
77
*/
88

99
return [

0 commit comments

Comments
 (0)