Skip to content

[Stopwatch] Add ROOT constant to make it easier to reference #54854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2024

Conversation

hacfi
Copy link
Contributor

@hacfi hacfi commented May 7, 2024

Q A
Branch? 7.1
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

Just an DX improvement so you can reference the root section with $stopwatch->getSectionEvents(Stopwatch::ROOT) instead of $stopwatch->getSectionEvents('__root__').

@carsonbot

This comment was marked as outdated.

@carsonbot
Copy link

It looks like you unchecked the "Allow edits from maintainer" box. That is fine, but please note that if you have multiple commits, you'll need to squash your commits into one before this can be merged. Or, you can check the "Allow edits from maintainers" box and the maintainer can squash for you.

Cheers!

Carsonbot

@OskarStark OskarStark changed the title [Stopwatch] Add ROOT constant to make it easier to reference [Stopwatch] Add ROOT constant to make it easier to reference May 8, 2024
Copy link
Member

@fabpot fabpot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For 7.2

@fabpot fabpot modified the milestones: 7.1, 7.2 May 11, 2024
@xabbuh
Copy link
Member

xabbuh commented May 13, 2024

What about if we also add a method named getRootSectionEvents()?

@hacfi hacfi force-pushed the stopwatch-const branch from 8bc61d7 to 6a53e09 Compare May 13, 2024 08:04
@hacfi hacfi force-pushed the stopwatch-const branch from 6a53e09 to fadeafd Compare May 13, 2024 08:19
@hacfi
Copy link
Contributor Author

hacfi commented May 13, 2024

@xabbuh Updated as requested.

@fabpot
Copy link
Member

fabpot commented May 21, 2024

Thank you @hacfi.

@fabpot fabpot merged commit 8691af2 into symfony:7.2 May 21, 2024
7 of 10 checks passed
@fabpot fabpot mentioned this pull request Oct 27, 2024
nexsja pushed a commit to nexsja/stopwatch-fix that referenced this pull request Dec 18, 2024
nexsja pushed a commit to nexsja/stopwatch-fix that referenced this pull request Dec 18, 2024
fabpot added a commit that referenced this pull request Dec 30, 2024
…fetch a mis… (Alex Niedre)

This PR was merged into the 7.2 branch.

Discussion
----------

[Stopwatch] bug #54854  undefined key error when trying to fetch a mis…

| Q             | A
| ------------- | ---
| Branch?       | 7.2
| Bug fix?      | yes
| New feature?  |no
| Deprecations? |no
| Issues        | Fix #54854
| License       | MIT

A minor bug was introduced in the related referenced issue which caused an unidentified key exception to trigger when referencing a section that was missing.

Reproduced here, as an example: https://3v4l.org/OFFLB

This MR addresses that and adds a simple test to prevent the same mistake in the future.

Commits
-------

c3cf577 bug #54854 [Stopwatch] undefined key error when trying to fetch a missing section
fabpot added a commit that referenced this pull request Dec 30, 2024
* 7.2:
  [SecurityBundle] Do not replace authenticators service by their traceable version
  [Finder] Fix using `==` as default operator in `DateComparator`
  bug #54854 [Stopwatch] undefined key error when trying to fetch a missing section
  [HttpFoundation] Avoid mime type guess with temp files in `BinaryFileResponse`
  choose the correctly cased class name for the MariaDB platform
@fabpot fabpot mentioned this pull request Dec 31, 2024
OskarStark added a commit to OskarStark/symfony that referenced this pull request Jan 2, 2025
* upstream/7.3:
  [SecurityBundle] Do not replace authenticators service by their traceable version
  reject URLs containing whitespaces
  [Finder] Fix using `==` as default operator in `DateComparator`
  Update validators.fa.xlf
  the "max" option can be zero
  [PropertyInfo] Remove `@internal` directives to allow extensions with no static-analysis errors
  [TypeInfo] Fix PHPDoc resolving of union with mixed
  [Security/Csrf] Trust "Referer" at the same level as "Origin"
  bug symfony#54854 [Stopwatch] undefined key error when trying to fetch a missing section
  [HttpClient] Fix a typo in NoPrivateNetworkHttpClient
  [HttpFoundation] Avoid mime type guess with temp files in `BinaryFileResponse`
  choose the correctly cased class name for the MariaDB platform
  fix test method parameter names
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants