Skip to content

Commit

Permalink
Merge pull request #75 from WebProject-xyz/develop
Browse files Browse the repository at this point in the history
Next Release
  • Loading branch information
Fahl-Design authored Aug 6, 2021
2 parents 21c1cd9 + 117a61f commit 30900c9
Show file tree
Hide file tree
Showing 74 changed files with 6,483 additions and 1,138 deletions.
8 changes: 5 additions & 3 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ checks:
threshold: 250
method-complexity:
config:
threshold: 5
threshold: 10
method-count:
config:
threshold: 20
method-lines:
config:
threshold: 25
threshold: 40
nested-control-flow:
config:
threshold: 4
Expand Down Expand Up @@ -52,11 +52,13 @@ plugins:
enabled: false
PSR1 Files SideEffects FoundWithSymbols:
enabled: false
Generic Files LineLength TooLong:
enabled: false
sonar-php:
enabled: true
config:
tests_patterns:
- test/unit/**
- tests/Unit/**
duplication:
enabled: true

Expand Down
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: composer
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
48 changes: 48 additions & 0 deletions .github/workflows/cocdeception.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
on: [push, pull_request]
name: Cocdeception

jobs:
codeception-tests:
name: "Codeception tests"
runs-on: "ubuntu-20.04"
continue-on-error: ${{ matrix.allow-fail }}
strategy:
matrix:
include:
# - { php-version: 7.4, dependencies: locked, coverage: none, with_coverage: "", allow-fail: false }
- { php-version: 7.4, dependencies: highest, coverage: none, with_coverage: "", allow-fail: true }
- { php-version: 8.0, dependencies: locked, coverage: none, with_coverage: "", allow-fail: false }
- { php-version: 8.0, dependencies: highest, coverage: none, with_coverage: "", allow-fail: true }
- { php-version: 8.0, dependencies: locked, coverage: xdebug, with_coverage: "yes", allow-fail: false }
# - { php-version: 8.1, dependencies: highest, coverage: none, with_coverage: "", allow-fail: true }

steps:
- name: "Checkout code"
uses: "actions/checkout@v2"

- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "${{ matrix.coverage }}"
ini-values: display_errors=On, display_startup_errors=On, error_reporting=32767
php-version: "${{ matrix.php-version }}"

- name: "Install dependencies with Composer"
uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run Codeception"
env:
WITH_COVERAGE: "${{ matrix.with_coverage }}"
run: |
if [ -z "$WITH_COVERAGE" ]; then
vendor/bin/codecept run -c . -vvv --json
fi
- name: "Run Codeception with coverage"
env:
WITH_COVERAGE: "${{ matrix.with_coverage }}"
run: |
if [ ! -z "$WITH_COVERAGE" ]; then
vendor/bin/codecept run -c . -vvv --json --coverage --coverage-xml
fi
12 changes: 12 additions & 0 deletions .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
on: [push, pull_request]
name: PHP-CS-Fixer
jobs:
php-cs-fixer:
name: PHP-CS-Fixer
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php-cs-fixer.php --diff --dry-run -vv
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ crashlytics-build.properties
fabric.properties


/.php_cs.cache
.php_cs.cache
.php-cs-fixer.cache
/tests/_data/example.php
coverage/*
!coverage/.gitkeep
composer.lock
composer.phar
65 changes: 65 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php
declare(strict_types=1);

$header = <<<'EOF'
HEADER
EOF;

$finder = \PhpCsFixer\Finder::create()
->files()
->in(__DIR__ . '/src')
->in(__DIR__ . '/tests')
->append([__FILE__])
->name('*.php');

$rules = [
// start symfony set
'@Symfony' => true,
'binary_operator_spaces' => [
'default' => 'align',
'operators' => [
'??' => 'single_space',
],
],
'concat_space' => ['spacing' => 'one'],
'@PhpCsFixer:risky' => true,
'encoding' => true,
'single_blank_line_before_namespace' => true,
'blank_line_after_opening_tag' => false,
'strict_param' => true,
'no_useless_else' => true,
'no_useless_return' => true,
'modernize_types_casting' => true,
'declare_strict_types' => true,
'dir_constant' => true,
'no_whitespace_in_blank_line' => true,

'@Symfony:risky' => true,
'@PHPUnit75Migration:risky' => true,
'php_unit_dedicate_assert' => ['target' => 'newest'],
'php_unit_test_case_static_method_calls' => ['call_type' => 'this'],
'fopen_flags' => false,
'combine_nested_dirname' => true,

'ordered_imports' => [
'sort_algorithm' => 'alpha',
'imports_order' => [
'const', 'class', 'function',
],
],

'global_namespace_import' => [
'import_classes' => true,
'import_functions' => true,
'import_constants' => true,
],
];

$config = new \PhpCsFixer\Config('default');
$config->setRules($rules);
$config->setRiskyAllowed(true);
$config->setUsingCache(true);
$config->setLineEnding("\n");
$config->setFinder($finder);

return $config;
105 changes: 0 additions & 105 deletions .php_cs

This file was deleted.

1 change: 0 additions & 1 deletion .phpbrewrc

This file was deleted.

10 changes: 3 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ env:
matrix:
fast_finish: true
include:
- php: 7.3
env: EXECUTE_CS_CHECK=true RUN_WITH_COVERAGE=true PATH="$HOME/.local/bin:$PATH"
- php: 7.3
- php: 7.4
- php: nightly
allow_failures:
- php: 7.4
- php: nightly
env: EXECUTE_CS_CHECK=true XDEBUG_MODE=coverage RUN_WITH_COVERAGE=true PATH="$HOME/.local/bin:$PATH"
- php: 8.0
env: EXECUTE_CS_CHECK=true XDEBUG_MODE=coverage RUN_WITH_COVERAGE=true PATH="$HOME/.local/bin:$PATH"

before_install:
- ./build/script/travis_before_install.sh
Expand Down
20 changes: 8 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"description": "PHP library to control ikea tradfri hub",
"prefer-stable": true,
"license": "MIT",
"version": "0.2.0",
"authors": [
{
"name": "Benjamin Fahl",
Expand All @@ -17,20 +16,17 @@
"optimize-autoloader": true
},
"require": {
"php": "^7.4",
"php": "^7.4 || ^8.0",
"ext-json": "*",
"doctrine/collections": "1.6.*",
"symfony/messenger": "^5.1"
"doctrine/collections": "^1"
},
"require-dev": {
"codeception/codeception": "^4",
"codeception/module-asserts": "1.*",
"mockery/mockery": "1.*",
"friendsofphp/php-cs-fixer": "2.*",
"codeclimate/php-test-reporter": "0.*",
"codacy/coverage": "1.*",
"monolog/monolog": "2.*",
"roave/security-advisories": "dev-master",
"codeception/module-asserts": "^1",
"mockery/mockery": "^1",
"friendsofphp/php-cs-fixer": "^3.0",
"monolog/monolog": "^2",
"roave/security-advisories": "dev-latest",
"symfony/var-dumper": "^5.1"
},
"autoload": {
Expand All @@ -40,7 +36,7 @@
},
"autoload-dev": {
"psr-4": {
"IKEA\\Tests\\": "tests/unit/IKEA"
"IKEA\\Tests\\Unit\\": "tests/Unit/"
}
},
"scripts": {
Expand Down
Loading

0 comments on commit 30900c9

Please sign in to comment.