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 | |
use PHPMentors\DomainCommons\DateTime\DateTime; | |
$date1 = new DateTime('2017-05-30'); | |
$oneMonthLater1 = $date1->addMonths(1); | |
echo $oneMonthLater1; // 2017-06-30 00:00:00 | |
$date2 = new DateTime('2017-05-31'); |
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
"検索をファイルの先頭へ循環しない | |
" set nowrapscan | |
"検索対象をハイライト | |
"ハイライトを消す場合は:noh[l] | |
set hlsearch | |
nnoremap <Esc><Esc> :nohlsearch<CR><Esc> | |
"大文字小文字の区別なし | |
"set ignorecase |
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 Okapon\Util; | |
use Symfony\Component\Filesystem\Filesystem; | |
class FileLock | |
{ | |
/** | |
* @var string |
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 Okapon; | |
class ContainerFactory | |
{ | |
/** | |
* @var \AppKernel | |
*/ | |
private static $kernel; |
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
{ | |
"autoload": { | |
"psr-4": { | |
"Okapon\\": "", | |
"Okapon\\": "tests/" | |
} | |
} | |
} | |
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
// ユーザーが所属するグループのリレーションを解決したい場合のサンプル | |
// 呼び出し側 | |
$user = $userRepository=>find($userId); | |
$groupRepository->populateGroup($user) | |
// ↑ ここでリレーションを解決する | |
// リポジトリークラス |
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 My\BlogBundle\EventListener; | |
use Symfony\Component\HttpKernel\HttpKernelInterface; | |
use Symfony\Component\HttpKernel\Event\FilterControllerEvent; | |
use My\BlogBundle\Exception\AuthException; | |
class AuthListener |
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 My\BlogBundle\EventListener; | |
use Symfony\Component\HttpKernel\HttpKernelInterface; | |
use Symfony\Component\HttpKernel\Event\FilterControllerEvent; | |
class BeforeFilterControllerListener | |
{ | |
public function onKernelController(FilterControllerEvent $event) |
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
毎回ID:PWが求めら得るのはhttpで通信してるから | |
$ git remote -v | |
origin https://github.com/symfony/symfony-docs.git (fetch) | |
origin https://github.com/symfony/symfony-docs.git (push) | |
git@ になおす | |
$ git remote set-url origin git@github.com:symfony/symfony-docs.git |