Commit 301660b4 by Mathieu Poisbeau

Merge branch 'dev' into 'master'

Merge dev to fix #469

See merge request cooperatic/kohinos!2
parents 5f25845b c3b15b73
<?xml version="1.0"?>
<ruleset name="Kohinos Coding Standards">
<description>A custom set of code standard rules to check the Kohinos project.</description>
<!--
#############################################################################
COMMAND LINE ARGUMENTS
https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml
#############################################################################
-->
<!-- Pass some flags to PHPCS:
p flag: Show progress of the run.
s flag: Show sniff codes in all reports.
-->
<arg value="ps"/>
<!-- Strip the filepaths down to the relevant bit. -->
<arg name="basepath" value="./"/>
<!-- Check up to 8 files simultaneously. -->
<arg name="parallel" value="8"/>
<!-- Check all files in this directory and the directories below it. -->
<file>.</file>
<!-- Exclude patterns. -->
<exclude-pattern>/vendor/*</exclude-pattern>
<exclude-pattern>/node_modules/*</exclude-pattern>
<!--
#############################################################################
USE THE PSR12 RULESET
#############################################################################
-->
<rule ref="PSR12"/>
<!--
#############################################################################
SNIFF SPECIFIC CONFIGURATION
#############################################################################
-->
<!--
#############################################################################
USE THE PHPCompatibility RULESET
#############################################################################
-->
<config name="testVersion" value="7.4-"/>
<rule ref="PHPCompatibilityWP"/>
</ruleset>
...@@ -38,11 +38,18 @@ class TransfertPrestataireComptoir extends Transfert ...@@ -38,11 +38,18 @@ class TransfertPrestataireComptoir extends Transfert
$this->getDestinataire()->addCompte($this->getMontant()); $this->getDestinataire()->addCompte($this->getMontant());
$this->getDestinataire()->getGroupe()->getSiege()->removeCompteNantie($this->getMontant()); $this->getDestinataire()->getGroupe()->getSiege()->removeCompteNantie($this->getMontant());
return [$this->getExpediteur(), $this->getDestinataire()]; return [
$this->getExpediteur(),
$this->getDestinataire(),
$this->getDestinataire()->getGroupe()->getSiege(), // fix #469: do not forget to persist the 'Siege' entity
];
} }
public function getUsersToNotify() public function getUsersToNotify()
{ {
return array_merge($this->getDestinataire()->getGestionnaires()->toArray(), $this->getExpediteur()->getUsers()->toArray()); return array_merge(
$this->getDestinataire()->getGestionnaires()->toArray(),
$this->getExpediteur()->getUsers()->toArray()
);
} }
} }
<?php <?php
namespace App\Listener; namespace App\Listener;
use App\Entity\Flux; use App\Entity\Flux;
use Doctrine\Common\EventSubscriber; use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Event\OnFlushEventArgs; use Doctrine\ORM\Event\OnFlushEventArgs;
use Doctrine\ORM\Events; use Doctrine\ORM\Events;
use Symfony\Component\Security\Core\Security;
class FluxListener implements EventSubscriber class FluxListener implements EventSubscriber
{ {
private $em;
private $security;
public function __construct(EntityManagerInterface $em, Security $security)
{
$this->em = $em;
$this->security = $security;
}
public function getSubscribedEvents() public function getSubscribedEvents()
{ {
return array(Events::onFlush); return array(Events::onFlush);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment