This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parameters: | |
mailer.transport: sendmail | |
services: | |
mailer: sendmail | |
class: Mailer | |
arguments: ['%mailer.transport%'] | |
newsletter_manager: | |
class: NewsletterManager | |
calls: | |
- [setMailer‚ ['@mailer']] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Mailer | |
{ | |
private $fromEmail; | |
private $fromName; | |
private $header; | |
public function __construct($fromEmail, $fromName, $header) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class data | |
{ | |
private $data; | |
public function __construct($data) | |
{ | |
$this->data = $data; | |
} | |
public function get() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ProductList | |
{ | |
private $products = []; | |
public function __construct(array $productList) | |
{ | |
foreach ($productList as $product) { | |
$this->addProduct($product); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Demo; | |
interface ProductListInterface | |
{ | |
/** | |
* Checks if the product is listed. | |
* | |
* @return bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Demo; | |
class ProductList | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Demo; | |
use Demo\ProductList; | |
class ProductListTest extends \PHPUnit_Framework_TestCase | |
{ | |
public function testProductList() | |
{ |