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

Debug collector #72

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open

Debug collector #72

wants to merge 15 commits into from

Conversation

xepozz
Copy link
Member

@xepozz xepozz commented Aug 20, 2023

Q A
Is bugfix?
New feature? ✔️
Breaks BC?

yiisoft/yii-dev-panel#60

@codecov
Copy link

codecov bot commented Aug 20, 2023

Codecov Report

Attention: Patch coverage is 64.70588% with 18 lines in your changes missing coverage. Please review.

Project coverage is 90.82%. Comparing base (03dc660) to head (d2a44cf).

Files Patch % Lines
src/Debug/MailerInterfaceProxy.php 0.00% 17 Missing ⚠️
src/Debug/MailerCollector.php 97.05% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master      #72      +/-   ##
============================================
- Coverage     99.35%   90.82%   -8.54%     
- Complexity       64       78      +14     
============================================
  Files             8       10       +2     
  Lines           156      207      +51     
============================================
+ Hits            155      188      +33     
- Misses            1       19      +18     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@what-the-diff
Copy link

what-the-diff bot commented Aug 20, 2023

PR Summary

  • Composer.json Stability Update
    Updated the composer.json file to permit use of development packages by adding "minimum-stability": "dev".

  • New Debugging Package Addition
    To aid in debugging the application during development, the "yiisoft/yii-debug": "^3.0@dev" package was added to the composer.json file.

  • Introduction of New Debug Files
    Two new debug related files src/Debug/MailerCollector.php and src/Debug/MailerInterfaceProxy.php were added. These provide additional debug capabilities.

  • Comment Correction in MailerInterface.php
    Corrected a comment in src/MailerInterface.php file to improve the clarity and readability of our comments.

  • Introduction of New Test File
    To assure quality, a new test file tests/Debug/MailerCollectorTest.php was added.

  • Type Modifying in DummyMessage.php
    To make our code more flexible and to accommodate more types of data, the types of $from and $to properties in tests/TestAsset/DummyMessage.php file were modified from string to string|array.

Comment on lines +17 to +19
public function collectMessage(
MessageInterface $message,
): void {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public function collectMessage(
MessageInterface $message,
): void {
public function collect(
MessageInterface $message,
MessageInterface ...$messages,
): void {

Copy link
Member Author

Choose a reason for hiding this comment

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

Why?

Copy link
Member

Choose a reason for hiding this comment

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

This signature combines two methods into one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but then I need to unpack and pack arguments back

Comment on lines +23 to +28
public function collectMessages(
array $messages,
): void {
$this->messages = array_merge($this->messages, $messages);
}

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
public function collectMessages(
array $messages,
): void {
$this->messages = array_merge($this->messages, $messages);
}

composer.json Outdated Show resolved Hide resolved
Copy link
Member

@samdark samdark left a comment

Choose a reason for hiding this comment

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

Need stability flag fixed in composer.json

Comment on lines +40 to +42
'htmlBody' => $message->getCharset() === 'quoted-printable'
? quoted_printable_decode($message->getHtmlBody())
: $message->getHtmlBody(),
Copy link
Member

@vjik vjik Sep 22, 2023

Choose a reason for hiding this comment

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

Message keeps html body in raw format without encoding. Seems, not need make decode here.

getCharsert returns charset ("utf-8", "windows-1251", "ISO-8859-1", etc.). It's not encoding (quoted-printable, base64, etc.). Not need this decoding here.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not true

Copy link
Member

Choose a reason for hiding this comment

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

Why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants