Skip to content

Commit

Permalink
Merge pull request #18 from ConductionNL/analysis-3wo3lr
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
ginokok1996 authored Oct 26, 2020
2 parents 9f75c74 + 10ae3bf commit f1120a5
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 40 deletions.
34 changes: 17 additions & 17 deletions api/config/bundles.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
<?php

return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Conduction\CommonGroundBundle\CommonGroundBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true],
Tbbc\MoneyBundle\TbbcMoneyBundle::class => ['all' => true],
Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true],
Endroid\QrCodeBundle\EndroidQrCodeBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Conduction\LandkitBundle\LandkitBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\MercureBundle\MercureBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
ApiPlatform\Core\Bridge\Symfony\Bundle\ApiPlatformBundle::class => ['all' => true],
Nelmio\CorsBundle\NelmioCorsBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
Conduction\CommonGroundBundle\CommonGroundBundle::class => ['all' => true],
Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true],
Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true],
Tbbc\MoneyBundle\TbbcMoneyBundle::class => ['all' => true],
Knp\Bundle\MarkdownBundle\KnpMarkdownBundle::class => ['all' => true],
Endroid\QrCodeBundle\EndroidQrCodeBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Conduction\LandkitBundle\LandkitBundle::class => ['all' => true],
];
24 changes: 9 additions & 15 deletions api/src/Controller/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Conduction\CommonGroundBundle\Service\ApplicationService;
//use App\Service\RequestService;
use Conduction\CommonGroundBundle\Service\CommonGroundService;
use function GuzzleHttp\Promise\all;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
Expand Down Expand Up @@ -40,7 +39,6 @@ public function generalAction(Session $session, Request $request, CommonGroundSe
if (count($users) > 0) {
$user = $users[0];


$userGroups = [];
foreach ($user['userGroups'] as $userGroup) {
if ($userGroup['id'] != 'c3c463b9-8d39-4cc0-b62c-826d8f5b7d8c') {
Expand Down Expand Up @@ -124,7 +122,6 @@ public function organizationsAction(Session $session, Request $request, CommonGr
$variables = [];

if ($request->isMethod('POST')) {

$name = $request->get('name');
$email = $request->get('email');
$description = $request->get('description');
Expand Down Expand Up @@ -164,33 +161,31 @@ public function organizationsAction(Session $session, Request $request, CommonGr

$group = $commonGroundService->createResource($userGroup, ['component' => 'uc', 'type' => 'groups']);

$users = $commonGroundService->getResourceList(['component' => 'uc', 'type' => 'users'],['username' => $this->getUser()->getUsername()])['hydra:member'];
if (count($users) > 0 ) {
$users = $commonGroundService->getResourceList(['component' => 'uc', 'type' => 'users'], ['username' => $this->getUser()->getUsername()])['hydra:member'];
if (count($users) > 0) {
$organizations = [];
$user = $users[0];

$userGroups = [];
foreach ($user['userGroups'] as $userGroup) {
array_push($userGroups, '/groups/'.$userGroup['id']);
array_push($userGroups, '/groups/'.$userGroup['id']);
}

$user['userGroups'] = $userGroups;
$user['userGroups'][] = '/groups/'.$group['id'];

$commonGroundService->updateResource($user);

}

}

if ($this->getUser()){
$users = $commonGroundService->getResourceList(['component' => 'uc', 'type' => 'users'],['username' => $this->getUser()->getUsername()])['hydra:member'];
if (count($users) > 0 ) {
if ($this->getUser()) {
$users = $commonGroundService->getResourceList(['component' => 'uc', 'type' => 'users'], ['username' => $this->getUser()->getUsername()])['hydra:member'];
if (count($users) > 0) {
$organizations = [];
$user = $users[0];
foreach ($user['userGroups'] as $group){
$organization =$commonGroundService->getResource($group['organization']);
if (!in_array($organization, $organizations)){
foreach ($user['userGroups'] as $group) {
$organization = $commonGroundService->getResource($group['organization']);
if (!in_array($organization, $organizations)) {
$organizations[] = $organization;
}
}
Expand All @@ -210,7 +205,6 @@ public function organizationAction(Session $session, Request $request, CommonGro
$variables = [];

if ($request->isMethod('POST')) {

}

return $variables;
Expand Down
3 changes: 0 additions & 3 deletions api/src/Controller/DefaultController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
use Conduction\CommonGroundBundle\Service\ApplicationService;
//use App\Service\RequestService;
use Conduction\CommonGroundBundle\Service\CommonGroundService;
use function GuzzleHttp\Promise\all;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
Expand Down Expand Up @@ -123,5 +121,4 @@ public function pricingAction(Session $session, Request $request, CommonGroundSe

return $variables;
}

}
3 changes: 0 additions & 3 deletions api/src/Controller/DocumentationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
use Conduction\CommonGroundBundle\Service\ApplicationService;
//use App\Service\RequestService;
use Conduction\CommonGroundBundle\Service\CommonGroundService;
use function GuzzleHttp\Promise\all;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
Expand Down Expand Up @@ -57,5 +55,4 @@ public function exampleAction(Session $session, Request $request, CommonGroundSe

return $variables;
}

}
4 changes: 2 additions & 2 deletions api/src/Controller/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Class UserController.
*
* @Route("/user")
* @Route("/user")
*/
class UserController extends AbstractController
{
Expand Down Expand Up @@ -66,10 +66,10 @@ public function login(

if ($this->getUser()) {
$this->flash->add('success', 'Welcome '.$this->getUser()->getName());

return $this->redirect($this->generateUrl('app_default_index'));
} else {
return $this->redirect($this->generateUrl('app_default_index'));

}
}

Expand Down

0 comments on commit f1120a5

Please sign in to comment.