@sinemacula/coding-standards 1.19.0 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +9 -5
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -84,6 +84,11 @@ parameters:
84
84
  - tests
85
85
  ```
86
86
 
87
+ The base config enables PHPStan's checked-exception analysis: every exception a method can throw must appear in its
88
+ `@throws` tag, except the `LogicException` and `RuntimeException` families, which stay unchecked (they model programming
89
+ errors and runtime failures that propagate freely). Suppress a deliberate case with
90
+ `@phpstan-ignore missingType.checkedException`.
91
+
87
92
  #### Laravel projects
88
93
 
89
94
  For Laravel projects, also install
@@ -282,7 +287,6 @@ native directive - `// phpcs:ignore <code>` for a sniff, `@phpstan-ignore <ident
282
287
  |------------------------------------------------------------|-----------------------------------------------------------------------------|
283
288
  | `SineMacula.Attributes.DisallowToolingAttribute` | No IDE/tooling attributes (e.g. `JetBrains\PhpStorm`). |
284
289
  | `SineMacula.Classes.RequireFinalClass` | Concrete classes must be `final` or `abstract` (`@inheritable` opts out). |
285
- | `SineMacula.Classes.RequireReadonlyClass` | A class with only `readonly` properties (no statics) must be `readonly`. |
286
290
  | `SineMacula.Classes.RequireReadonlyPublicProperty` | Public properties (declared or promoted) must be `readonly`. |
287
291
  | `SineMacula.Commenting.CommentLineLength` | Standalone comment prose wrapped to 80 chars; premature wraps also fixed. |
288
292
  | `SineMacula.Commenting.ConsistentEnumCaseComments` | Enum case docs are all-or-nothing within an enum. |
@@ -304,15 +308,15 @@ native directive - `// phpcs:ignore <code>` for a sniff, `@phpstan-ignore <ident
304
308
  | `SineMacula.NamingConventions.DisallowInterfacePrefix` | Interface names must not use the Hungarian `I` prefix. |
305
309
  | `SineMacula.NamingConventions.ValidEnumCaseName` | Enum cases must be `SCREAMING_SNAKE_CASE`. |
306
310
  | `SineMacula.NamingConventions.ValidGlobalFunctionName` | Global functions must be declared in `snake_case`. |
307
- | `SineMacula.TypeHints.DisallowFullyQualifiedConstantType` | Constant types must be imported, not inline fully-qualified names. |
308
311
  | `SineMacula.TypeHints.RequireConstantType` | Class/interface/enum/trait constants must declare a native type. |
309
312
  | `SineMacula.WhiteSpace.PromotedConstructorSpacing` | Blank line above each promoted-constructor parameter. |
310
313
 
311
314
  ### PHPStan rules
312
315
 
313
- | Identifier | Enforces |
314
- |------------------------------------|-------------------------------------------------------------------|
315
- | `sineMacula.mutableStaticProperty` | Static properties written at runtime; `@managed-static` opts out. |
316
+ | Identifier | Enforces |
317
+ |------------------------------------|----------------------------------------------------------------------|
318
+ | `sineMacula.mutableStaticProperty` | Static properties written at runtime; `@managed-static` opts out. |
319
+ | `sineMacula.readonlyClass` | A final class with only readonly properties must be `readonly`. |
316
320
 
317
321
  ### ESLint rules
318
322
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sinemacula/coding-standards",
3
- "version": "1.19.0",
3
+ "version": "1.20.0",
4
4
  "description": "Centralized coding standards, static analysis configurations, and code quality tooling for all Sine Macula repositories.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Ben Carey <bdmc@sinemacula.co.uk>",