back to php 7.2 - remove CI environment

This commit is contained in:
Andy Green 2021-04-11 11:56:55 +03:00
parent fb2b2ab527
commit e22d5889b0
11 changed files with 0 additions and 272 deletions

View File

@ -1,59 +0,0 @@
<?php
$finder = PhpCsFixer\Finder::create()
->files()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests');
return PhpCsFixer\Config::create()
->setFinder($finder)
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'align_multiline_comment' => true,
'array_syntax' => ['syntax' => 'short'],
'blank_line_after_opening_tag' => true,
'cast_spaces' => true,
'class_attributes_separation' => ['elements' => ['method']],
'global_namespace_import' => [
'import_classes' => true,
'import_constants' => true,
'import_functions' => true,
],
'linebreak_after_opening_tag' => true,
'lowercase_cast' => true,
'lowercase_static_reference' => true,
'method_chaining_indentation' => true,
'modernize_types_casting' => true,
'multiline_comment_opening_closing' => true,
'multiline_whitespace_before_semicolons' => true,
'native_function_casing' => true,
'no_alternative_syntax' => true,
'no_extra_blank_lines' => true,
'no_leading_import_slash' => true,
'no_mixed_echo_print' => ['use' => 'print'],
'no_short_bool_cast' => true,
'no_singleline_whitespace_before_semicolons' => true,
'no_spaces_around_offset' => true,
'no_trailing_comma_in_list_call' => true,
'no_trailing_comma_in_singleline_array' => true,
'no_unneeded_control_parentheses' => true,
'no_unused_imports' => true,
'no_useless_return' => true,
'no_whitespace_before_comma_in_array' => true,
'no_whitespace_in_blank_line' => true,
'normalize_index_brace' => true,
'nullable_type_declaration_for_default_null_value' => true,
'ordered_imports' => [
'sort_algorithm' => 'alpha'
],
'ordered_interfaces' => [
'direction' => 'ascend',
'order' => 'alpha',
],
'single_quote' => true,
'space_after_semicolon' => true,
'standardize_not_equals' => true,
'ternary_operator_spaces' => true,
'ternary_to_null_coalescing' => true
]);

View File

@ -1,12 +0,0 @@
language: php
php:
- "7.3"
- "7.4"
before_script:
- phpenv config-add docker/php/xdebug.ini
- composer selfupdate
- composer install --prefer-source
script:
- vendor/bin/phpunit

View File

@ -1,27 +0,0 @@
version: '3.7'
services:
# PHPUnit and Composer
php:
build:
context: .
dockerfile: ./docker/php/Dockerfile
volumes:
- .:/usr/local/src/wellrested
# Documentation generator
docs:
build:
context: .
dockerfile: ./docker/docs/Dockerfile
volumes:
- .:/usr/local/src/wellrested
# Local development site
nginx:
image: nginx:1.15
ports:
- ${PORT:-8080}:80
volumes:
- .:/usr/local/src/wellrested
- ./docker/nginx/site.conf:/etc/nginx/conf.d/default.conf

View File

@ -1,7 +0,0 @@
FROM python:3-jessie
RUN pip install sphinx sphinx_rtd_theme
WORKDIR /usr/local/src/wellrested
CMD ["make", "html", "-C", "docs"]

View File

@ -1,36 +0,0 @@
server {
listen 80;
root /usr/local/src/wellrested/public;
index index.php index.html;
charset utf-8;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
# Front Controller
location / {
try_files $uri $uri/ /index.php?$args;
}
# Generated Code Coverage Report
location /coverage {
alias /usr/local/src/wellrested/coverage;
}
# Generated Documentation
location /docs {
alias /usr/local/src/wellrested/docs/build/html;
}
# PHP
location ~ \.php$ {
include fastcgi_params;
fastcgi_pass php:9000;
fastcgi_index index.php;
fastcgi_buffers 8 8k;
fastcgi_buffer_size 16k;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param SCRIPT_NAME index.php;
}
}

View File

@ -1,47 +0,0 @@
FROM php:7.3-fpm
RUN DEBIAN_FRONTEND=noninteractive \
apt-get update && \
apt-get -y install \
gettext \
libssl-dev \
unzip \
wget \
zip \
&& rm -rf /var/lib/apt/lists/*
# Xdebug
RUN pecl install xdebug \
&& docker-php-ext-enable xdebug
# Install Composer.
RUN curl -sS https://getcomposer.org/installer | php -- \
--filename=composer --install-dir=/usr/local/bin
# Install dumb-init.
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64
RUN chmod +x /usr/local/bin/dumb-init
# Create a directory for project sources and user's home directory
RUN mkdir /usr/local/src/wellrested && \
chown -R www-data:www-data /usr/local/src/wellrested && \
chown -R www-data:www-data /var/www
# Copy XDebug config file
COPY ./docker/php/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
# Copy entrypoint script
COPY docker/php/entrypoint /usr/local/bin
# Add symlinks for php-cs-fixer, phpunit, and psalm for easier running
RUN ln -s /usr/local/src/wellrested/vendor/bin/php-cs-fixer /usr/local/bin/php-cs-fixer
RUN ln -s /usr/local/src/wellrested/vendor/bin/phpunit /usr/local/bin/phpunit
RUN ln -s /usr/local/src/wellrested/vendor/bin/psalm /usr/local/bin/psalm
ENTRYPOINT ["entrypoint"]
CMD ["php-fpm"]
WORKDIR /usr/local/src/wellrested
USER www-data

View File

@ -1,10 +0,0 @@
#!/usr/bin/env bash
# Run CLI commands with dumb-init to allow better signal handling.
# Run PHP-FPM as PID 1.
# https://engineeringblog.yelp.com/2016/01/dumb-init-an-init-for-docker.html
if [ "$1" == 'php-fpm' ] ; then
exec php-fpm
else
exec dumb-init -- "$@"
fi

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
EXPECTED_SIGNATURE=$(wget https://composer.github.io/installer.sig -O - -q)
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]; then
>&2 echo 'ERROR: Invalid installer signature'
rm composer-setup.php
exit 1
fi
php composer-setup.php --quiet --filename=composer --install-dir=/usr/local/bin
RESULT=$?
rm composer-setup.php
exit $RESULT

View File

@ -1,4 +0,0 @@
[xdebug]
xdebug.mode=coverage,debug
xdebug.client_host=host.docker.internal
xdebug.client_port=9000

View File

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
verbose="true"
>
<testsuites>
<testsuite name="unit">
<directory>./tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html" target="./coverage" />
</logging>
</phpunit>

View File

@ -1,29 +0,0 @@
<?xml version="1.0"?>
<psalm
errorLevel="2"
resolveFromConfigFile="true"
allowStringToStandInForClass="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>
<issueHandlers>
<DocblockTypeContradiction>
<errorLevel type="suppress">
<file name="src/Message/ServerRequest.php" />
<file name="src/Message/Uri.php" />
</errorLevel>
</DocblockTypeContradiction>
<MissingClosureParamType>
<errorLevel type="suppress">
<file name="src/Message/Message.php" />
</errorLevel>
</MissingClosureParamType>
</issueHandlers>
</psalm>