Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
php-compat
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
lib
unicaen
php-compat
Commits
85d8d6b5
Commit
85d8d6b5
authored
Mar 18, 2019
by
Bertrand Gauthier
Browse files
Options
Downloads
Patches
Plain Diff
Ajout de l'analyse des sources de l'application (répertoire module).
parent
b468fdc6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.phan/config-appli.php
+109
-0
109 additions, 0 deletions
.phan/config-appli.php
bin/unicaen-php-compat-run-phan
+14
-0
14 additions, 0 deletions
bin/unicaen-php-compat-run-phan
bin/unicaen-php-compat-run-phpcs
+15
-0
15 additions, 0 deletions
bin/unicaen-php-compat-run-phpcs
with
138 additions
and
0 deletions
.phan/config-appli.php
0 → 100644
+
109
−
0
View file @
85d8d6b5
<?php
/**
*
* Config PHAN pour analyser les sources d'une application (répertoire ./module).
*
*/
/**
* This configuration will be read and overlaid on top of the
* default configuration. Command line arguments will be applied
* after this file is read.
*/
return
[
// Supported values: `'5.6'`, `'7.0'`, `'7.1'`, `'7.2'`, `'7.3'`, `null`.
// If this is set to `null`,
// then Phan assumes the PHP version which is closest to the minor version
// of the php executable used to execute Phan.
//
// Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist.
// (See `backward_compatibility_checks` for additional options)
// TODO: Set this.
'target_php_version'
=>
null
,
// Backwards Compatibility Checking. This is very slow
// and expensive, but you should consider running
// it before upgrading your version of PHP from 5.x to 7.0,
// due to the backward compatibility breaks of parsing in PHP 7.0
'backward_compatibility_checks'
=>
true
,
// Added in 0.10.0. Set this to false to emit
// PhanUndeclaredFunction issues for internal functions
// that Phan has signatures for,
// but aren't available in the codebase or the
// internal functions used to run phan
'ignore_undeclared_functions_with_known_signatures'
=>
false
,
// If empty, no filter against issues types will be applied.
// If this white-list is non-empty, only issues within the list
// will be emitted by Phan.
'whitelist_issue_types'
=>
[
'PhanDeprecatedFunctionInternal'
,
// Warns about a few functions deprecated in 7.0 and later.
'PhanUndeclaredFunction'
,
// Check for removed functions such as split() that were deprecated in php 5.x and removed in php 7.0.
'PhanCompatibleExpressionPHP7'
,
'PhanCompatibleKeyedArrayAssignPHP70'
,
'PhanCompatibleNullableTypePHP70'
,
'PhanCompatiblePHP7'
,
// This only checks for **syntax** where the parsing may have changed. This check is enabled by `backward_compatibility_checks`
'PhanCompatibleShortArrayAssignPHP70'
,
'PhanCompatibleUseIterablePHP71'
,
'PhanCompatibleUseObjectPHP71'
,
'PhanCompatibleUseObjectPHP71'
,
'PhanCompatibleUseVoidPHP70'
,
'PhanCompatibleVoidTypePHP70'
,
// 'PhanDeprecatedClass',
// 'PhanDeprecatedFunction',
// 'PhanDeprecatedInterface',
// 'PhanDeprecatedTrait',
'PhanParamSignatureMismatch'
,
// 'PhanParamSignatureRealMismatchHasParamType',
// 'PhanParamSignatureRealMismatchParamType',
'PhanParamSignatureRealMismatchTooFewParameters'
,
'PhanParamSignatureRealMismatchTooFewParametersInternal'
,
'PhanParamTooFew'
,
// 'PhanParamTooMany',
// 'PhanParamTooManyInternal',
// 'PhanSyntaxError',
// 'PhanTypeMismatchArgument',
// 'PhanTypeMismatchArgumentInternal',
// 'PhanTypeMismatchDeclaredParam',
// 'PhanTypeMismatchDeclaredParamNullable',
// 'PhanTypeMismatchDefault',
// 'PhanTypeMismatchForeach',
// 'PhanTypeMismatchProperty',
// 'PhanTypeMismatchReturn',
// 'PhanTypeMissingReturn',
// 'PhanUndeclaredClassInstanceof',
// 'PhanUnreferencedUseNormal',
'PhanContinueTargetingSwitch'
,
// This detects code causing a warning in PHP 7.3.
],
// A list of directories that should be parsed for class and
// method information. After excluding the directories
// defined in exclude_analysis_directory_list, the remaining
// files will be statically analyzed for errors.
//
// Thus, both first-party and third-party code being used by
// your application should be included in this list.
'directory_list'
=>
[
'module'
,
'vendor'
,
],
// A directory list that defines files that will be excluded
// from static analysis, but whose class and method
// information should be included.
//
// Generally, you'll want to include the directories for
// third-party code (such as "vendor/") in this list.
//
// n.b.: If you'd like to parse but not analyze 3rd
// party code, directories containing that code
// should be added to both the `directory_list`
// and `exclude_analysis_directory_list` arrays.
'exclude_analysis_directory_list'
=>
[
'vendor'
,
],
];
This diff is collapsed.
Click to expand it.
bin/unicaen-php-compat-run-phan
+
14
−
0
View file @
85d8d6b5
...
...
@@ -9,6 +9,7 @@ v=$1
imagename
=
"unicaen-php-compat-
${
v
}
"
containername
=
${
imagename
}
-container
applilogfile
=
"/tmp/unicaen-php-compat-phan-appli-
${
v
}
.log"
unicaenlogfile
=
"/tmp/unicaen-php-compat-phan-unicaen-
${
v
}
.log"
vendorslogfile
=
"/tmp/unicaen-php-compat-phan-vendors-
${
v
}
.log"
...
...
@@ -27,6 +28,19 @@ docker exec ${containername} composer update --no-suggest --no-scripts
[[
$?
!=
0
]]
&&
echo
"Erreur bloquante, ciao."
&&
exit
1
echo
echo
"==================================================================================="
echo
" Analyse PHAN de l'application"
echo
" (cf. vendor/unicaen/php-compat/.phan/config-appli.php)"
echo
"==================================================================================="
docker
exec
\
${
containername
}
\
vendor/phan/phan/phan
\
--config-file
.phan/config-appli.php
\
--target-php-version
${
v
}
\
>
${
applilogfile
}
echo
"See '
${
applilogfile
}
'."
echo
echo
"==================================================================================="
echo
" Analyse PHAN des modules unicaen/* installés"
...
...
This diff is collapsed.
Click to expand it.
bin/unicaen-php-compat-run-phpcs
+
15
−
0
View file @
85d8d6b5
...
...
@@ -15,6 +15,7 @@ vendors="vendor/doctrine vendor/zendframework vendor/zf-commons"
imagename
=
"unicaen-php-compat-
${
v
}
"
containername
=
${
imagename
}
-container
applilogfile
=
"/tmp/unicaen-php-compat-phpcs-appli-
${
v
}
.log"
unicaenlogfile
=
"/tmp/unicaen-php-compat-phpcs-unicaen-
${
v
}
.log"
vendorslogfile
=
"/tmp/unicaen-php-compat-phpcs-vendors-
${
v
}
.log"
...
...
@@ -33,6 +34,20 @@ docker exec ${containername} composer update --no-suggest
[[
$?
!=
0
]]
&&
echo
"Erreur bloquante, ciao."
&&
exit
1
echo
echo
"==================================================================================="
echo
" Analyse PHPCS de l'application (répertoire ./module)"
echo
"==================================================================================="
docker
exec
\
${
containername
}
\
vendor/bin/phpcs
\
-n
\
--standard
=
PHPCompatibility
\
--runtime-set
php_version
${
PHP_VERSION_ID
}
\
module
\
>
${
applilogfile
}
echo
"See '
${
applilogfile
}
'."
echo
echo
"==================================================================================="
echo
" Analyse PHPCS des modules unicaen/* installés"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment