Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 5, 2022. It is now read-only.

Commit 051da55

Browse files
authored
Merge pull request #39 from codeigniter4/develop
Merging recent changes
2 parents b7c6fe4 + cd36503 commit 051da55

File tree

6 files changed

+25
-79
lines changed

6 files changed

+25
-79
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
composer.phar
2+
composer.lock
23
/vendor/
34
/build
45
phpunit.xml

‎CodeIgniter4/Sniffs/Commenting/ClassCommentSniff.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class ClassCommentSniff extends FileCommentSniff
3232
*/
3333
protected $tags = [
3434
'@package' => [
35-
'required' => true,
35+
'required' => false,
3636
'allow_multiple' => false,
3737
],
3838
'@subpackage' => [

‎CodeIgniter4/Sniffs/Commenting/FileCommentSniff.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class FileCommentSniff implements Sniff
3333
*/
3434
protected $tags = [
3535
'@package' => [
36-
'required' => true,
36+
'required' => false,
3737
'allow_multiple' => false,
3838
],
3939
'@subpackage' => [
@@ -45,15 +45,15 @@ class FileCommentSniff implements Sniff
4545
'allow_multiple' => false,
4646
],
4747
'@author' => [
48-
'required' => true,
48+
'required' => false,
4949
'allow_multiple' => true,
5050
],
5151
'@copyright' => [
5252
'required' => false,
5353
'allow_multiple' => true,
5454
],
5555
'@license' => [
56-
'required' => true,
56+
'required' => false,
5757
'allow_multiple' => false,
5858
],
5959
'@link' => [

‎CodeIgniter4/ruleset.xml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<ruleset name="CodeIgniter4">
33
<description>CodeIgniter 4 coding standard for PHP_CodeSniffer</description>
4-
<!--
4+
<!--
55
* CodeIgniter 4 coding standard for PHP_CodeSniffer
66
*
77
* @author Louis Linehan <louis.linehan@gmail.com>
@@ -39,9 +39,21 @@
3939
Methods and functions MUST have a doc block comment.
4040
-->
4141
<rule ref="Squiz.Commenting.FunctionComment"/>
42+
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentNotCapital">
43+
<severity>0</severity>
44+
</rule>
4245
<rule ref="Squiz.Commenting.FunctionComment.ParamCommentFullStop">
4346
<severity>0</severity>
4447
</rule>
48+
<rule ref="Squiz.Commenting.FunctionComment.EmptyThrows">
49+
<severity>0</severity>
50+
</rule>
51+
<rule ref="Squiz.Commenting.FunctionComment.ThrowsNotCapital">
52+
<severity>0</severity>
53+
</rule>
54+
<rule ref="Squiz.Commenting.FunctionComment.ThrowsNoFullStop">
55+
<severity>0</severity>
56+
</rule>
4557
<!--
4658
Doc block comment alignment.
4759
-->
@@ -68,10 +80,10 @@
6880
-->
6981
<arg name="tab-width" value="4"/>
7082
<!--
71-
Ignore application/Views/ directory.
83+
Ignore application/Views/ directory.
7284
Ignore application/ThirdParty/ directory.
7385
Ignore system/ThirdParty/ directory.
74-
There could be a mix of styles in ThirdParty and View files
86+
There could be a mix of styles in ThirdParty and View files
7587
could contain all sorts of indentation, alignments and scopes.
7688
@todo subject to change.
7789
-->
@@ -213,7 +225,7 @@
213225
-->
214226
<rule ref="Generic.Files.LineLength">
215227
<properties>
216-
<property name="lineLimit" value="120"/>
228+
<property name="lineLimit" value="250"/>
217229
<property name="absoluteLineLimit" value="0"/>
218230
</properties>
219231
</rule>
@@ -242,7 +254,7 @@
242254
Checks there are no blank lines before a function closing brace.
243255
-->
244256
<rule ref="CodeIgniter4.WhiteSpace.FunctionClosingBraceSpace"/>
245-
<!--
257+
<!--
246258
The keyword elseif SHOULD be used instead of else if so that all control
247259
keywords look like single words.
248260
-->

‎README.md

Lines changed: 3 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[CodeIgniter](https://codeigniter.com) 4 coding standard for use with [PHP_CodeSniffer 3](https://github.com/squizlabs/PHP_CodeSniffer).
44

5-
Version 1.0.1
5+
Version 1
66

77
| Master | Develop |
88
| :---: | :---: |
@@ -23,8 +23,8 @@ PHP (7.1 or greater) with mbstring extension.
2323

2424
### Composer install
2525

26-
`cd /Path/To/MyProject`
27-
`composer require codeigniter4/codeigniter4-standard --dev`
26+
`cd /Path/To/MyProject`
27+
`composer require codeigniter4/codeigniter4-standard --dev`
2828

2929
Set the `phpcs standard path` and `phpcbf standard path` in your editor/plugin config to:
3030

@@ -110,72 +110,6 @@ or if globally installed.
110110

111111
`phpcbf /Path/To/MyProject --standard=CodeIgniter4`
112112

113-
## Example editor configs
114-
115-
### SublimeText project config
116-
117-
Project > Edit Project
118-
119-
Set it to your preference.
120-
121-
```
122-
{
123-
"SublimeLinter":
124-
{
125-
"linters":
126-
{
127-
"phpcs":
128-
{
129-
"@disable": false,
130-
"cmd": "/Path/To/php_codesniffer/bin/phpcs",
131-
// Or if installed globally. "cmd": "phpcs",
132-
"standard": "/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml"
133-
}
134-
}
135-
},
136-
"folders":
137-
[
138-
{
139-
"path": "/Path/To/MyProject"
140-
}
141-
],
142-
"settings":
143-
{
144-
"phpcs":
145-
{
146-
"extensions_to_execute":
147-
[
148-
"php"
149-
],
150-
"phpcs_executable_path": "/Path/To/php_codesniffer/bin/phpcs",
151-
// Or if installed globally. "phpcbf_executable_path": "phpcs",
152-
"phpcs_additional_args":
153-
{
154-
"--standard": "/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml",
155-
// Optional don't show warnings
156-
// "-n": ""
157-
},
158-
"phpcbf_executable_path": "/Path/To/php_codesniffer/bin/phpcbf",
159-
// Or if installed globally. "phpcbf_executable_path": "phpcbf",
160-
"phpcbf_additional_args":
161-
{
162-
"--standard": "/Path/To/CodeIgniter4-Standard/CodeIgniter4/ruleset.xml",
163-
// Optional don't fix warnings (if they're fixable)
164-
// "-n": ""
165-
},
166-
// Execute the sniffer on file save. (Using contextual menu instead)
167-
"phpcs_execute_on_save": false,
168-
// Show the error list after save. (Using sublime linter instead)
169-
"phpcs_show_errors_on_save": false,
170-
// Show the errors in the quick panel so you can then goto line. (Gets annoying)
171-
"phpcs_show_quick_panel": false,
172-
// Turn the debug output on/off.
173-
"show_debug": false
174-
}
175-
}
176-
}
177-
```
178-
179113
## Credits
180114

181115
Thanks to Greg Sherwood, Marc McIntyre, Andy Grunwald, Thomas Ernest and Erik Torsner, for providing open source code which helped me build this standard and a big thanks to [Squiz Labs](http://www.squizlabs.com) for creating [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer).

‎composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "codeigniter4/codeigniter4-standard",
33
"type": "phpcodesniffer-standard",
44
"description": "CodeIgniter 4 Standard for PHP_CodeSniffer 3.",
5-
"version":"1.0.1",
65
"license":"MIT",
76
"authors": [
87
{

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /