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
{# what is the proper way to escape var in url path in html in twig? #} | |
{# method A #} | |
<a href="/foo/{{ bar }}">Link</a> | |
{# method B #} | |
<a href="/foo/{{ bar|e('url') }}">Link</a> | |
{# method C #} |
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 Foo\Bar\Application\UseCase; | |
use Foo\Bar\Application\AuthorizationChecker; | |
use Foo\Bar\Domain\ItemRepository; | |
class ViewItemUseCase | |
{ | |
/** |
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 Order | |
{ | |
public $user1; | |
public $user2; | |
} |
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 AppBundle\Security; | |
use Symfony\Component\Security\Http\Authentication\DefaultAuthenticationSuccessHandler; | |
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; | |
use Symfony\Component\HttpFoundation\Request; | |
use Doctrine\Common\Persistence\ObjectManager; | |
use AppBundle\Entity\User; | |
use AppBundle\Entity\UserHasLoggedIn; |
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 | |
public function testInterval() | |
{ | |
$date = new DateTime('+1 month'); | |
$date->add(\DateInterval::createFromDateString('3 months')); | |
// Tested on 2016-08-31 | |
// Failed asserting that two DateTime objects are equal. |
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 | |
// warstwa aplikacji – tutaj udostępniamy co aplikacja może zrobić | |
namespace CalculatorCompany\CalculatorProject\Application; | |
class AddNumbersUseCase | |
{ | |
public function handle($firstNumber, $secondNumber) | |
{ | |
$result = $this->calculator->add($firstNumber, $secondNumber); |
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
.PostSummary__header > h1 > a:visited, /* articles feed */ | |
article[itemtype="http://schema.org/blogPost"] a:visited, /* article content */ | |
.entry-content a:visited { /* comments */ | |
color: #76B; /* kinda violet, feel free to change it */ | |
} |
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 BasicStuff | |
{ | |
public function foo() | |
{ | |
/* does basic stuff */ | |
} | |
} |
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 | |
$client = new GuzzleHttp\Client(); | |
$response = $client->request('POST', 'http://localhost:8000/hello/world', [ | |
'form_params' => [ | |
'name' => 'Norbert', | |
], | |
'timeout' => 30, | |
]); |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<script async src="test.js"></script> | |
<script> | |
helloFromTestJs('ok'); | |
</script> | |
</body> | |
</html> |