yiisoft / yiisoft/profiler

Profiler enable/disable has illogical behavior

Open
#60 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
22
Forks
11
Avg merge
53m
Merged PRs (30d)
1

Description

$profiler = new Profiler($logger);
$profiler->enable(false);

Expects that profiler is disabled, but it returns new disabled profiler instead, and old one still stays enabled.
I suggest to make enabled property mutable and switch it's value using method ->enable() instead of cloning profiler

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Search the repository for the Profiler class and its enable() method, then inspect how the current enabled state is handled. Done means calling enable(false) changes the existing profiler's behavior instead of returning a separate disabled instance; verify the behavior with the relevant tests or add coverage if none is mentioned.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
performance
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.