Skip to content
This repository has been archived by the owner on Jul 23, 2021. It is now read-only.

Commit

Permalink
Updated configuration (task #8244)
Browse files Browse the repository at this point in the history
Synchronized configuration files with project-template-cakephp.
  • Loading branch information
mamchenkov committed Oct 29, 2018
1 parent 39ede78 commit 6fa236c
Show file tree
Hide file tree
Showing 8 changed files with 167 additions and 47 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Expand Up @@ -16,3 +16,6 @@ end_of_line = crlf
[*.yml]
indent_style = space
indent_size = 2

[*.twig]
insert_final_newline = false
52 changes: 52 additions & 0 deletions .gitattributes
@@ -0,0 +1,52 @@
# Define the line ending behavior of the different file extensions
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto
* text eol=lf

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
.htaccess text
*.css text diff=css
*.ctp text diff=php
*.default text
*.html text diff=html
*.ini text
*.js text
*.md text
*.php text diff=php
*.po text
*.properties text
*.sql text
*.svg text
*.txt text
*.xml text
*.yml text

# Declare files that will always have CRLF line endings on checkout.
*.bat eol=crlf

# Declare files that will always have LF line endings on checkout.
*.pem eol=lf

# Denote all files that are truly binary and should not be modified.
composer binary
*.png binary
*.jpg binary
*.gif binary
*.ico binary
*.mo binary
*.pdf binary
*.phar binary

# Web fonts are binary
*.otf binary
*.eot binary
*.ttf binary
*.woff binary
*.woff2 binary

# Treat zip files as binary
*.7z binary
*.bz2 binary
*.gz binary
*.zip binary
36 changes: 36 additions & 0 deletions .gitignore
@@ -1,5 +1,41 @@
# Project specific files #
##########################
build/
vendor/
cghooks.lock

composer.lock
config/Migrations/schema-dump-default.lock
config/Migrations/schema-dump-test.lock
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
Icon?
ehthumbs.db
Thumbs.db

# Tool specific files #
#######################
# vim
*~
*.swp
*.swo
# sublime text & textmate
*.sublime-*
*.stTheme.cache
*.tmlanguage.cache
*.tmPreferences.cache
# Eclipse
.settings/*
# JetBrains, aka PHPStorm, IntelliJ IDEA
.idea/*
# NetBeans
nbproject/*
# Visual Studio Code
.vscode
# Sass preprocessor
.sass-cache/
5 changes: 3 additions & 2 deletions .stickler.yml
@@ -1,6 +1,7 @@
linters:
phpcs:
standard: CakePHP
extensions: '.php,.ctp'
extensions: 'php,ctp'
exclude: 'Generic.Commenting.Todo'
files:
ignore: ['config/*', 'tests/*']
ignore: ['webroot/plugins/*']
33 changes: 21 additions & 12 deletions .travis.yml
@@ -1,13 +1,8 @@
#This Travis config template file was taken from https://github.com/FriendsOfCake/travis
sudo: true
dist: trusty

language: php

php:
- 7.1
- 7.2
- nightly
dist: trusty

sudo: false

cache:
directories:
Expand All @@ -21,25 +16,39 @@ env:

matrix:
fast_finish: true

allow_failures:
- php: 7.3
- php: nightly

include:
- php: 7.1
env: PHPCS=1 COVERAGE=1 PHPSTAN=0
- php: 7.2
env: PHPCS=1 COVERAGE=0 PHPSTAN=0
- php: 7.3
env: PHPCS=1 COVERAGE=0 PHPSTAN=0
- php: nightly
env: PHPCS=1 COVERAGE=0 PHPSTAN=0

install:
- composer validate --strict
- composer install --no-interaction --no-progress --no-suggest
- mkdir -p build/logs
- mkdir -p build/test-coverage build/test-results

before_script:
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'CREATE DATABASE IF NOT EXISTS cakephp_test DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;'; fi"

script:
- vendor/bin/phpcs
- if [ $TRAVIS_PHP_VERSION != "7.1" ]; then vendor/bin/phpunit --no-coverage; else vendor/bin/phpunit; fi
- if [[ $PHPCS = 1 ]]; then ./vendor/bin/phpcs; fi
- if [[ $COVERAGE = 0 ]]; then ./vendor/bin/phpunit --no-coverage; fi
- if [[ $COVERAGE = 1 ]]; then ./vendor/bin/phpunit; fi
- if [[ $PHPSTAN = 1 ]]; then ./vendor/bin/phpstan analyse; fi

after_success:
- curl -s https://codecov.io/bash > /tmp/codecov.sh
- chmod +x /tmp/codecov.sh
- /tmp/codecov.sh -s build/logs
- /tmp/codecov.sh -s build/test-results

notifications:
email:
Expand Down
14 changes: 10 additions & 4 deletions phpcs.xml.dist
Expand Up @@ -9,17 +9,16 @@
<description>PHP CodeSniffer Configuration</description>

<!-- Coding standard to use -->
<rule ref="./vendor/cakephp/cakephp-codesniffer/CakePHP" />
<rule ref="./vendor/cakephp/cakephp-codesniffer/CakePHP">
<exclude name="Generic.Commenting.Todo" />
</rule>

<!-- Do not fail on warnings -->
<config name="ignore_warnings_on_exit" value="1" />

<!-- Assume UTF-8 -->
<config name="encoding" value="UTF-8" />

<!-- Extensions to check -->
<arg name="extensions" value="php,inc,ctp,js,css" />

<!-- Use colors -->
<arg name="colors" />

Expand All @@ -29,5 +28,12 @@
<!-- Files and directories to check -->
<file>./src/</file>
<file>./tests/</file>
<file>./config/</file>
<file>./webroot/</file>

<!-- Ignore files -->
<arg name="ignore" value="config/Migrations/" />

<!-- Ignore minified files -->
<exclude-pattern>*\.min\.(css|js)</exclude-pattern>
</ruleset>
14 changes: 14 additions & 0 deletions phpstan.neon.dist
@@ -0,0 +1,14 @@
parameters:
level: 7
paths:
- src
- tests
- webroot
autoload_files:
- tests/bootstrap.php
earlyTerminatingMethodCalls:
Cake\Console\Shell:
- abort
includes:
- vendor/thecodingmachine/phpstan-strict-rules/phpstan-strict-rules.neon
- vendor/timeweb/phpstan-enum/extension.neon
57 changes: 28 additions & 29 deletions phpunit.xml.dist
@@ -1,32 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
colors="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false"
bootstrap="./tests/bootstrap.php"
colors="true"
processIsolation="false"
stopOnFailure="false"
bootstrap="./tests/bootstrap.php"
verbose="true"
>
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>

<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
<directory suffix=".php">./webroot/</directory>
</whitelist>
</filter>
>
<php>
<ini name="memory_limit" value="-1"/>
<ini name="apc.enable_cli" value="1"/>
</php>

<logging>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
<log type="coverage-html" target="build/coverage"/>
<log type="coverage-clover" target="build/logs/clover.xml"/>
<log type="coverage-crap4j" target="build/logs/crap4j.xml"/>
<log type="junit" target="build/logs/junit.xml"/>
<log type="coverage-text" target="php://stdout" showUncoveredFiles="true"/>
<log type="coverage-html" target="build/test-coverage"/>
<log type="coverage-clover" target="build/test-results/clover.xml"/>
<log type="coverage-crap4j" target="build/test-results/crap4j.xml"/>
<log type="junit" target="build/test-results/junit.xml"/>
</logging>

<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="plugin">
<directory>tests/TestCase</directory>
</testsuite>
</testsuites>

<!-- Setup a listener for fixtures -->
<listeners>
<listener
Expand All @@ -38,11 +37,11 @@
</listener>
</listeners>

<!-- Add any additional test suites you want to run here -->
<testsuites>
<testsuite name="Plugin Test Suite">
<directory>./tests/TestCase</directory>
</testsuite>
</testsuites>

<!-- Ignore vendor tests in code coverage reports -->
<filter>
<whitelist>
<directory suffix=".php">./src/</directory>
<directory suffix=".php">./webroot/</directory>
</whitelist>
</filter>
</phpunit>

0 comments on commit 6fa236c

Please sign in to comment.