This file contains hidden or 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 | |
// ... | |
$c->loadFromExtension( | |
'security', | |
[ | |
'providers' => [ | |
'legacy' => [ | |
'id' => 'app.legacy_user_provider' | |
] | |
], |
This file contains hidden or 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 | |
// ... | |
/** | |
* Map legacy roles to symfony roles. Legacy roles are in following format: | |
* ['moderator' => '1'] | |
*/ | |
private function mapRoles() | |
{ | |
if (empty($this->legacyRoles)) { |
This file contains hidden or 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\Framework\Security; | |
use Acme\Authentication\AuthenticationSessionInterface; | |
use Acme\Authentication\User; | |
use Acme\Authentication\UserManagerInterface; | |
use Symfony\Component\HttpFoundation\RedirectResponse; | |
use Symfony\Component\HttpFoundation\Request; | |
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; |
This file contains hidden or 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\Framework\Security; | |
use Acme\Authentication\User; | |
use Symfony\Component\Security\Core\Exception\UnsupportedUserException; | |
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; | |
use Symfony\Component\Security\Core\User\UserInterface; | |
use Symfony\Component\Security\Core\User\UserProviderInterface; |
This file contains hidden or 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\Authentication; | |
use Acme\Avatar\AvatarInterface; | |
use Symfony\Component\Security\Core\User\UserInterface; | |
class User implements UserInterface | |
{ | |
// ... |
This file contains hidden or 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\Listener; | |
use Acme\Language\LanguageInterface; | |
use Acme\Language\LanguageSessionInterface; | |
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | |
final class LanguageListener | |
{ |
This file contains hidden or 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; | |
use application\App; | |
use Symfony\Bundle\FrameworkBundle\FrameworkBundle; | |
use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; | |
use Symfony\Bundle\SecurityBundle\SecurityBundle; | |
use Symfony\Bundle\TwigBundle\TwigBundle; | |
use Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle; |
This file contains hidden or 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 | |
// Composer autoloader | |
$loader = require __DIR__ . '/../vendor/autoload.php'; | |
// Legacy config which includes legacy autoloader stuff | |
require_once __DIR__ . '/../html/config.php'; | |
// Legacy bootstrapping code wrapped in a class implementing HttpKernelInterface to make it stackable | |
require __DIR__ . '/../html/Bootstrap.php'; |
This file contains hidden or 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 | |
$input = <<<INPUT | |
()()(()()()(()()((()((()))((()((((()()((((()))()((((())(((((((()(((((((((()(((())(()()(()((()()(()(())(()((((()((()()()((((())((((((()(()(((()())(()((((()))())(())(()(()()))))))))((((((((((((()())()())())(())))(((()()()((((()(((()(()(()()(()(()()(()(((((((())(())(())())))((()())()((((()()((()))(((()()()())))(())))((((())(((()())(())(()))(()((((()())))())((()(())(((()((((()((()(())())))((()))()()(()(()))))((((((((()())((((()()((((()(()())(((((()(()())()))())(((()))()(()(()(()((((()(())(()))(((((()()(()()()(()(((())())(((()()(()()))(((()()(((())())(()(())())()()(())()()()((()(((()(())((()()((())()))((()()))((()()())((((()(()()(()(((()))()(()))))((()(((()()()))(()(((())()(()((()())(()(()()(()())(())()(((()(()())()((((()((()))))())()))((()()()()(())()())()()()((((()))))(()(((()()(((((((())()))()((((()((())()(()())(())()))(()(()())(((((((())))(((()))())))))()))())((())(()()((())()())()))))()((()()())(())((())((((()())())()()()(((()))())))()()))())(()()()(()((((((()()))())()))()(((()(((())( |
This file contains hidden or 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 VowelCounter { | |
function count($string) { | |
return array_reduce(str_split($string), function($vowelCount, $str) { return $vowelCount += in_array($str, ['a', 'e', 'i', 'o', 'u']);}); | |
} | |
} | |
$vc = new VowelCounter(); | |
echo $vc->count('php uk conference'); |