Skip to content

Commit

Permalink
Merge 70b1116 into 1234576
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiothiroki committed Nov 2, 2021
2 parents 1234576 + 70b1116 commit 1f35c98
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ A collection of design patterns written in PHP
[![PHP Composer](https://github.com/fabiothiroki/php-design-patterns/actions/workflows/php.yaml/badge.svg)](https://github.com/fabiothiroki/php-design-patterns/actions/workflows/php.yaml) [![Coverage Status](https://coveralls.io/repos/github/fabiothiroki/php-design-patterns/badge.svg?branch=main)](https://coveralls.io/github/fabiothiroki/php-design-patterns?branch=main)

## Creational
- [Prototype](app/creational/prototype)
- [Prototype](app/creational/prototype)

## Structural
- [Adapter](app/structural/adapter)
5 changes: 5 additions & 0 deletions app/structural/adapter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Adapter design pattern in PHP

Article: https://dev.to/fabiothiroki/php-design-patterns-adapter-b8c

[![](https://mermaid.ink/img/eyJjb2RlIjoic2VxdWVuY2VEaWFncmFtXG4gICAgU2lnblVwU2VydmljZS0tPj5UaGlyZFBhcnR5RW1haWxTZW5kZXJBZGFwdGVyOiBJIHdhbnQgdG8gc2VuZCBhbiBlbWFpbCFcbiAgICBUaGlyZFBhcnR5RW1haWxTZW5kZXJBZGFwdGVyLS0-PlNpZ25VcFNlcnZpY2U6IEkganVzdCBuZWVkIGEgcmVjaWNwaWVudCBhbmQgdGhlIGNvbnRlbnQhXG4gICAgU2lnblVwU2VydmljZS0tPj5UaGlyZFBhcnR5RW1haWxTZW5kZXJBZGFwdGVyOiBPaCwgdGhhdCdzIGV4YWN0bHkgd2hhdCBJIGhhdmUhXG4gICAgVGhpcmRQYXJ0eUVtYWlsU2VuZGVyQWRhcHRlci0tPj5UaGlyZFBhcnR5RW1haWxDbGllbnQ6IFBsZWFzZSBzZW5kIHRoaXMgZW1haWxcbiAgICAgICAgICAgICIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0In0sInVwZGF0ZUVkaXRvciI6ZmFsc2UsImF1dG9TeW5jIjp0cnVlLCJ1cGRhdGVEaWFncmFtIjpmYWxzZX0)](https://mermaid-js.github.io/mermaid-live-editor/edit/#eyJjb2RlIjoic2VxdWVuY2VEaWFncmFtXG4gICAgU2lnblVwU2VydmljZS0tPj5UaGlyZFBhcnR5RW1haWxTZW5kZXJBZGFwdGVyOiBJIHdhbnQgdG8gc2VuZCBhbiBlbWFpbCFcbiAgICBUaGlyZFBhcnR5RW1haWxTZW5kZXJBZGFwdGVyLS0-PlNpZ25VcFNlcnZpY2U6IEkganVzdCBuZWVkIGEgcmVjaWNwaWVudCBhbmQgdGhlIGNvbnRlbnQhXG4gICAgU2lnblVwU2VydmljZS0tPj5UaGlyZFBhcnR5RW1haWxTZW5kZXJBZGFwdGVyOiBPaCwgdGhhdCdzIGV4YWN0bHkgd2hhdCBJIGhhdmUhXG4gICAgVGhpcmRQYXJ0eUVtYWlsU2VuZGVyQWRhcHRlci0tPj5UaGlyZFBhcnR5RW1haWxDbGllbnQ6IFBsZWFzZSBzZW5kIHRoaXMgZW1haWxcbiAgICAgICAgICAgICIsIm1lcm1haWQiOiJ7XG4gIFwidGhlbWVcIjogXCJkZWZhdWx0XCJcbn0iLCJ1cGRhdGVFZGl0b3IiOmZhbHNlLCJhdXRvU3luYyI6dHJ1ZSwidXBkYXRlRGlhZ3JhbSI6ZmFsc2V9)
3 changes: 2 additions & 1 deletion tests/structural/adapter/AdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public function testThirdPartyEmailSenderAdapterAdapterUsesCorrectClient(): void
$emailAdapter = new ThirdPartyEmailSenderAdapter($emailClient);

$emailClient->expects($this->once())
->method('sendEmail');
->method('sendEmail')
->with('email@email.com', 'I love design patterns');

$emailAdapter->sendEmail(
'email@email.com',
Expand Down

0 comments on commit 1f35c98

Please sign in to comment.