Skip to content
Snippets Groups Projects
Commit 4c38b791 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

wip reprise ne main et simplification : partie phan

parent b54a641d
No related tags found
No related merge requests found
Pipeline #34855 failed
phan/
......@@ -42,16 +42,16 @@ return [
'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',
// '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',
......
......@@ -33,50 +33,50 @@ return [
// 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.
],
// // 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
......@@ -86,8 +86,7 @@ return [
// Thus, both first-party and third-party code being used by
// your application should be included in this list.
'directory_list' => [
'vendor',
'vendor/unicaen',
'vendor/unicaen'
],
// A directory list that defines files that will be excluded
......@@ -102,39 +101,64 @@ return [
// should be added to both the `directory_list`
// and `exclude_analysis_directory_list` arrays.
'exclude_analysis_directory_list' => [
'vendor/apereo',
'vendor/aws',
'vendor/beberlei',
'vendor/bin',
'vendor/brick',
'vendor/bshaffer',
'vendor/cboden',
'vendor/composer',
'vendor/container-interop',
'vendor/dealerdirect',
'vendor/devizzent',
'vendor/doctrine',
'vendor/easybook',
'vendor/evenement',
'vendor/fakerphp',
'vendor/felixfbecker',
'vendor/jasig',
'vendor/friendsofphp',
'vendor/guzzlehttp',
'vendor/icecave',
'vendor/justinrainbow',
'vendor/laminas',
'vendor/laminas-api-tools',
'vendor/league',
'vendor/marc-mabe',
'vendor/masterminds',
'vendor/michelf',
'vendor/microsoft',
'vendor/monolog',
'vendor/mpdf',
'vendor/mtdowling',
'vendor/myclabs',
'vendor/netresearch',
'vendor/nikic',
'vendor/paragonie',
'vendor/phan',
'vendor/phar-io',
'vendor/phpcompatibility',
'vendor/phpdocumentor',
'vendor/phpspec',
'vendor/phpstan',
'vendor/phpunit',
'vendor/psr',
'vendor/ralouphie',
'vendor/ramsey',
'vendor/ratchet',
'vendor/react',
'vendor/respect',
'vendor/riverline',
'vendor/sabre',
'vendor/sebastian',
'vendor/setasign',
'vendor/slevomat',
'vendor/squizlabs',
'vendor/symfony',
'vendor/true',
'vendor/theseer',
'vendor/twig',
'vendor/tysonandre',
// 'vendor/unicaen',
'vendor/webimpress',
'vendor/webmozart',
'vendor/zendframework',
'vendor/zf-commons',
'vendor/unicaen/code/code/template',
'vendor/unicaen/bjy-authorize/tests',
],
];
......@@ -42,16 +42,16 @@ return [
'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',
// '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',
......
ARG PHP_VERSION
FROM unicaen-dev-php${PHP_VERSION}-apache
FROM phanphp/phan
LABEL maintainer="Bertrand GAUTHIER <bertrand.gauthier at unicaen.fr>"
ARG PHP_VERSION
#COPY --from=composer/composer:2-bin /composer /usr/bin/composer
ADD . /app
RUN #pecl install ast \
# && docker-php-ext-enable ast
ENV APACHE_CONF_DIR=/etc/apache2
ENV PHP_CONF_DIR=/etc/php/${PHP_VERSION}
RUN pecl install ast && \
echo "extension=ast.so" > ${PHP_CONF_DIR}/cli/conf.d/ast.ini
# PHAN n'aime pas xdebug
RUN phpdismod xdebug
# Nettoyage
RUN apt-get autoremove -y && apt-get clean && rm -rf /tmp/* /var/tmp/*
WORKDIR /app
#RUN apt-get update -y && \
# apt-get install -y git
#!/usr/bin/env bash
[[ -z $1 ]] && echo "Veuillez spécifier la version de PHP désirée (ex: 7.2)." && exit 1
[[ -z $1 ]] && echo "Veuillez spécifier la version de PHP désirée (ex: 8.2)." && exit 1
DIR=$(cd `dirname $0` && pwd)
APP_DIR=$(realpath ${DIR}/../../../..)
PHAN_CONFIG_DIR=$(realpath ${DIR}/../.phan)
echo "Répertoire de l'application : $APP_DIR"
echo
v=$1
imagename="unicaen-php-compat-${v}"
containername=${imagename}-container
#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"
vendorlogfile="/tmp/unicaen-php-compat-phan-vendors-${v}.log"
echo "==================================================================================="
echo " Construction de l'image ${imagename}"
echo "==================================================================================="
docker-compose -f vendor/unicaen/php-compat/docker-compose.yml up -d --build ${imagename}
#echo "==================================================================================="
#echo " Construction de l'image ${imagename}"
#echo "==================================================================================="
#docker compose -f vendor/unicaen/php-compat/docker-compose.yml build ${imagename}
#
#[[ $? != 0 ]] && echo "Erreur bloquante, ciao." && exit 1
[[ $? != 0 ]] && echo "Erreur bloquante, ciao." && exit 1
#echo "Attente que ${containername} soit crée et prêt..."
#timeout 60s bash -c "until docker exec ${containername} pg_isready --host=localhost ; do sleep 5 ; done"
#[[ $? -ne 0 ]] && docker container logs ${containername} && echo 'Trop long, abandon !' && exit 1
echo
echo "==================================================================================="
echo " Composer update dans le container ${containername}"
echo "==================================================================================="
docker exec ${containername} composer update --no-suggest --no-scripts
#echo
#echo "==================================================================================="
#echo " Composer update dans le container ${containername}"
#echo "==================================================================================="
#docker run ${imagename} composer update --no-suggest --no-scripts
#
#[[ $? != 0 ]] && echo "Erreur bloquante, ciao." && exit 1
[[ $? != 0 ]] && echo "Erreur bloquante, ciao." && exit 1
#phan() { docker run -v $APP_DIR:/mnt/src --rm -u "$(id -u):$(id -g)" phanphp/phan:latest $@; return $?; }
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 de l'application"
#echo " (cf. $PHAN_CONFIG_DIR/config-appli.php)"
#echo "==================================================================================="
#docker run --rm -u "$(id -u):$(id -g)" -v $APP_DIR:/mnt/src -v $PHAN_CONFIG_DIR:/tmp \
# phanphp/phan:latest --config-file /tmp/config-appli.php --target-php-version ${v} \
#> ${applilogfile}
#echo "=> ${applilogfile}"
echo
echo "==================================================================================="
echo " Analyse PHAN des modules unicaen/* installés"
echo " (cf. vendor/unicaen/php-compat/.phan/config-unicaen.php)"
echo " (cf. $PHAN_CONFIG_DIR/config-unicaen.php)"
echo "==================================================================================="
docker exec \
${containername} \
vendor/phan/phan/phan \
--config-file .phan/config-unicaen.php \
--target-php-version ${v} \
docker run --rm -u "$(id -u):$(id -g)" -v $APP_DIR:/mnt/src -v $PHAN_CONFIG_DIR:/tmp \
phanphp/phan:latest --config-file /tmp/config-unicaen.php --target-php-version ${v} --debug \
> ${unicaenlogfile}
echo "See '${unicaenlogfile}'."
echo "=> ${unicaenlogfile}"
echo
echo "==================================================================================="
echo " Analyse PHAN des principaux vendors installés"
echo " (cf. vendor/unicaen/php-compat/.phan/config-vendor.php)"
echo "==================================================================================="
docker exec \
${containername} \
vendor/phan/phan/phan \
--config-file .phan/config-vendor.php \
--target-php-version ${v} \
> ${vendorslogfile}
echo "See '${vendorslogfile}'."
#echo
#echo "==================================================================================="
#echo " Analyse PHAN des principaux vendors installés"
#echo " (cf. $PHAN_CONFIG_DIR/config-vendor.php)"
#echo "==================================================================================="
#docker run --rm -u "$(id -u):$(id -g)" -v $APP_DIR:/mnt/src -v $PHAN_CONFIG_DIR:/tmp \
# phanphp/phan:latest --config-file /tmp/config-vendor.php --target-php-version ${v} \
#> ${vendorlogfile}
#echo "=> ${vendorlogfile}"
echo
version: '2'
services:
unicaen-php-compat-7.0:
image: unicaen-php-compat-7.0
unicaen-php-compat-8.0:
image: unicaen-php-compat-8.0
build:
dockerfile: vendor/unicaen/php-compat/Dockerfile
args:
PHP_VERSION: 7.0
PHP_VERSION: 8.0
context: ../../.. # remonte jusqu'à l'appli
container_name: unicaen-php-compat-7.0-container
container_name: unicaen-php-compat-8.0-container
volumes:
- ${PWD}/vendor/unicaen/php-compat/.phan:/app/.phan
working_dir: /app
unicaen-php-compat-7.1:
image: unicaen-php-compat-7.1
unicaen-php-compat-8.1:
image: unicaen-php-compat-8.1
build:
dockerfile: vendor/unicaen/php-compat/Dockerfile
args:
PHP_VERSION: 7.1
PHP_VERSION: 8.1
context: ../../.. # remonte jusqu'à l'appli
container_name: unicaen-php-compat-7.1-container
container_name: unicaen-php-compat-8.1-container
volumes:
- ${PWD}/vendor/unicaen/php-compat/.phan:/app/.phan
working_dir: /app
unicaen-php-compat-7.2:
image: unicaen-php-compat-7.2
unicaen-php-compat-8.2:
image: unicaen-php-compat-8.2
build:
dockerfile: vendor/unicaen/php-compat/Dockerfile
args:
PHP_VERSION: 7.2
PHP_VERSION: 8.2
context: ../../.. # remonte jusqu'à l'appli
container_name: unicaen-php-compat-7.2-container
container_name: unicaen-php-compat-8.2-container
volumes:
- ${PWD}/vendor/unicaen/php-compat/.phan:/app/.phan
working_dir: /app
unicaen-php-compat-7.3:
image: unicaen-php-compat-7.3
unicaen-php-compat-8.3:
image: unicaen-php-compat-8.3
build:
dockerfile: vendor/unicaen/php-compat/Dockerfile
args:
PHP_VERSION: 7.3
PHP_VERSION: 8.3
context: ../../.. # remonte jusqu'à l'appli
container_name: unicaen-php-compat-7.3-container
container_name: unicaen-php-compat-8.3-container
volumes:
- ${PWD}/vendor/unicaen/php-compat/.phan:/app/.phan
working_dir: /app
unicaen-php-compat-8.4:
image: unicaen-php-compat-8.4
build:
dockerfile: vendor/unicaen/php-compat/Dockerfile
args:
PHP_VERSION: 8.4
context: ../../.. # remonte jusqu'à l'appli
container_name: unicaen-php-compat-8.4-container
volumes:
- ${PWD}/vendor/unicaen/php-compat/.phan:/app/.phan
working_dir: /app
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment