Skip to content

Commit

Permalink
Merge pull request #20 from ConductionNL/analysis-vQKm1x
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
WilcoLouwerse authored Oct 26, 2020
2 parents 9c6524e + 43cddc3 commit 13a4508
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 36 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],
];
17 changes: 6 additions & 11 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 @@ -134,7 +132,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 @@ -165,17 +162,16 @@ public function organizationsAction(Session $session, Request $request, CommonGr
}

$wrc = $commonGroundService->createResource($wrc, ['component' => 'wrc', 'type' => 'organizations']);

}

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 @@ -195,7 +191,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 13a4508

Please sign in to comment.