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

Added OutgoingMessage type to BotMan::reply() $message parameter #1104

Merged
merged 1 commit into from
May 18, 2020
Merged

Added OutgoingMessage type to BotMan::reply() $message parameter #1104

merged 1 commit into from
May 18, 2020

Conversation

PHLAK
Copy link
Contributor

@PHLAK PHLAK commented Jan 20, 2020

Added OutgoingMessage as an accepted type for the $message parameter of BotMan::reply().

This fixes static analysis errors like the following from psalm.

ERROR: InvalidArgument - app/Path/To/SomeFile.php:13:37 - Argument 1 of BotMan\BotMan\BotMan::reply expects BotMan\BotMan\Messages\Outgoing\Question|string, BotMan\BotMan\Messages\Outgoing\OutgoingMessage provided
        $botman->reply(OutgoingMessage::create(...)->withAttachment(...));

@PHLAK
Copy link
Contributor Author

PHLAK commented Jan 20, 2020

Is StyleCI miss-configured or should I modify the imports order to pass style checks?

@mfn
Copy link

mfn commented Jan 20, 2020

The defaults of the laravel preset in StyleCI changed (use order was switched from length to alphabetical ordering).

The (only|correct) fix is that the maintainer has to run it on master branch, regular feature PRs shouldn't include this noise.

@mpociot
Copy link
Member

mpociot commented Jan 30, 2020

Thank you!

@codecov
Copy link

codecov bot commented Feb 26, 2020

Codecov Report

Merging #1104 into 2.0 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##                2.0    #1104   +/-   ##
=========================================
  Coverage     82.89%   82.89%           
  Complexity      595      595           
=========================================
  Files            48       48           
  Lines          1561     1561           
=========================================
  Hits           1294     1294           
  Misses          267      267
Impacted Files Coverage Δ Complexity Δ
src/BotMan.php 89.56% <ø> (ø) 80 <0> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f000281...626b578. Read the comment docs.

@PHLAK
Copy link
Contributor Author

PHLAK commented Feb 26, 2020

Rebased this PR to get it passing checks.

@feralheart feralheart merged commit d38f3fe into botman:2.0 May 18, 2020
@feralheart
Copy link
Contributor

Hi,
Thank you for your PR!

@PHLAK PHLAK deleted the patch-1 branch May 18, 2020 22:56
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.

4 participants