Skip to content

Commit f3d3ac7

Browse files
committed
Merge remote-tracking branch 'origin/import-2024' into preprod
2 parents e6c4dc9 + 64dca55 commit f3d3ac7

11 files changed

+62
-17
lines changed

src/Campaign/Format/FormatFactory.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public function createFromCode($code)
1515
{
1616
$class = '\App\Campaign\Format\Formats\Format'.$code;
1717
if (!class_exists($class)) {
18-
throw new \InvalidArgumentException(sprintf('Code %s invalid', $code));
18+
throw new \InvalidArgumentException(\sprintf('Code %s invalid', $code));
1919
}
2020

2121
return new $class();
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace App\Campaign\Format\Formats;
6+
7+
class Format2024 extends Format2023
8+
{
9+
}

src/Enums/EnumsCollection.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function __construct(iterable $enums = [])
2121
public function getEnums($alias): EnumsInterface
2222
{
2323
if (!isset($this->enums[$alias])) {
24-
throw new \InvalidArgumentException(sprintf('Enums %s inconnu', $alias));
24+
throw new \InvalidArgumentException(\sprintf('Enums %s inconnu', $alias));
2525
}
2626

2727
return $this->enums[$alias];

src/Enums/JobTitleEnums.php

+15-8
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,24 @@ class JobTitleEnums extends AbstractEnums
1717
public const SYSADMIN = 9;
1818
public const DEVOPS = 10;
1919

20+
public const DEV_JUNIOR = 11;
21+
public const DEV_CONFIRME = 12;
22+
public const DEV_SENIOR = 13;
23+
public const DEV_EXPERT = 14;
24+
public const TECH_LEAD = 15;
25+
2026
protected array $choices = [
2127
self::DIRECTEUR => 'Directeur et Directrice, cadre dirigeant',
22-
self::RESPONSABLE_EQUIPE => "Cadre intermédiaire, responsable d'équipe",
23-
self::CHEF_PROJET => 'Chef/Cheffe de projet',
24-
self::LEAD_DEVELOPPEUR => 'Lead développeur/Lead développeuse',
28+
self::DEV_JUNIOR => 'Développeuse / Développeur Junior',
29+
self::DEV_CONFIRME => 'Développeuse / Développeur confirmé',
30+
self::DEV_SENIOR => 'Développeuse / Développeur Senior',
31+
self::DEV_EXPERT => 'Développeuse / Développeur Expert',
32+
self::TECH_LEAD => 'Tech Lead',
33+
self::RESPONSABLE_EQUIPE => "Responsable d'équipe",
34+
self::CONSULTANT => 'Consultante / Consultant',
2535
self::ARCHITECTE => 'Architecte',
26-
self::CONSULTANT => 'Consultant',
27-
self::FORMATEUR => 'Formateur/Formatrice',
28-
self::DEVELOPPEUR => 'Développeur/Développeuse',
29-
self::SYSADMIN => 'Sysadmin',
30-
self::DEVOPS => 'Devops',
36+
self::CHEF_PROJET => 'Chef/Cheffe de projet',
37+
self::FORMATEUR => 'Formatrice / Formateur',
3138
self::AUTRE => 'Autre',
3239
];
3340

src/Enums/StatusEnums.php

+4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ class StatusEnums extends AbstractEnums
1010
public const CDI = 2;
1111
public const FREELANCE = 3;
1212
public const SANS_EMPLOI = 4;
13+
public const ALTERNANCE = 5;
14+
public const FONCTIONNAIRE = 6;
1315

1416
protected array $choices = [
1517
self::CDD => 'Contrat à durée déterminée',
1618
self::CDI => 'Contrat à durée indéterminée',
1719
self::FREELANCE => 'Freelance / entreprise individuelle',
20+
self::ALTERNANCE => 'Alternance / contrat pro / apprentissage',
21+
self::FONCTIONNAIRE => 'Fonctionnaire',
1822
self::SANS_EMPLOI => 'Sans emploi',
1923
self::AUTRE => 'Autre',
2024
];

src/Filter/DepartmentFilter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ protected function getChoices()
3636
$choices[self::ALL_BUT_PARIS] = 'Tous sauf île-de-France';
3737

3838
foreach (new Departments() as $number => $label) {
39-
$choices[$number] = sprintf('%s - %s', $number, $label);
39+
$choices[$number] = \sprintf('%s - %s', $number, $label);
4040
}
4141

4242
return $choices;

src/Filter/DistrictFilter.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected function getChoices()
3131
$choices = [];
3232

3333
foreach (new Regions() as $number => $label) {
34-
$choices[$number] = sprintf('%s - %s', $number, $label->getLabel());
34+
$choices[$number] = \sprintf('%s - %s', $number, $label->getLabel());
3535
}
3636

3737
return $choices;

src/Filter/JobTitleFilter.php

+26-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,32 @@ public function buildQuery(QueryBuilder $queryBuilder, array $values = [])
4141
return;
4242
}
4343

44-
$queryBuilder->andWhere($queryBuilder->expr()->in('response.jobTitle', $values[$this->getName()]));
44+
$filterValue = $values[$this->getName()];
45+
46+
$filterValue = $this->supportOldValues($filterValue);
47+
48+
$queryBuilder->andWhere($queryBuilder->expr()->in('response.jobTitle', $filterValue));
49+
}
50+
51+
private function supportOldValues(array $values): array
52+
{
53+
$mapping = [
54+
JobTitleEnums::DEV_JUNIOR,
55+
JobTitleEnums::DEV_CONFIRME,
56+
JobTitleEnums::DEV_SENIOR,
57+
JobTitleEnums::DEV_EXPERT,
58+
];
59+
60+
$oldTitle = [
61+
JobTitleEnums::DEVELOPPEUR,
62+
JobTitleEnums::LEAD_DEVELOPPEUR,
63+
];
64+
65+
if ([] !== array_intersect($values, $mapping)) {
66+
$values = array_merge($values, $oldTitle);
67+
}
68+
69+
return $values;
4570
}
4671

4772
/**

src/Query/QueryBuilder.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct(Connection $connection)
3030
*/
3131
public function createTemporaryTable($tablename)
3232
{
33-
$sql = sprintf('CREATE TEMPORARY TABLE `%s` %s', $tablename, $this->getSQL());
33+
$sql = \sprintf('CREATE TEMPORARY TABLE `%s` %s', $tablename, $this->getSQL());
3434

3535
$this->connection->executeStatement($sql, $this->getParameters(), $this->paramTypes);
3636
}
@@ -40,7 +40,7 @@ public function createTemporaryTable($tablename)
4040
*/
4141
public function dropTemporaryTable($tablename)
4242
{
43-
$sql = sprintf('DROP TEMPORARY TABLE IF EXISTS `%s`', $tablename);
43+
$sql = \sprintf('DROP TEMPORARY TABLE IF EXISTS `%s`', $tablename);
4444

4545
$this->connection->executeStatement($sql);
4646
}

src/Report/SalaryReport.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SalaryReport extends AbstractReport
1717
public function execute()
1818
{
1919
$this->queryBuilder->select('count(distinct response.id) as nbResponse');
20-
$this->queryBuilder->addSelect(sprintf('ROUND(response.grossAnnualSalary / %s) as salarySlice', self::SLICE));
20+
$this->queryBuilder->addSelect(\sprintf('ROUND(response.grossAnnualSalary / %s) as salarySlice', self::SLICE));
2121
$this->queryBuilder->having('nbResponse >= :minResult');
2222
$this->queryBuilder->setParameter('minResult', $this->minResult);
2323
$this->queryBuilder->addGroupBy('salarySlice');

src/ReportManager.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function createBaseQueryBuilder()
134134

135135
$this->filterCollection->buildQuery($filterTableBuilder, $data);
136136

137-
$temporaryTablename = sprintf('tmp_%s', md5(serialize($data)));
137+
$temporaryTablename = \sprintf('tmp_%s', md5(serialize($data)));
138138
$filterTableBuilder->dropTemporaryTable($temporaryTablename);
139139
$filterTableBuilder->createTemporaryTable($temporaryTablename);
140140

0 commit comments

Comments
 (0)