Skip to content
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

[Stopwatch] Add type-hints for Stopwatch and Section classes #32242

Merged
merged 2 commits into from Jul 29, 2019

Conversation

jschaedl
Copy link
Contributor

Q A
Branch? master
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #32179
License MIT
Doc PR N/A

This PR adds type hints to the Stopwatch and Section classes.

src/Symfony/Component/Stopwatch/Section.php Outdated Show resolved Hide resolved
src/Symfony/Component/Stopwatch/Section.php Show resolved Hide resolved
src/Symfony/Component/Stopwatch/Stopwatch.php Outdated Show resolved Hide resolved
@jschaedl
Copy link
Contributor Author

jschaedl commented Jul 5, 2019

@derrabus @fabpot Redundant information in doc blocks have been removed.

@jschaedl jschaedl force-pushed the improvement/stopwatch_type-hints branch from 33a3ff1 to 725bad3 Compare July 5, 2019 08:34
fabpot added a commit that referenced this pull request Jul 8, 2019
…hod. (jschaedl)

This PR was merged into the 4.4 branch.

Discussion
----------

[Stopwatch] Deprecate passing null in Section::get() method.

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | yes <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32179<!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A

This PR is related to #32242

Commits
-------

ea48176 [Stopwatch] Deprecate passing null in Section::get() method.
@jschaedl jschaedl force-pushed the improvement/stopwatch_type-hints branch from 720af19 to 13f95a6 Compare July 8, 2019 13:47
@fabpot
Copy link
Member

fabpot commented Jul 27, 2019

@jschaedl Can you have a look at the remaining comments? Thank you.

@Tobion Tobion force-pushed the improvement/stopwatch_type-hints branch 2 times, most recently from 481f71d to e7426ca Compare July 28, 2019 18:30
@Tobion
Copy link
Member

Tobion commented Jul 28, 2019

I rebased and fixed the comments. It seems the webprofiler toolbar request does not have the x-debug-token and called the stopwatch needlessly. I skipped it in this case and checked the symfony timeline panel and nothing changed. So this seems fine.
Edit: I extracted that to #32799 to fix in lower branches as well.

Tobion added a commit that referenced this pull request Jul 29, 2019
This PR was merged into the 3.4 branch.

Discussion
----------

[Stopwatch] fix some phpdocs

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

Fix phpdocs found in #32242

Commits
-------

66dc906 [Stopwatch] fix some phpdocs
Tobion added a commit that referenced this pull request Jul 29, 2019
…sabled (Tobion)

This PR was merged into the 3.4 branch.

Discussion
----------

[HttpKernel] do not stopwatch sections when profiler is disabled

| Q             | A
| ------------- | ---
| Branch?       | 4.3
| Bug fix?      | yes
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets |
| License       | MIT
| Doc PR        |

the toolbar and profiler panel disable to profiler which then does not set the X-Debug-Token. so when the header does not exist, do not call the stopwatch methods with `null` which violates the contract and does not make sense. found with #32242

Commits
-------

8718cd1 [HttpKernel] do not stopwatch sections when profiler is disabled
@Tobion Tobion force-pushed the improvement/stopwatch_type-hints branch from e7426ca to 538cc34 Compare July 29, 2019 16:25
@Tobion
Copy link
Member

Tobion commented Jul 29, 2019

Thank you @jschaedl.

@Tobion Tobion merged commit 538cc34 into symfony:master Jul 29, 2019
Tobion added a commit that referenced this pull request Jul 29, 2019
…sses (jschaedl, Tobion)

This PR was merged into the 5.0-dev branch.

Discussion
----------

[Stopwatch] Add type-hints for Stopwatch and Section classes

| Q             | A
| ------------- | ---
| Branch?       | master <!-- see below -->
| Bug fix?      | no
| New feature?  | no <!-- please update src/**/CHANGELOG.md files -->
| BC breaks?    | no     <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass?   | yes    <!-- please add some, will be required by reviewers -->
| Fixed tickets | #32179  <!-- #-prefixed issue number(s), if any -->
| License       | MIT
| Doc PR        | N/A <!-- required for new features -->

This PR adds type hints to the `Stopwatch` and `Section` classes.

Commits
-------

538cc34 [Stopwatch] fix wrong nullable type
ff4528e [Stopwatch] Add type-hints for Stopwatch and Section classes
@jschaedl jschaedl deleted the improvement/stopwatch_type-hints branch February 23, 2020 08:02
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.

None yet

7 participants