Skip to content

Commit 80ff3c9

Browse files
author
jdlabails
committed
php depend as dependency
1 parent 5145122 commit 80ff3c9

File tree

8 files changed

+67
-20
lines changed

8 files changed

+67
-20
lines changed

Controller/MainController.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace JD\PhpProjectAnalyzerBundle\Controller;
44

55
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6+
use Symfony\Component\HttpFoundation\Response;
7+
use Symfony\Component\Routing\Annotation\Route;
68

79
/**
810
* Controller de l'interface principale
@@ -11,7 +13,8 @@ class MainController extends Controller
1113
{
1214
/**
1315
* Index
14-
* @return type
16+
* @Route("/{_locale]/ppa", requirements={"_locale": "en|fr"})
17+
* @return Response
1518
*/
1619
public function indexAction()
1720
{
@@ -25,7 +28,8 @@ public function indexAction()
2528

2629
/**
2730
* Display phpinfo
28-
* @return type
31+
* @Route("/ppa/phpinfo")
32+
* @return Response
2933
*/
3034
public function phpinfoAction()
3135
{
@@ -34,7 +38,8 @@ public function phpinfoAction()
3438

3539
/**
3640
* Launch analysis
37-
* @return type
41+
* @Route("/ppa/analyze")
42+
* @return Response
3843
*/
3944
public function analyzeAction()
4045
{

Manager/ProjectAnalyzer.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use JD\PhpProjectAnalyzerBundle\Entities\Analyze;
66
use JD\PhpProjectAnalyzerBundle\Traits;
77
use Symfony\Component\Translation\DataCollectorTranslator as Translator;
8+
use Symfony\Component\Translation\TranslatorInterface;
89

910
/**
1011
* Classe basique regroupant les fonctions utilisées dans l'index
@@ -30,7 +31,7 @@ class ProjectAnalyzer
3031
* @param type $configGlobale
3132
* @param Translator $translator
3233
*/
33-
public function __construct($configGlobale, Translator $translator, $rootDir)
34+
public function __construct($configGlobale, TranslatorInterface $translator, $rootDir)
3435
{
3536
// traduction
3637
$this->translator = $translator;

Resources/_phar/pdepend.phar

-2.29 MB
Binary file not shown.

Resources/_phar/update.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#!/bin/bash
22

3-
rm pdepend.phar
4-
wget http://static.pdepend.org/php/latest/pdepend.phar
5-
63
rm phpDocumentor.phar
74
wget http://www.phpdoc.org/phpDocumentor.phar
85

@@ -22,4 +19,4 @@ rm security-checker.phar
2219
wget http://get.sensiolabs.org/security-checker.phar
2320

2421
rm atoum.phar
25-
wget https://github.com/atoum/atoum/releases/download/3.2.0/atoum.phar
22+
wget https://github.com/atoum/atoum/releases/download/3.2.0/atoum.phar

Resources/sh/cs.tpl.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
rm -f ${DIR_REPORT}/CS/*.txt
33

44
echo "Analyse code sniffer"
5-
echo "${DIR_BIN}/phpcbf --report-file=${DIR_REPORT}/CS/report.txt --extensions=php --standard=%%%standard%%% ${DIR_SRC}" > ${DIR_REPORT}/CS/cmd.txt
6-
echo "${DIR_BIN}/phpcbf --extensions=php --standard=%%%standard%%% ${DIR_SRC}" > ${DIR_REPORT}/CS/cmdManuelle.txt
7-
echo "${DIR_BIN}/phpcbf --extensions=php --standard=%%%standard%%% --no-patch ${DIR_SRC}" > ${DIR_REPORT}/CS/cmdRep.txt
5+
echo "${DIR_BIN}/phpcs --report-file=${DIR_REPORT}/CS/report.txt --extensions=php --standard=%%%standard%%% ${DIR_SRC}" > ${DIR_REPORT}/CS/cmd.txt
6+
echo "${DIR_BIN}/phpcs --extensions=php --standard=%%%standard%%% ${DIR_SRC}" > ${DIR_REPORT}/CS/cmdManuelle.txt
7+
echo "${DIR_BIN}/phpcs --extensions=php --standard=%%%standard%%% --no-patch ${DIR_SRC}" > ${DIR_REPORT}/CS/cmdRep.txt
88

9-
${DIR_BIN}/phpcbf --config-set installed_paths ${DIR_PHAR}/csStandard/
10-
${DIR_BIN}/phpcbf --report-file=${DIR_REPORT}/CS/report.txt --extensions=php --standard=%%%standard%%% ${DIR_SRC} > ${DIR_REPORT}/CS/summary.txt 2>&1
9+
${DIR_BIN}/phpcs --config-set installed_paths ${DIR_PHAR}/csStandard/
10+
${DIR_BIN}/phpcs --report-file=${DIR_REPORT}/CS/report.txt --extensions=php --standard=%%%standard%%% ${DIR_SRC} > ${DIR_REPORT}/CS/summary.txt 2>&1

Resources/sh/depend.tpl.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
rm -f ${DIR_REPORT}/DEPEND/*.txt
33

44
echo "Calcul de metriques par PhpDepend"
5-
echo "php ${DIR_PHAR}/pdepend.phar --summary-xml=${DIR_REPORT}/DEPEND/summary.xml --jdepend-chart=${DIR_REPORT}/DEPEND/jdepend.svg --overview-pyramid=${DIR_REPORT}/DEPEND/pyramid.svg ${DIR_SRC}" > ${DIR_REPORT}/DEPEND/cmd.txt
6-
echo "php ${DIR_PHAR}/pdepend.phar ${DIR_SRC}" > ${DIR_REPORT}/DEPEND/cmdManuelle.txt
5+
echo "${DIR_BIN}/pdepend --summary-xml=${DIR_REPORT}/DEPEND/summary.xml --jdepend-chart=${DIR_REPORT}/DEPEND/jdepend.svg --overview-pyramid=${DIR_REPORT}/DEPEND/pyramid.svg ${DIR_SRC}" > ${DIR_REPORT}/DEPEND/cmd.txt
6+
echo "${DIR_BIN}/pdepend ${DIR_SRC}" > ${DIR_REPORT}/DEPEND/cmdManuelle.txt
77

8-
php ${DIR_PHAR}/pdepend.phar --summary-xml=${DIR_REPORT}/DEPEND/summary.xml --jdepend-chart=${DIR_REPORT}/DEPEND/jdepend.svg --overview-pyramid=${DIR_REPORT}/DEPEND/pyramid.svg ${DIR_SRC} > ${DIR_REPORT}/DEPEND/report.txt 2>&1
8+
${DIR_BIN}/pdepend --summary-xml=${DIR_REPORT}/DEPEND/summary.xml --jdepend-chart=${DIR_REPORT}/DEPEND/jdepend.svg --overview-pyramid=${DIR_REPORT}/DEPEND/pyramid.svg ${DIR_SRC} > ${DIR_REPORT}/DEPEND/report.txt 2>&1

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"sebastian/phpcpd": "^2.0.0",
2323
"phploc/phploc": "^4.0.0",
2424
"symfony/phpunit-bridge": "^3.3",
25-
"squizlabs/php_codesniffer": "3.*"
25+
"squizlabs/php_codesniffer": "*"
2626
},
2727
"scripts": {
2828
"post-install-cmd": [
@@ -46,5 +46,8 @@
4646
},
4747
"config": {
4848
"bin-dir": "bin/"
49+
},
50+
"require-dev": {
51+
"pdepend/pdepend": "^2.5"
4952
}
5053
}

composer.lock

Lines changed: 44 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)