@dedesfr/prompter 0.8.23 → 1.0.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 (247) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/README.md +105 -77
  3. package/dist/cli/index.js +25 -1
  4. package/dist/cli/index.js.map +1 -1
  5. package/dist/commands/init.d.ts +1 -7
  6. package/dist/commands/init.d.ts.map +1 -1
  7. package/dist/commands/init.js +60 -299
  8. package/dist/commands/init.js.map +1 -1
  9. package/dist/commands/login.d.ts +4 -0
  10. package/dist/commands/login.d.ts.map +1 -0
  11. package/dist/commands/login.js +56 -0
  12. package/dist/commands/login.js.map +1 -0
  13. package/dist/commands/logout.d.ts +4 -0
  14. package/dist/commands/logout.d.ts.map +1 -0
  15. package/dist/commands/logout.js +14 -0
  16. package/dist/commands/logout.js.map +1 -0
  17. package/dist/commands/update.d.ts.map +1 -1
  18. package/dist/commands/update.js +31 -41
  19. package/dist/commands/update.js.map +1 -1
  20. package/dist/commands/whoami.d.ts +4 -0
  21. package/dist/commands/whoami.d.ts.map +1 -0
  22. package/dist/commands/whoami.js +42 -0
  23. package/dist/commands/whoami.js.map +1 -0
  24. package/dist/core/auth-store.d.ts +10 -0
  25. package/dist/core/auth-store.d.ts.map +1 -0
  26. package/dist/core/auth-store.js +39 -0
  27. package/dist/core/auth-store.js.map +1 -0
  28. package/dist/core/configurators/slash/antigravity.d.ts +2 -5
  29. package/dist/core/configurators/slash/antigravity.d.ts.map +1 -1
  30. package/dist/core/configurators/slash/antigravity.js +2 -57
  31. package/dist/core/configurators/slash/antigravity.js.map +1 -1
  32. package/dist/core/configurators/slash/base.d.ts +6 -18
  33. package/dist/core/configurators/slash/base.d.ts.map +1 -1
  34. package/dist/core/configurators/slash/base.js +8 -77
  35. package/dist/core/configurators/slash/base.js.map +1 -1
  36. package/dist/core/configurators/slash/claude.d.ts +2 -5
  37. package/dist/core/configurators/slash/claude.d.ts.map +1 -1
  38. package/dist/core/configurators/slash/claude.js +2 -57
  39. package/dist/core/configurators/slash/claude.js.map +1 -1
  40. package/dist/core/configurators/slash/codex.d.ts +2 -5
  41. package/dist/core/configurators/slash/codex.d.ts.map +1 -1
  42. package/dist/core/configurators/slash/codex.js +2 -57
  43. package/dist/core/configurators/slash/codex.js.map +1 -1
  44. package/dist/core/configurators/slash/droid.d.ts +2 -5
  45. package/dist/core/configurators/slash/droid.d.ts.map +1 -1
  46. package/dist/core/configurators/slash/droid.js +2 -32
  47. package/dist/core/configurators/slash/droid.js.map +1 -1
  48. package/dist/core/configurators/slash/forge.d.ts +2 -5
  49. package/dist/core/configurators/slash/forge.d.ts.map +1 -1
  50. package/dist/core/configurators/slash/forge.js +2 -32
  51. package/dist/core/configurators/slash/forge.js.map +1 -1
  52. package/dist/core/configurators/slash/github-copilot.d.ts +2 -7
  53. package/dist/core/configurators/slash/github-copilot.d.ts.map +1 -1
  54. package/dist/core/configurators/slash/github-copilot.js +2 -96
  55. package/dist/core/configurators/slash/github-copilot.js.map +1 -1
  56. package/dist/core/configurators/slash/index.d.ts +1 -1
  57. package/dist/core/configurators/slash/index.d.ts.map +1 -1
  58. package/dist/core/configurators/slash/index.js +1 -1
  59. package/dist/core/configurators/slash/index.js.map +1 -1
  60. package/dist/core/configurators/slash/kilocode.d.ts +2 -5
  61. package/dist/core/configurators/slash/kilocode.d.ts.map +1 -1
  62. package/dist/core/configurators/slash/kilocode.js +2 -57
  63. package/dist/core/configurators/slash/kilocode.js.map +1 -1
  64. package/dist/core/configurators/slash/opencode.d.ts +2 -5
  65. package/dist/core/configurators/slash/opencode.d.ts.map +1 -1
  66. package/dist/core/configurators/slash/opencode.js +2 -57
  67. package/dist/core/configurators/slash/opencode.js.map +1 -1
  68. package/dist/core/configurators/slash/registry.d.ts +4 -4
  69. package/dist/core/configurators/slash/registry.d.ts.map +1 -1
  70. package/dist/core/configurators/slash/registry.js.map +1 -1
  71. package/dist/core/registry.d.ts +18 -0
  72. package/dist/core/registry.d.ts.map +1 -0
  73. package/dist/core/registry.js +94 -0
  74. package/dist/core/registry.js.map +1 -0
  75. package/dist/core/templates/index.d.ts +0 -1
  76. package/dist/core/templates/index.d.ts.map +1 -1
  77. package/dist/core/templates/index.js +0 -1
  78. package/dist/core/templates/index.js.map +1 -1
  79. package/package.json +7 -1
  80. package/AGENTS.md +0 -123
  81. package/CLAUDE.md +0 -17
  82. package/build.js +0 -20
  83. package/convex-setup.md +0 -403
  84. package/dist/core/templates/slash-command-templates.d.ts +0 -7
  85. package/dist/core/templates/slash-command-templates.d.ts.map +0 -1
  86. package/dist/core/templates/slash-command-templates.js +0 -1041
  87. package/dist/core/templates/slash-command-templates.js.map +0 -1
  88. package/prompt/ai-humanizer.md +0 -45
  89. package/prompt/api-contract-generator.md +0 -234
  90. package/prompt/apply.md +0 -17
  91. package/prompt/archive.md +0 -21
  92. package/prompt/design-system.md +0 -210
  93. package/prompt/document-explainer.md +0 -149
  94. package/prompt/epic-generator.md +0 -198
  95. package/prompt/epic-single.md +0 -47
  96. package/prompt/erd-generator.md +0 -130
  97. package/prompt/fsd-generator.md +0 -157
  98. package/prompt/prd-agent-generator.md +0 -147
  99. package/prompt/prd-generator.md +0 -195
  100. package/prompt/product-brief.md +0 -289
  101. package/prompt/proposal.md +0 -22
  102. package/prompt/qa-test-scenario.md +0 -133
  103. package/prompt/skill-creator.md +0 -350
  104. package/prompt/story-generator.md +0 -278
  105. package/prompt/story-single.md +0 -70
  106. package/prompt/tdd-generator.md +0 -294
  107. package/prompt/tdd-lite-generator.md +0 -224
  108. package/prompt/wireframe-generator.md +0 -219
  109. package/skills/ai-context-generator/SKILL.md +0 -54
  110. package/skills/ai-context-generator/references/AGENTS.template.md +0 -83
  111. package/skills/ai-context-generator/references/CLAUDE.template.md +0 -39
  112. package/skills/ai-context-generator/references/behavioral-guidelines.md +0 -71
  113. package/skills/ai-context-generator/references/discovery-checklist.md +0 -40
  114. package/skills/ai-context-generator/references/examples/AGENTS.good.md +0 -103
  115. package/skills/ai-context-generator/references/extraction-checklist.md +0 -23
  116. package/skills/ai-context-generator/references/overlays/laravel.md +0 -44
  117. package/skills/cerebro/SKILL.md +0 -187
  118. package/skills/cerebro/references/agents.md +0 -213
  119. package/skills/code-review/SKILL.md +0 -373
  120. package/skills/code-review/assets/report-template-agent.md +0 -212
  121. package/skills/code-review/assets/report-template-compact.md +0 -81
  122. package/skills/code-review/assets/report-template-full.md +0 -264
  123. package/skills/code-review/assets/report-template-human.md +0 -168
  124. package/skills/code-review/references/universal-patterns.md +0 -495
  125. package/skills/design-md/README.md +0 -34
  126. package/skills/design-md/SKILL.md +0 -172
  127. package/skills/design-md/examples/DESIGN.md +0 -154
  128. package/skills/design-system-generator/SKILL.md +0 -324
  129. package/skills/design-system-generator/assets/design-system-template.md +0 -348
  130. package/skills/design-system-generator/references/extraction-patterns.md +0 -321
  131. package/skills/doc-builder/SKILL.md +0 -115
  132. package/skills/doc-builder/references/ui-patterns.md +0 -394
  133. package/skills/document-translator/SKILL.md +0 -58
  134. package/skills/enhance-prompt/README.md +0 -34
  135. package/skills/enhance-prompt/SKILL.md +0 -204
  136. package/skills/enhance-prompt/references/KEYWORDS.md +0 -114
  137. package/skills/feature-planner/SKILL.md +0 -305
  138. package/skills/feature-planner/assets/implementation-plan-template.md +0 -85
  139. package/skills/frontend-design/LICENSE.txt +0 -177
  140. package/skills/frontend-design/SKILL.md +0 -42
  141. package/skills/gamma-builder/SKILL.md +0 -134
  142. package/skills/laravel-code-review/SKILL.md +0 -383
  143. package/skills/laravel-code-review/assets/report-template-agent.md +0 -195
  144. package/skills/laravel-code-review/assets/report-template-compact.md +0 -79
  145. package/skills/laravel-code-review/assets/report-template-full.md +0 -253
  146. package/skills/laravel-code-review/assets/report-template-human.md +0 -159
  147. package/skills/laravel-code-review/references/laravel-patterns.md +0 -571
  148. package/skills/laravel-code-review/references/php84-features.md +0 -442
  149. package/skills/mcp-builder/LICENSE.txt +0 -202
  150. package/skills/mcp-builder/SKILL.md +0 -236
  151. package/skills/mcp-builder/reference/evaluation.md +0 -602
  152. package/skills/mcp-builder/reference/mcp_best_practices.md +0 -249
  153. package/skills/mcp-builder/reference/node_mcp_server.md +0 -970
  154. package/skills/mcp-builder/reference/python_mcp_server.md +0 -719
  155. package/skills/mcp-builder/scripts/connections.py +0 -151
  156. package/skills/mcp-builder/scripts/evaluation.py +0 -373
  157. package/skills/mcp-builder/scripts/example_evaluation.xml +0 -22
  158. package/skills/mcp-builder/scripts/requirements.txt +0 -2
  159. package/skills/meeting-notes/SKILL.md +0 -159
  160. package/skills/meeting-notes/evals/evals.json +0 -23
  161. package/skills/project-orchestrator/SKILL.md +0 -487
  162. package/skills/project-orchestrator/assets/caddy-vps-setup.md +0 -180
  163. package/skills/project-orchestrator/assets/plan-summary-template.md +0 -159
  164. package/skills/prompter-specs/SKILL.md +0 -115
  165. package/skills/prompter-workflow/SKILL.md +0 -166
  166. package/skills/prompter-workflow/evals/evals.json +0 -89
  167. package/skills/sph-generator/SKILL.md +0 -488
  168. package/skills/ui-ux-pro/SKILL.md +0 -199
  169. package/skills/ui-ux-pro/assets/design-spec-template.md +0 -173
  170. package/skills/ui-ux-pro/references/component-patterns.md +0 -255
  171. package/skills/ui-ux-pro/references/design-principles.md +0 -167
  172. package/src/cli/index.ts +0 -223
  173. package/src/commands/archive.ts +0 -302
  174. package/src/commands/change.ts +0 -292
  175. package/src/commands/config.ts +0 -233
  176. package/src/commands/guide.ts +0 -50
  177. package/src/commands/init.ts +0 -899
  178. package/src/commands/list.ts +0 -194
  179. package/src/commands/show.ts +0 -138
  180. package/src/commands/spec.ts +0 -251
  181. package/src/commands/update.ts +0 -156
  182. package/src/commands/upgrade.ts +0 -30
  183. package/src/commands/validate.ts +0 -326
  184. package/src/core/artifact-graph/graph.ts +0 -167
  185. package/src/core/artifact-graph/index.ts +0 -44
  186. package/src/core/artifact-graph/instruction-loader.ts +0 -302
  187. package/src/core/artifact-graph/resolver.ts +0 -226
  188. package/src/core/artifact-graph/schema.ts +0 -124
  189. package/src/core/artifact-graph/state.ts +0 -64
  190. package/src/core/artifact-graph/types.ts +0 -65
  191. package/src/core/completions/command-registry.ts +0 -382
  192. package/src/core/completions/completion-provider.ts +0 -128
  193. package/src/core/completions/generators/bash-generator.ts +0 -191
  194. package/src/core/completions/generators/fish-generator.ts +0 -188
  195. package/src/core/completions/generators/powershell-generator.ts +0 -223
  196. package/src/core/completions/generators/zsh-generator.ts +0 -281
  197. package/src/core/completions/templates/bash-templates.ts +0 -24
  198. package/src/core/completions/templates/fish-templates.ts +0 -40
  199. package/src/core/completions/templates/powershell-templates.ts +0 -25
  200. package/src/core/completions/templates/zsh-templates.ts +0 -36
  201. package/src/core/completions/types.ts +0 -90
  202. package/src/core/config-schema.ts +0 -230
  203. package/src/core/config.ts +0 -181
  204. package/src/core/configurators/slash/antigravity.ts +0 -70
  205. package/src/core/configurators/slash/base.ts +0 -203
  206. package/src/core/configurators/slash/claude.ts +0 -70
  207. package/src/core/configurators/slash/codex.ts +0 -70
  208. package/src/core/configurators/slash/droid.ts +0 -44
  209. package/src/core/configurators/slash/forge.ts +0 -44
  210. package/src/core/configurators/slash/github-copilot.ts +0 -114
  211. package/src/core/configurators/slash/index.ts +0 -10
  212. package/src/core/configurators/slash/kilocode.ts +0 -70
  213. package/src/core/configurators/slash/opencode.ts +0 -70
  214. package/src/core/configurators/slash/registry.ts +0 -51
  215. package/src/core/converters/json-converter.ts +0 -62
  216. package/src/core/global-config.ts +0 -136
  217. package/src/core/parsers/change-parser.ts +0 -234
  218. package/src/core/parsers/markdown-parser.ts +0 -237
  219. package/src/core/parsers/requirement-blocks.ts +0 -234
  220. package/src/core/prompt-templates.ts +0 -3504
  221. package/src/core/schemas/base.schema.ts +0 -20
  222. package/src/core/schemas/change.schema.ts +0 -42
  223. package/src/core/schemas/index.ts +0 -20
  224. package/src/core/schemas/spec.schema.ts +0 -17
  225. package/src/core/skill-discovery.ts +0 -68
  226. package/src/core/specs-apply.ts +0 -483
  227. package/src/core/styles/palette.ts +0 -8
  228. package/src/core/templates/agents-template.ts +0 -459
  229. package/src/core/templates/claude-template.ts +0 -2
  230. package/src/core/templates/index.ts +0 -4
  231. package/src/core/templates/project-template.ts +0 -32
  232. package/src/core/templates/slash-command-templates.ts +0 -1068
  233. package/src/core/validation/constants.ts +0 -48
  234. package/src/core/validation/types.ts +0 -19
  235. package/src/core/validation/validator.ts +0 -449
  236. package/src/core/view.ts +0 -219
  237. package/src/index.ts +0 -1
  238. package/src/utils/change-metadata.ts +0 -171
  239. package/src/utils/change-utils.ts +0 -131
  240. package/src/utils/file-system.ts +0 -252
  241. package/src/utils/index.ts +0 -12
  242. package/src/utils/interactive.ts +0 -29
  243. package/src/utils/item-discovery.ts +0 -66
  244. package/src/utils/match.ts +0 -26
  245. package/src/utils/shell-detection.ts +0 -62
  246. package/src/utils/task-progress.ts +0 -43
  247. package/tsconfig.json +0 -28
@@ -1,442 +0,0 @@
1
- # PHP 8.4 Features Reference
2
-
3
- Quick reference for PHP 8.4 features to use and deprecations to avoid.
4
-
5
- ---
6
-
7
- ## New Features to Adopt
8
-
9
- ### Property Hooks (PHP 8.4)
10
-
11
- ```php
12
- // ✅ New: Property hooks
13
- class User
14
- {
15
- public string $fullName {
16
- get => $this->firstName . ' ' . $this->lastName;
17
- set => [$this->firstName, $this->lastName] = explode(' ', $value, 2);
18
- }
19
-
20
- public string $email {
21
- set => strtolower($value);
22
- }
23
- }
24
- ```
25
-
26
- ### Asymmetric Visibility (PHP 8.4)
27
-
28
- ```php
29
- // ✅ New: Different visibility for get/set
30
- class User
31
- {
32
- public private(set) string $id;
33
- public protected(set) string $name;
34
- }
35
-
36
- // Can read $user->id publicly
37
- // Can only set $user->id privately
38
- ```
39
-
40
- ### new Without Parentheses (PHP 8.4)
41
-
42
- ```php
43
- // ❌ Old: Required parentheses
44
- $user = (new User())->setName('John');
45
-
46
- // ✅ New: No parentheses needed
47
- $user = new User()->setName('John');
48
- ```
49
-
50
- ### Array Find Functions (PHP 8.4)
51
-
52
- ```php
53
- // ✅ New: array_find()
54
- $users = [
55
- ['name' => 'John', 'active' => false],
56
- ['name' => 'Jane', 'active' => true],
57
- ];
58
-
59
- $activeUser = array_find($users, fn($u) => $u['active']);
60
- // Returns: ['name' => 'Jane', 'active' => true]
61
-
62
- // ✅ New: array_find_key()
63
- $key = array_find_key($users, fn($u) => $u['active']);
64
- // Returns: 1
65
-
66
- // ✅ New: array_any()
67
- $hasActive = array_any($users, fn($u) => $u['active']);
68
- // Returns: true
69
-
70
- // ✅ New: array_all()
71
- $allActive = array_all($users, fn($u) => $u['active']);
72
- // Returns: false
73
- ```
74
-
75
- ### HTML5 DOM Support (PHP 8.4)
76
-
77
- ```php
78
- // ✅ New: Native HTML5 parsing
79
- $dom = Dom\HTMLDocument::createFromString($html);
80
- $dom = Dom\HTMLDocument::createFromFile('page.html');
81
- ```
82
-
83
- ---
84
-
85
- ## PHP 8.3 Features (Ensure Usage)
86
-
87
- ### #[Override] Attribute
88
-
89
- ```php
90
- // ✅ Use Override for overridden methods
91
- class CustomHandler extends BaseHandler
92
- {
93
- #[\Override]
94
- public function handle(): void
95
- {
96
- // Implementation
97
- }
98
- }
99
- ```
100
-
101
- ### Typed Class Constants
102
-
103
- ```php
104
- // ✅ Type constants
105
- class Status
106
- {
107
- public const string PENDING = 'pending';
108
- public const string ACTIVE = 'active';
109
- public const int MAX_RETRY = 3;
110
- }
111
- ```
112
-
113
- ### json_validate()
114
-
115
- ```php
116
- // ❌ Old: Decode to validate
117
- $valid = json_decode($json) !== null;
118
-
119
- // ✅ New: Direct validation
120
- $valid = json_validate($json);
121
- ```
122
-
123
- ### Randomizer Additions
124
-
125
- ```php
126
- // ✅ New random methods
127
- $randomizer = new Random\Randomizer();
128
- $randomizer->getBytesFromString('abc', 10);
129
- $randomizer->nextFloat();
130
- $randomizer->getFloat(0.0, 1.0);
131
- ```
132
-
133
- ---
134
-
135
- ## PHP 8.2 Features (Ensure Usage)
136
-
137
- ### Readonly Classes
138
-
139
- ```php
140
- // ✅ Entire class readonly
141
- readonly class UserDTO
142
- {
143
- public function __construct(
144
- public string $name,
145
- public string $email,
146
- ) {}
147
- }
148
- ```
149
-
150
- ### Null/False/True Types
151
-
152
- ```php
153
- // ✅ Standalone null type
154
- function alwaysNull(): null
155
- {
156
- return null;
157
- }
158
-
159
- // ✅ Standalone false type
160
- function failed(): false
161
- {
162
- return false;
163
- }
164
- ```
165
-
166
- ### Disjunctive Normal Form Types
167
-
168
- ```php
169
- // ✅ Complex union types
170
- function process((A&B)|null $value): void {}
171
- ```
172
-
173
- ---
174
-
175
- ## PHP 8.1 Features (Ensure Usage)
176
-
177
- ### Enums
178
-
179
- ```php
180
- // ✅ Backed enums
181
- enum OrderStatus: string
182
- {
183
- case Pending = 'pending';
184
- case Processing = 'processing';
185
- case Completed = 'completed';
186
- case Cancelled = 'cancelled';
187
-
188
- public function label(): string
189
- {
190
- return match($this) {
191
- self::Pending => 'Order Pending',
192
- self::Processing => 'In Progress',
193
- self::Completed => 'Completed',
194
- self::Cancelled => 'Cancelled',
195
- };
196
- }
197
- }
198
- ```
199
-
200
- ### Readonly Properties
201
-
202
- ```php
203
- // ✅ Immutable properties
204
- class User
205
- {
206
- public function __construct(
207
- public readonly int $id,
208
- public readonly string $email,
209
- ) {}
210
- }
211
- ```
212
-
213
- ### First-Class Callables
214
-
215
- ```php
216
- // ❌ Old: Closure::fromCallable
217
- $fn = Closure::fromCallable([$this, 'method']);
218
-
219
- // ✅ New: First-class callable syntax
220
- $fn = $this->method(...);
221
- ```
222
-
223
- ### Intersection Types
224
-
225
- ```php
226
- // ✅ Require multiple interfaces
227
- function process(Countable&Iterator $items): void {}
228
- ```
229
-
230
- ### Fibers
231
-
232
- ```php
233
- // ✅ Fiber for async
234
- $fiber = new Fiber(function() {
235
- $value = Fiber::suspend('paused');
236
- return $value;
237
- });
238
-
239
- $result = $fiber->start();
240
- $final = $fiber->resume('resumed');
241
- ```
242
-
243
- ---
244
-
245
- ## PHP 8.0 Features (Ensure Usage)
246
-
247
- ### Constructor Property Promotion
248
-
249
- ```php
250
- // ❌ Old
251
- class User
252
- {
253
- private string $name;
254
-
255
- public function __construct(string $name)
256
- {
257
- $this->name = $name;
258
- }
259
- }
260
-
261
- // ✅ New: Property promotion
262
- class User
263
- {
264
- public function __construct(
265
- private readonly string $name,
266
- ) {}
267
- }
268
- ```
269
-
270
- ### Named Arguments
271
-
272
- ```php
273
- // ✅ Named arguments for clarity
274
- $user = new User(
275
- name: 'John',
276
- email: 'john@example.com',
277
- isAdmin: false,
278
- );
279
- ```
280
-
281
- ### Match Expression
282
-
283
- ```php
284
- // ❌ Old: Switch
285
- switch ($status) {
286
- case 'pending':
287
- $color = 'yellow';
288
- break;
289
- default:
290
- $color = 'gray';
291
- }
292
-
293
- // ✅ New: Match
294
- $color = match($status) {
295
- 'pending' => 'yellow',
296
- 'approved' => 'green',
297
- default => 'gray',
298
- };
299
- ```
300
-
301
- ### Nullsafe Operator
302
-
303
- ```php
304
- // ❌ Old: Null checks
305
- $country = null;
306
- if ($user !== null && $user->address !== null) {
307
- $country = $user->address->country;
308
- }
309
-
310
- // ✅ New: Nullsafe
311
- $country = $user?->address?->country;
312
- ```
313
-
314
- ### Union Types
315
-
316
- ```php
317
- // ✅ Union types
318
- function parse(string|int $value): string|false {}
319
- ```
320
-
321
- ### Attributes
322
-
323
- ```php
324
- // ✅ Native attributes
325
- #[Route('/users', methods: ['GET'])]
326
- public function index(): Response {}
327
-
328
- #[Deprecated('Use newMethod() instead')]
329
- public function oldMethod(): void {}
330
- ```
331
-
332
- ---
333
-
334
- ## Deprecations to Fix
335
-
336
- ### PHP 8.4 Deprecations
337
-
338
- ```php
339
- // ❌ Deprecated: Implicit nullable
340
- function foo(string $value = null) {}
341
-
342
- // ✅ Fixed: Explicit nullable
343
- function foo(?string $value = null) {}
344
-
345
- // ❌ Deprecated: session_register()
346
- session_register('var');
347
-
348
- // ✅ Fixed: Use $_SESSION
349
- $_SESSION['var'] = $value;
350
- ```
351
-
352
- ### PHP 8.2 Deprecations
353
-
354
- ```php
355
- // ❌ Deprecated: Dynamic properties
356
- class User
357
- {
358
- public string $name;
359
- }
360
- $user = new User();
361
- $user->undefined = 'value'; // Deprecated!
362
-
363
- // ✅ Fixed: Define property or use #[AllowDynamicProperties]
364
- #[\AllowDynamicProperties]
365
- class User
366
- {
367
- public string $name;
368
- }
369
- ```
370
-
371
- ### PHP 8.1 Deprecations
372
-
373
- ```php
374
- // ❌ Deprecated: ${var} in strings
375
- $name = 'John';
376
- echo "Hello ${name}"; // Deprecated!
377
-
378
- // ✅ Fixed: Use {$var}
379
- echo "Hello {$name}";
380
-
381
- // ❌ Deprecated: Passing null to non-nullable
382
- strlen(null); // Deprecated!
383
-
384
- // ✅ Fixed: Check for null
385
- strlen($value ?? '');
386
- ```
387
-
388
- ---
389
-
390
- ## Type Safety Improvements
391
-
392
- ### Strict Return Types
393
-
394
- ```php
395
- // ❌ Poor: No return type
396
- public function getUsers()
397
- {
398
- return User::all();
399
- }
400
-
401
- // ✅ Good: Explicit return type
402
- public function getUsers(): Collection
403
- {
404
- return User::all();
405
- }
406
-
407
- // ✅ Good: Never return type
408
- public function fail(): never
409
- {
410
- throw new Exception('Failed');
411
- }
412
-
413
- // ✅ Good: Void return type
414
- public function log(string $message): void
415
- {
416
- Log::info($message);
417
- }
418
- ```
419
-
420
- ### Strict Parameter Types
421
-
422
- ```php
423
- // ❌ Poor: No parameter types
424
- public function process($data, $options)
425
-
426
- // ✅ Good: Typed parameters
427
- public function process(array $data, ProcessOptions $options): Result
428
- ```
429
-
430
- ---
431
-
432
- ## Detection Patterns
433
-
434
- | Issue | Detection Pattern |
435
- | ------------------ | ----------------------------------------------------------- |
436
- | Missing readonly | Class properties without `readonly` that are never modified |
437
- | Missing match | Switch statements that return values |
438
- | Missing nullsafe | Nested null checks with `&&` |
439
- | Missing named args | Constructor calls with 4+ positional parameters |
440
- | Implicit nullable | Parameters with `= null` but no `?` type |
441
- | Dynamic properties | Property access on undefined properties |
442
- | Old string syntax | `${var}` instead of `{$var}` |
@@ -1,202 +0,0 @@
1
-
2
- Apache License
3
- Version 2.0, January 2004
4
- http://www.apache.org/licenses/
5
-
6
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
-
8
- 1. Definitions.
9
-
10
- "License" shall mean the terms and conditions for use, reproduction,
11
- and distribution as defined by Sections 1 through 9 of this document.
12
-
13
- "Licensor" shall mean the copyright owner or entity authorized by
14
- the copyright owner that is granting the License.
15
-
16
- "Legal Entity" shall mean the union of the acting entity and all
17
- other entities that control, are controlled by, or are under common
18
- control with that entity. For the purposes of this definition,
19
- "control" means (i) the power, direct or indirect, to cause the
20
- direction or management of such entity, whether by contract or
21
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
- outstanding shares, or (iii) beneficial ownership of such entity.
23
-
24
- "You" (or "Your") shall mean an individual or Legal Entity
25
- exercising permissions granted by this License.
26
-
27
- "Source" form shall mean the preferred form for making modifications,
28
- including but not limited to software source code, documentation
29
- source, and configuration files.
30
-
31
- "Object" form shall mean any form resulting from mechanical
32
- transformation or translation of a Source form, including but
33
- not limited to compiled object code, generated documentation,
34
- and conversions to other media types.
35
-
36
- "Work" shall mean the work of authorship, whether in Source or
37
- Object form, made available under the License, as indicated by a
38
- copyright notice that is included in or attached to the work
39
- (an example is provided in the Appendix below).
40
-
41
- "Derivative Works" shall mean any work, whether in Source or Object
42
- form, that is based on (or derived from) the Work and for which the
43
- editorial revisions, annotations, elaborations, or other modifications
44
- represent, as a whole, an original work of authorship. For the purposes
45
- of this License, Derivative Works shall not include works that remain
46
- separable from, or merely link (or bind by name) to the interfaces of,
47
- the Work and Derivative Works thereof.
48
-
49
- "Contribution" shall mean any work of authorship, including
50
- the original version of the Work and any modifications or additions
51
- to that Work or Derivative Works thereof, that is intentionally
52
- submitted to Licensor for inclusion in the Work by the copyright owner
53
- or by an individual or Legal Entity authorized to submit on behalf of
54
- the copyright owner. For the purposes of this definition, "submitted"
55
- means any form of electronic, verbal, or written communication sent
56
- to the Licensor or its representatives, including but not limited to
57
- communication on electronic mailing lists, source code control systems,
58
- and issue tracking systems that are managed by, or on behalf of, the
59
- Licensor for the purpose of discussing and improving the Work, but
60
- excluding communication that is conspicuously marked or otherwise
61
- designated in writing by the copyright owner as "Not a Contribution."
62
-
63
- "Contributor" shall mean Licensor and any individual or Legal Entity
64
- on behalf of whom a Contribution has been received by Licensor and
65
- subsequently incorporated within the Work.
66
-
67
- 2. Grant of Copyright License. Subject to the terms and conditions of
68
- this License, each Contributor hereby grants to You a perpetual,
69
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
- copyright license to reproduce, prepare Derivative Works of,
71
- publicly display, publicly perform, sublicense, and distribute the
72
- Work and such Derivative Works in Source or Object form.
73
-
74
- 3. Grant of Patent License. Subject to the terms and conditions of
75
- this License, each Contributor hereby grants to You a perpetual,
76
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
- (except as stated in this section) patent license to make, have made,
78
- use, offer to sell, sell, import, and otherwise transfer the Work,
79
- where such license applies only to those patent claims licensable
80
- by such Contributor that are necessarily infringed by their
81
- Contribution(s) alone or by combination of their Contribution(s)
82
- with the Work to which such Contribution(s) was submitted. If You
83
- institute patent litigation against any entity (including a
84
- cross-claim or counterclaim in a lawsuit) alleging that the Work
85
- or a Contribution incorporated within the Work constitutes direct
86
- or contributory patent infringement, then any patent licenses
87
- granted to You under this License for that Work shall terminate
88
- as of the date such litigation is filed.
89
-
90
- 4. Redistribution. You may reproduce and distribute copies of the
91
- Work or Derivative Works thereof in any medium, with or without
92
- modifications, and in Source or Object form, provided that You
93
- meet the following conditions:
94
-
95
- (a) You must give any other recipients of the Work or
96
- Derivative Works a copy of this License; and
97
-
98
- (b) You must cause any modified files to carry prominent notices
99
- stating that You changed the files; and
100
-
101
- (c) You must retain, in the Source form of any Derivative Works
102
- that You distribute, all copyright, patent, trademark, and
103
- attribution notices from the Source form of the Work,
104
- excluding those notices that do not pertain to any part of
105
- the Derivative Works; and
106
-
107
- (d) If the Work includes a "NOTICE" text file as part of its
108
- distribution, then any Derivative Works that You distribute must
109
- include a readable copy of the attribution notices contained
110
- within such NOTICE file, excluding those notices that do not
111
- pertain to any part of the Derivative Works, in at least one
112
- of the following places: within a NOTICE text file distributed
113
- as part of the Derivative Works; within the Source form or
114
- documentation, if provided along with the Derivative Works; or,
115
- within a display generated by the Derivative Works, if and
116
- wherever such third-party notices normally appear. The contents
117
- of the NOTICE file are for informational purposes only and
118
- do not modify the License. You may add Your own attribution
119
- notices within Derivative Works that You distribute, alongside
120
- or as an addendum to the NOTICE text from the Work, provided
121
- that such additional attribution notices cannot be construed
122
- as modifying the License.
123
-
124
- You may add Your own copyright statement to Your modifications and
125
- may provide additional or different license terms and conditions
126
- for use, reproduction, or distribution of Your modifications, or
127
- for any such Derivative Works as a whole, provided Your use,
128
- reproduction, and distribution of the Work otherwise complies with
129
- the conditions stated in this License.
130
-
131
- 5. Submission of Contributions. Unless You explicitly state otherwise,
132
- any Contribution intentionally submitted for inclusion in the Work
133
- by You to the Licensor shall be under the terms and conditions of
134
- this License, without any additional terms or conditions.
135
- Notwithstanding the above, nothing herein shall supersede or modify
136
- the terms of any separate license agreement you may have executed
137
- with Licensor regarding such Contributions.
138
-
139
- 6. Trademarks. This License does not grant permission to use the trade
140
- names, trademarks, service marks, or product names of the Licensor,
141
- except as required for reasonable and customary use in describing the
142
- origin of the Work and reproducing the content of the NOTICE file.
143
-
144
- 7. Disclaimer of Warranty. Unless required by applicable law or
145
- agreed to in writing, Licensor provides the Work (and each
146
- Contributor provides its Contributions) on an "AS IS" BASIS,
147
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
- implied, including, without limitation, any warranties or conditions
149
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
- PARTICULAR PURPOSE. You are solely responsible for determining the
151
- appropriateness of using or redistributing the Work and assume any
152
- risks associated with Your exercise of permissions under this License.
153
-
154
- 8. Limitation of Liability. In no event and under no legal theory,
155
- whether in tort (including negligence), contract, or otherwise,
156
- unless required by applicable law (such as deliberate and grossly
157
- negligent acts) or agreed to in writing, shall any Contributor be
158
- liable to You for damages, including any direct, indirect, special,
159
- incidental, or consequential damages of any character arising as a
160
- result of this License or out of the use or inability to use the
161
- Work (including but not limited to damages for loss of goodwill,
162
- work stoppage, computer failure or malfunction, or any and all
163
- other commercial damages or losses), even if such Contributor
164
- has been advised of the possibility of such damages.
165
-
166
- 9. Accepting Warranty or Additional Liability. While redistributing
167
- the Work or Derivative Works thereof, You may choose to offer,
168
- and charge a fee for, acceptance of support, warranty, indemnity,
169
- or other liability obligations and/or rights consistent with this
170
- License. However, in accepting such obligations, You may act only
171
- on Your own behalf and on Your sole responsibility, not on behalf
172
- of any other Contributor, and only if You agree to indemnify,
173
- defend, and hold each Contributor harmless for any liability
174
- incurred by, or claims asserted against, such Contributor by reason
175
- of your accepting any such warranty or additional liability.
176
-
177
- END OF TERMS AND CONDITIONS
178
-
179
- APPENDIX: How to apply the Apache License to your work.
180
-
181
- To apply the Apache License to your work, attach the following
182
- boilerplate notice, with the fields enclosed by brackets "[]"
183
- replaced with your own identifying information. (Don't include
184
- the brackets!) The text should be enclosed in the appropriate
185
- comment syntax for the file format. We also recommend that a
186
- file or class name and description of purpose be included on the
187
- same "printed page" as the copyright notice for easier
188
- identification within third-party archives.
189
-
190
- Copyright [yyyy] [name of copyright owner]
191
-
192
- Licensed under the Apache License, Version 2.0 (the "License");
193
- you may not use this file except in compliance with the License.
194
- You may obtain a copy of the License at
195
-
196
- http://www.apache.org/licenses/LICENSE-2.0
197
-
198
- Unless required by applicable law or agreed to in writing, software
199
- distributed under the License is distributed on an "AS IS" BASIS,
200
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
- See the License for the specific language governing permissions and
202
- limitations under the License.