@@ -4,6 +4,5 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Symfony\Component\HttpKernel\Bundle\Bundle; |
| 6 | 6 | |
| 7 | -class StingerSoftPlatformBundle extends Bundle |
|
| 8 | -{ |
|
| 7 | +class StingerSoftPlatformBundle extends Bundle { |
|
| 9 | 8 | } |
@@ -17,11 +17,11 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * {@inheritdoc} |
| 19 | 19 | */ |
| 20 | - public function load(array $configs, ContainerBuilder $container) { |
|
| 20 | + public function load(array $configs, ContainerBuilder $container){ |
|
| 21 | 21 | $configuration = new Configuration(); |
| 22 | 22 | $config = $this->processConfiguration($configuration, $configs); |
| 23 | 23 | |
| 24 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 24 | + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 25 | 25 | $loader->load('services.yml'); |
| 26 | 26 | } |
| 27 | 27 | } |
@@ -17,7 +17,7 @@ |
||
| 17 | 17 | /** |
| 18 | 18 | * {@inheritdoc} |
| 19 | 19 | */ |
| 20 | - public function load(array $configs, ContainerBuilder $container) { |
|
| 20 | + public function load(array $configs, ContainerBuilder $container){ |
|
| 21 | 21 | $configuration = new Configuration(); |
| 22 | 22 | $config = $this->processConfiguration($configuration, $configs); |
| 23 | 23 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * {@inheritdoc} |
| 17 | 17 | */ |
| 18 | - public function getConfigTreeBuilder() { |
|
| 18 | + public function getConfigTreeBuilder(){ |
|
| 19 | 19 | $treeBuilder = new TreeBuilder(); |
| 20 | 20 | $rootNode = $treeBuilder->root('stinger_soft_platform'); |
| 21 | 21 | |
@@ -15,7 +15,7 @@ |
||
| 15 | 15 | /** |
| 16 | 16 | * {@inheritdoc} |
| 17 | 17 | */ |
| 18 | - public function getConfigTreeBuilder() { |
|
| 18 | + public function getConfigTreeBuilder(){ |
|
| 19 | 19 | $treeBuilder = new TreeBuilder(); |
| 20 | 20 | $rootNode = $treeBuilder->root('stinger_soft_platform'); |
| 21 | 21 | |
@@ -23,13 +23,13 @@ |
||
| 23 | 23 | class TestCase extends \PHPUnit_Framework_TestCase { |
| 24 | 24 | |
| 25 | 25 | |
| 26 | - public function createContainer() { |
|
| 26 | + public function createContainer(){ |
|
| 27 | 27 | $container = new ContainerBuilder(new ParameterBag(array( |
| 28 | 28 | 'kernel.debug' => false, |
| 29 | 29 | // 'kernel.bundles' => array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\YamlBundle'), |
| 30 | 30 | 'kernel.cache_dir' => sys_get_temp_dir(), |
| 31 | 31 | 'kernel.environment' => 'test', |
| 32 | - 'kernel.root_dir' => __DIR__ . '/../../../../', // src dir |
|
| 32 | + 'kernel.root_dir' => __DIR__.'/../../../../', // src dir |
|
| 33 | 33 | ))); |
| 34 | 34 | $extension = new StingerSoftPlatformExtension(); |
| 35 | 35 | $container->registerExtension($extension); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | class TestCase extends \PHPUnit_Framework_TestCase { |
| 24 | 24 | |
| 25 | 25 | |
| 26 | - public function createContainer() { |
|
| 26 | + public function createContainer(){ |
|
| 27 | 27 | $container = new ContainerBuilder(new ParameterBag(array( |
| 28 | 28 | 'kernel.debug' => false, |
| 29 | 29 | // 'kernel.bundles' => array('YamlBundle' => 'Fixtures\Bundles\YamlBundle\YamlBundle'), |
@@ -16,10 +16,10 @@ discard block |
||
| 16 | 16 | use Doctrine\ORM\Event\LoadClassMetadataEventArgs; |
| 17 | 17 | use Doctrine\ORM\Mapping\ClassMetadataInfo; |
| 18 | 18 | |
| 19 | -class TablePrefixServiceTest extends TestCase{ |
|
| 19 | +class TablePrefixServiceTest extends TestCase { |
|
| 20 | 20 | |
| 21 | 21 | |
| 22 | - public static $assocMappingBefore = array( |
|
| 22 | + public static $assocMappingBefore = array( |
|
| 23 | 23 | 'groups' => array( |
| 24 | 24 | 'type' => ClassMetadataInfo::MANY_TO_MANY, |
| 25 | 25 | 'joinTable' => array( |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | ) |
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | - public static $assocMappingAfter = array( |
|
| 45 | + public static $assocMappingAfter = array( |
|
| 46 | 46 | 'groups' => array( |
| 47 | 47 | 'type' => ClassMetadataInfo::MANY_TO_MANY, |
| 48 | 48 | 'joinTable' => array( |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | use Doctrine\ORM\Event\LoadClassMetadataEventArgs; |
| 17 | 17 | use Doctrine\ORM\Mapping\ClassMetadataInfo; |
| 18 | 18 | |
| 19 | -class TablePrefixServiceTest extends TestCase{ |
|
| 19 | +class TablePrefixServiceTest extends TestCase { |
|
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | public static $assocMappingBefore = array( |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | class GroupTest extends TestCase { |
| 15 | 15 | |
| 16 | - public function testBasicGroupStuff() { |
|
| 16 | + public function testBasicGroupStuff(){ |
|
| 17 | 17 | $group = new Group('mygroup'); |
| 18 | 18 | |
| 19 | 19 | $this->assertEquals('mygroup', $group->getName()); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | $this->assertEmpty($group->getRoles()); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public function testGroupRoles() { |
|
| 24 | + public function testGroupRoles(){ |
|
| 25 | 25 | $group = new Group('mygroup', array('1', '2')); |
| 26 | 26 | $this->assertNotEmpty($group->getRoles()); |
| 27 | 27 | $this->assertContains('1', $group->getRoles()); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->assertEmpty($group->getRoles()); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public function testGroupUsers() { |
|
| 54 | + public function testGroupUsers(){ |
|
| 55 | 55 | $group = new Group('mygroup'); |
| 56 | 56 | |
| 57 | 57 | $this->assertEmpty($group->getUsers()); |
@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | class GroupTest extends TestCase { |
| 15 | 15 | |
| 16 | - public function testBasicGroupStuff() { |
|
| 16 | + public function testBasicGroupStuff(){ |
|
| 17 | 17 | $group = new Group('mygroup'); |
| 18 | 18 | |
| 19 | 19 | $this->assertEquals('mygroup', $group->getName()); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | $this->assertEmpty($group->getRoles()); |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public function testGroupRoles() { |
|
| 24 | + public function testGroupRoles(){ |
|
| 25 | 25 | $group = new Group('mygroup', array('1', '2')); |
| 26 | 26 | $this->assertNotEmpty($group->getRoles()); |
| 27 | 27 | $this->assertContains('1', $group->getRoles()); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | $this->assertEmpty($group->getRoles()); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | - public function testGroupUsers() { |
|
| 54 | + public function testGroupUsers(){ |
|
| 55 | 55 | $group = new Group('mygroup'); |
| 56 | 56 | |
| 57 | 57 | $this->assertEmpty($group->getUsers()); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | class UserTest extends TestCase { |
| 16 | 16 | |
| 17 | - public function testBasicUserStuff() { |
|
| 17 | + public function testBasicUserStuff(){ |
|
| 18 | 18 | $user = new User(); |
| 19 | 19 | |
| 20 | 20 | $this->assertEquals('', $user->getFirstname()); |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | class UserTest extends TestCase { |
| 16 | 16 | |
| 17 | - public function testBasicUserStuff() { |
|
| 17 | + public function testBasicUserStuff(){ |
|
| 18 | 18 | $user = new User(); |
| 19 | 19 | |
| 20 | 20 | $this->assertEquals('', $user->getFirstname()); |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | const SERVICE_ID = 'stinger_soft_platform.doctrine.table_prefix'; |
| 27 | 27 | |
| 28 | - public function getSubscribedEvents() { |
|
| 29 | - return array ( |
|
| 28 | + public function getSubscribedEvents(){ |
|
| 29 | + return array( |
|
| 30 | 30 | 'loadClassMetadata' |
| 31 | 31 | ); |
| 32 | 32 | } |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | /** |
| 35 | 35 | * @param LoadClassMetadataEventArgs $args |
| 36 | 36 | */ |
| 37 | - public function loadClassMetadata(LoadClassMetadataEventArgs $args) { |
|
| 38 | - $classMetadata = $args->getClassMetadata (); |
|
| 37 | + public function loadClassMetadata(LoadClassMetadataEventArgs $args){ |
|
| 38 | + $classMetadata = $args->getClassMetadata(); |
|
| 39 | 39 | |
| 40 | 40 | // Do not re-apply the prefix in an inheritance hierarchy. |
| 41 | - if ($classMetadata->isInheritanceTypeSingleTable() && !$classMetadata->isRootEntity()) { |
|
| 41 | + if($classMetadata->isInheritanceTypeSingleTable() && !$classMetadata->isRootEntity()){ |
|
| 42 | 42 | return; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -52,18 +52,18 @@ discard block |
||
| 52 | 52 | // } |
| 53 | 53 | $prefix = strtolower($prefix[1]).'_'; |
| 54 | 54 | |
| 55 | - $classMetadata->setPrimaryTable ( array ( |
|
| 56 | - 'name' => $prefix . $classMetadata->getTableName () |
|
| 57 | - ) ); |
|
| 55 | + $classMetadata->setPrimaryTable(array( |
|
| 56 | + 'name' => $prefix.$classMetadata->getTableName() |
|
| 57 | + )); |
|
| 58 | 58 | |
| 59 | - foreach ( $classMetadata->getAssociationMappings () as $fieldName => $mapping ) { |
|
| 60 | - if ($mapping ['type'] == ClassMetadataInfo::MANY_TO_MANY && isset ( $classMetadata->associationMappings [$fieldName] ['joinTable'] ['name'] )) { |
|
| 59 | + foreach($classMetadata->getAssociationMappings() as $fieldName => $mapping){ |
|
| 60 | + if($mapping ['type'] == ClassMetadataInfo::MANY_TO_MANY && isset ($classMetadata->associationMappings [$fieldName] ['joinTable'] ['name'])){ |
|
| 61 | 61 | if(isset ($classMetadata->associationMappings[$fieldName]['joinTable']['prefixed']) && $classMetadata->associationMappings [$fieldName] ['joinTable'] ['prefixed']){ |
| 62 | 62 | continue; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | $mappedTableName = $classMetadata->associationMappings [$fieldName] ['joinTable'] ['name']; |
| 66 | - $classMetadata->associationMappings [$fieldName] ['joinTable'] ['name'] = $prefix . $mappedTableName; |
|
| 66 | + $classMetadata->associationMappings [$fieldName] ['joinTable'] ['name'] = $prefix.$mappedTableName; |
|
| 67 | 67 | $classMetadata->associationMappings [$fieldName] ['joinTable'] ['prefixed'] = true; |
| 68 | 68 | } |
| 69 | 69 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | const SERVICE_ID = 'stinger_soft_platform.doctrine.table_prefix'; |
| 27 | 27 | |
| 28 | - public function getSubscribedEvents() { |
|
| 28 | + public function getSubscribedEvents(){ |
|
| 29 | 29 | return array ( |
| 30 | 30 | 'loadClassMetadata' |
| 31 | 31 | ); |
@@ -34,11 +34,11 @@ discard block |
||
| 34 | 34 | /** |
| 35 | 35 | * @param LoadClassMetadataEventArgs $args |
| 36 | 36 | */ |
| 37 | - public function loadClassMetadata(LoadClassMetadataEventArgs $args) { |
|
| 37 | + public function loadClassMetadata(LoadClassMetadataEventArgs $args){ |
|
| 38 | 38 | $classMetadata = $args->getClassMetadata (); |
| 39 | 39 | |
| 40 | 40 | // Do not re-apply the prefix in an inheritance hierarchy. |
| 41 | - if ($classMetadata->isInheritanceTypeSingleTable() && !$classMetadata->isRootEntity()) { |
|
| 41 | + if ($classMetadata->isInheritanceTypeSingleTable() && !$classMetadata->isRootEntity()){ |
|
| 42 | 42 | return; |
| 43 | 43 | } |
| 44 | 44 | |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | 'name' => $prefix . $classMetadata->getTableName () |
| 57 | 57 | ) ); |
| 58 | 58 | |
| 59 | - foreach ( $classMetadata->getAssociationMappings () as $fieldName => $mapping ) { |
|
| 60 | - if ($mapping ['type'] == ClassMetadataInfo::MANY_TO_MANY && isset ( $classMetadata->associationMappings [$fieldName] ['joinTable'] ['name'] )) { |
|
| 59 | + foreach ( $classMetadata->getAssociationMappings () as $fieldName => $mapping ){ |
|
| 60 | + if ($mapping ['type'] == ClassMetadataInfo::MANY_TO_MANY && isset ( $classMetadata->associationMappings [$fieldName] ['joinTable'] ['name'] )){ |
|
| 61 | 61 | if(isset ($classMetadata->associationMappings[$fieldName]['joinTable']['prefixed']) && $classMetadata->associationMappings [$fieldName] ['joinTable'] ['prefixed']){ |
| 62 | 62 | continue; |
| 63 | 63 | } |
@@ -33,19 +33,19 @@ discard block |
||
| 33 | 33 | * @param $name |
| 34 | 34 | * @param array $roles |
| 35 | 35 | */ |
| 36 | - public function __construct($name, $roles = array()) { |
|
| 36 | + public function __construct($name, $roles = array()){ |
|
| 37 | 37 | $this->users = new ArrayCollection(); |
| 38 | 38 | parent::__construct($name, $roles); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function addRoles(array $roles) { |
|
| 42 | - foreach ($roles as $role) { |
|
| 41 | + public function addRoles(array $roles){ |
|
| 42 | + foreach($roles as $role){ |
|
| 43 | 43 | $this->addRole($role); |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public function removeRoles(array $roles) { |
|
| 48 | - foreach ($roles as $role) { |
|
| 47 | + public function removeRoles(array $roles){ |
|
| 48 | + foreach($roles as $role){ |
|
| 49 | 49 | $this->removeRole($role); |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @return Group |
| 59 | 59 | */ |
| 60 | - public function addUser(User $user) { |
|
| 60 | + public function addUser(User $user){ |
|
| 61 | 61 | $this->users[] = $user; |
| 62 | 62 | |
| 63 | 63 | return $this; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | * @param User $user |
| 70 | 70 | */ |
| 71 | - public function removeUser(User $user) { |
|
| 71 | + public function removeUser(User $user){ |
|
| 72 | 72 | $this->users->removeElement($user); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return \Doctrine\Common\Collections\Collection |
| 79 | 79 | */ |
| 80 | - public function getUsers() { |
|
| 80 | + public function getUsers(){ |
|
| 81 | 81 | return $this->users; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - public function getUsersCount() { |
|
| 84 | + public function getUsersCount(){ |
|
| 85 | 85 | return $this->users->count(); |
| 86 | 86 | } |
| 87 | 87 | |
@@ -33,19 +33,19 @@ discard block |
||
| 33 | 33 | * @param $name |
| 34 | 34 | * @param array $roles |
| 35 | 35 | */ |
| 36 | - public function __construct($name, $roles = array()) { |
|
| 36 | + public function __construct($name, $roles = array()){ |
|
| 37 | 37 | $this->users = new ArrayCollection(); |
| 38 | 38 | parent::__construct($name, $roles); |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - public function addRoles(array $roles) { |
|
| 42 | - foreach ($roles as $role) { |
|
| 41 | + public function addRoles(array $roles){ |
|
| 42 | + foreach ($roles as $role){ |
|
| 43 | 43 | $this->addRole($role); |
| 44 | 44 | } |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - public function removeRoles(array $roles) { |
|
| 48 | - foreach ($roles as $role) { |
|
| 47 | + public function removeRoles(array $roles){ |
|
| 48 | + foreach ($roles as $role){ |
|
| 49 | 49 | $this->removeRole($role); |
| 50 | 50 | } |
| 51 | 51 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | * |
| 58 | 58 | * @return Group |
| 59 | 59 | */ |
| 60 | - public function addUser(User $user) { |
|
| 60 | + public function addUser(User $user){ |
|
| 61 | 61 | $this->users[] = $user; |
| 62 | 62 | |
| 63 | 63 | return $this; |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * |
| 69 | 69 | * @param User $user |
| 70 | 70 | */ |
| 71 | - public function removeUser(User $user) { |
|
| 71 | + public function removeUser(User $user){ |
|
| 72 | 72 | $this->users->removeElement($user); |
| 73 | 73 | } |
| 74 | 74 | |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return \Doctrine\Common\Collections\Collection |
| 79 | 79 | */ |
| 80 | - public function getUsers() { |
|
| 80 | + public function getUsers(){ |
|
| 81 | 81 | return $this->users; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | - public function getUsersCount() { |
|
| 84 | + public function getUsersCount(){ |
|
| 85 | 85 | return $this->users->count(); |
| 86 | 86 | } |
| 87 | 87 | |