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 | |
use Aws\Common\Aws; | |
const AWS_ACCESS_KEY = ''; | |
const AWS_SECRET_KEY = ''; | |
const AWS_REGION = 'us-east-1'; | |
const S3_BUCKET = ''; | |
const EB_APPLICATION_NAME = ''; |
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
class UserInputFilterFactory implements FactoryInterface | |
{ | |
public function createService(ServiceLocatorInterface $service) | |
{ | |
$factory = // Get from SL; | |
$inputCollection = new InputCollection('user'); | |
$input = $factory->createInput([ | |
'name' => 'foo', | |
'validators' => [] |
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 MyInputFilter extends InputFilter | |
{ | |
public function __construct() | |
{ | |
$this->add(['name' => 'example', 'required' => false]); | |
$this->add(['name' => 'foo', 'required' => false]); | |
$this->add(['name' => 'bar', 'required' => false]); | |
} |
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
class UserService | |
{ | |
public function __construct(ObjectManager $manager, UserRepository $repo, EmailService $email, PaymentService $payment, SmsService $sms) | |
{ | |
// | |
} | |
public function register(User $user) | |
{ | |
$manager->persist($user); |
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 | |
// ListenerAggregateInterface would change, and it would have... a static method (yeah yeah): | |
class UserListenerAggregate implements ListenerAggregateInterface | |
{ | |
static function getListenersConfiguration() | |
{ | |
// This would be a standardized configuration | |
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
class UnderscoreNamingStrategy implements NamingStrategyInterface | |
{ | |
/** | |
* {@inheritDoc} | |
*/ | |
public function getNameForExtraction($name, $context = null) | |
{ | |
return ltrim(strtolower(preg_replace('/[A-Z]/', '_$0', $name)), '_'); | |
} |
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 | |
$routes = []; | |
if ($_SERVER['ENV'] === 'production') { | |
$routes = [ | |
'base-connect' => ['hostname' => 'connect.mysite.com', 'secure' => true] | |
]; | |
} else { | |
$routes = [ |
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 | |
public function getValidationGroupSpecification() | |
{ | |
if ($this->authorizationService->hasRole('admin')) { | |
$fields[] = 'password'; | |
} | |
return [ | |
'put' => ['first_name', 'last_name'] + $fields, |
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
'use strict'; | |
/** | |
* Basic form | |
*/ | |
module.exports = App.ValidatableFormComponent = Ember.Component.extend({ | |
/** | |
* @type {String} | |
*/ | |
tagName: 'form', |