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 | |
final class EmailValueObject | |
{ | |
private $mailbox; | |
private $host; | |
public function __construct($email) | |
{ | |
if (false === strpos($email, '@')) { |
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
# install gender http://www.php.net/manual/en/book.gender.php | |
sudo apt-get install libpcre3-dev | |
sudo pecl install gender | |
# generate data | |
mkdir ~/gender | |
sudo pear run-scripts pecl/gender | |
# eneble module | |
echo 'extension=gender.so' >> /etc/php5/cli/php.ini |
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
{ | |
"time": "2020-09-13 15:45:00", | |
"level": "info", | |
"channel": "main", | |
"message": "Some log entry has been produced" | |
} |
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 Acme\Example\Tests; | |
use Symfony\Component\Console\Input\ArrayInput; | |
use Symfony\Bundle\FrameworkBundle\Console\Application; | |
use Doctrine\DBAL\Driver\PDOSqlite\Driver as PDOSqliteDriver; | |
require_once(__DIR__ . IsolatedTestsTrait::$kernelRootDir . '/AppKernel.php'); |
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 Example\FooBundle\Service; | |
use Doctrine\ORM\EntityRepository; | |
use Symfony\Component\HttpKernel\Log\LoggerInterface; | |
class FooService | |
{ | |
protected $fooRepository; |
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 Example\FooBundle\Repository; | |
use Doctrine\ORM\EntityRepository; | |
class FooRepository extends EntityRepository | |
{ | |
} |
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
<container xmlns="http://symfony.com/schema/dic/services" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="[..]"> | |
<parameters> | |
<parameter key="example.foo.repository.class"> | |
Example\FooBundle\Repository\FooRepository</parameter> | |
<parameter key="example.foo.service.class"> | |
Example\FooBundle\Service\FooService</parameter> | |
</parameters> |
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 Example\FooBundle\Repository; | |
use Doctrine\Common\Persistence\ObjectRepository; | |
interface FooRepositoryInterface extends ObjectRepository | |
{ | |
public function fetchLatest(); | |
} |
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 Example\FooBundle\Service; | |
use Doctrine\ORM\EntityRepository; | |
use Symfony\Component\HttpKernel\Log\LoggerInterface; | |
class FooService | |
{ | |
protected $fooRepository; |
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 Example\FooBundle\Repository; | |
use Doctrine\ORM\EntityRepository; | |
class FooRepository extends EntityRepository | |
implements FooRepositoryInterface | |
{ | |
public function fetchLatest() |
NewerOlder