|
4 | 4 |
|
5 | 5 | - `sentry/sentry-symfony` is a Composer library and Symfony bundle, not an |
6 | 6 | application. |
7 | | -- The bundle wires the Sentry PHP SDK into Symfony and optional integrations |
8 | | - such as request handling, console, Messenger, Twig, Cache, DBAL, HTTP |
9 | | - client, metrics, and Monolog/logging. |
10 | | -- The main entry points are: |
11 | | - - `src/SentryBundle.php`: registers compiler passes. |
12 | | - - `src/DependencyInjection/Configuration.php`: defines the config tree. |
13 | | - - `src/DependencyInjection/SentryExtension.php`: turns config into container |
14 | | - definitions and parameters. |
15 | | - - `src/Resources/config/services.yaml`: defines base services and listener |
16 | | - tags. |
17 | | - - `src/aliases.php`: selects version-specific classes by runtime feature |
18 | | - detection. |
| 7 | +- Use this file for repo-specific constraints that are easy to miss, and |
| 8 | + explore the codebase for current implementation details. |
19 | 9 |
|
20 | 10 | ## Compatibility Rules |
21 | 11 |
|
|
42 | 32 | - Keep `declare(strict_types=1);` in PHP files. |
43 | 33 | - Do not introduce PHP syntax or runtime assumptions that require newer than |
44 | 34 | PHP `7.2` in shipped code unless the package minimum is being raised. |
45 | | -- Follow the existing formatting rules from `.php-cs-fixer.dist.php`: Symfony |
46 | | - style, short arrays, ordered imports, yoda conditions, and 4-space |
47 | | - indentation. |
| 35 | +- Follow the existing formatting rules from `.php-cs-fixer.dist.php`. |
48 | 36 | - Services are private by default. Prefer existing FQCN service IDs and aliases |
49 | 37 | instead of introducing new public services. |
50 | 38 | - If a service or class has no intended public API surface but is public only |
51 | 39 | for tests, wiring, or framework integration reasons, mark it `@internal` so |
52 | 40 | users do not rely on it as a stable extension point and future refactors do |
53 | 41 | not become accidental BC breaks. |
54 | | -- Config changes usually require synchronized updates in all of these places: |
55 | | - - `src/DependencyInjection/Configuration.php` |
56 | | - - `src/DependencyInjection/SentryExtension.php` |
57 | | - - `src/Resources/config/services.yaml` |
58 | | - - `src/Resources/config/schema/sentry-1.0.xsd` |
59 | | - - `tests/DependencyInjection/Fixtures/{yml,php,xml}` |
60 | | - - `tests/DependencyInjection/ConfigurationTest.php` |
61 | | - - `tests/DependencyInjection/SentryExtensionTest.php` |
62 | 42 | - XML fixtures are still relevant for older Symfony versions even though XML |
63 | 43 | config support is skipped on Symfony 8+ in tests. |
64 | 44 | - End-to-end behavior lives in `tests/End2End/App`. Prefer end-to-end coverage |
|
81 | 61 | - For config changes, update the YAML, PHP, and XML DI fixtures together. |
82 | 62 | - For optional-package behavior, mirror the existing pattern of conditional |
83 | 63 | skips instead of forcing packages to exist in every environment. |
84 | | -- Local verification commands: |
85 | | - - `composer install` |
86 | | - - `composer cs-check` |
87 | | - - `composer phpstan` |
88 | | - - `composer psalm` |
89 | | - - `composer tests` |
90 | | - - `composer check` |
91 | | -- `composer phpstan` runs PHPStan with `512M` because the default local PHP |
92 | | - memory limit can be too low for this repo. |
93 | | -- `php-cs-fixer` is the formatting tool in this repo. If formatting fails, run |
94 | | - `composer cs-fix` and then rerun `composer check`. |
| 64 | +- After editing files, run the relevant formatting, lint, and test commands for |
| 65 | + the code you changed. |
95 | 66 | - Before committing, run `composer check`. |
96 | 67 |
|
97 | 68 | ## Docs And Release Notes |
98 | 69 |
|
99 | | -- Update `README.md` when public installation, configuration, or usage changes. |
100 | | -- Update `CHANGELOG.md` for user-facing changes. |
| 70 | +- `README.md` and `CHANGELOG.md` are updated manually during releases, so do |
| 71 | + not modify them as part of normal development changes. |
| 72 | +- If a change may require updates in the separate documentation repo, ask the |
| 73 | + user whether to review their locally checked out docs. The user must provide |
| 74 | + the local path. If they opt in, update that repo's `master` branch when safe, |
| 75 | + use git worktrees to inspect the relevant docs, and suggest any needed |
| 76 | + changes to avoid stale documentation. |
101 | 77 | - Add or update an `UPGRADE-*.md` file when a change is breaking or alters the |
102 | 78 | upgrade path. |
103 | 79 | - `CONTRIBUTING.md` states that new code should include tests and notes that |
|
109 | 85 | - `.github/workflows/tests.yaml` runs a PHP/Symfony matrix and also includes |
110 | 86 | jobs that remove optional packages before running tests. |
111 | 87 | - `.github/workflows/static-analysis.yaml` runs PHP-CS-Fixer, PHPStan, and |
112 | | - Psalm on a recent PHP version. Check the workflow file for the exact version |
113 | | - currently used in CI. |
114 | | -- A single local green run is necessary but not sufficient. Avoid changes that |
115 | | - only work when optional packages are present. |
| 88 | + Psalm on a single recent PHP version rather than across the full test matrix. |
0 commit comments