├── .gitignore ├── .github └── FUNDING.yml ├── .editorconfig ├── composer.json ├── ruleset-nette.xml ├── contributte.xml ├── LICENSE ├── README.md ├── phpstorm └── contributte.xml ├── ruleset-gamee.xml └── ruleset.xml /.gitignore: -------------------------------------------------------------------------------- 1 | # IDE 2 | /.idea 3 | 4 | # Composer 5 | /vendor 6 | /composer.lock 7 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [f3l1x] 2 | custom: ["https://contributte.org/partners.html"] 3 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # Top-most EditorConfig file 4 | root = true 5 | 6 | # Unix-style newlines with a newline ending every file 7 | [*] 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | # JS / PHP 12 | [*.{js,php}] 13 | charset = utf-8 14 | indent_style = tab 15 | indent_size = 4 16 | 17 | # NEON 18 | [*.neon] 19 | charset = utf-8 20 | indent_style = tab 21 | indent_size = 4 22 | 23 | # Composer, NPM, Travis, BitbucketPipelines 24 | [{composer.json,package.json,.travis.yml,bitbucket-pipelines.yml}] 25 | indent_style = space 26 | indent_size = 2 27 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ninjify/coding-standard", 3 | "description": "Tuned & very strict coding standards for PHP projects. Trusted by Contributte, Apitte, Nettrine and many others.", 4 | "keywords": ["codesniffer", "codestyle", "ninjify", "php"], 5 | "type": "library", 6 | "license": ["MIT"], 7 | "homepage": "https://github.com/ninjify/coding-standard", 8 | "authors": [ 9 | { 10 | "name": "Milan Felix Šulc", 11 | "homepage": "https://f3l1x.io" 12 | } 13 | ], 14 | "require": { 15 | "php": ">=7.2", 16 | "slevomat/coding-standard": "^7.0.18", 17 | "squizlabs/php_codesniffer": "^3.5.8" 18 | }, 19 | "extra": { 20 | "branch-alias": { 21 | "dev-master": "0.13.x-dev" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /ruleset-nette.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | */tests/* 13 | 14 | 15 | */tests/* 16 | 17 | 18 | -------------------------------------------------------------------------------- /contributte.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Ninjify 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![](https://heatbadger.now.sh/github/readme/ninjify/coding-standard/) 2 | 3 |

4 | 5 | 6 |

7 |

8 | 9 | 10 | 11 | 12 | 13 |

14 | 15 |

16 | Website 🚀 contributte.org | Contact 👨🏻‍💻 f3l1x.io | Twitter 🐦 @contributte 17 |

18 | 19 | ## Usage 20 | 21 | To install latest version of `ninjify/coding-standard` use [Composer](https://getcomposer.com). 22 | 23 | ``` 24 | composer require --dev ninjify/coding-standard 25 | ``` 26 | 27 | ## Versions 28 | 29 | | State | Version | Branch | PHP | 30 | |-------------|--------------|----------|---------| 31 | | dev | `^0.13` | `master` | `>=7.2` | 32 | | stable | `^0.12` | `master` | `>=7.2` | 33 | 34 | ## Documentation 35 | 36 | ### Usage 37 | 38 | | File | Usage | 39 | |---------------|--------| 40 | | ruleset | global | 41 | | contributte | Contributte, Apitte, Nettrine | 42 | 43 | Create `ruleset.xml` in root of your project. 44 | 45 | ``` 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | /tests/tmp 58 | 59 | ``` 60 | 61 | ### Integration 62 | 63 | Take a look at `phpstorm` folder, there should be prepared codestyle. 64 | 65 | 66 | ## Development 67 | 68 | See [how to contribute](https://contributte.org) to this package. This package is currently maintained by these authors. 69 | 70 | 71 | 72 | 73 | 74 | ----- 75 | 76 | Consider to [support](https://contributte.org/partners.html) **contributte** development team. 77 | Also thank you for using this package. 78 | -------------------------------------------------------------------------------- /phpstorm/contributte.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ruleset-gamee.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Gamee coding standard. 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | -------------------------------------------------------------------------------- /ruleset.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | Ninjify/CodingStandard - Tuned and very strict coding standards for PHP projects 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | error 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | Only 1 @return annotation is allowed in a function comment 153 | 154 | 155 | Extra @param annotation 156 | 157 | 158 | Function has no return statement, but annotation @return is present 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | Variable "%s" not allowed in double quoted string; use sprintf() instead 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 5 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 256 | 257 | 258 | 259 | 260 | 261 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | --------------------------------------------------------------------------------