From 3976ef0a24ee020252d09759fe1da6f73763d3d8 Mon Sep 17 00:00:00 2001 From: osaajani <> Date: Mon, 22 Jun 2020 18:02:33 +0200 Subject: [PATCH] Improve code style formatter + fix unused var in octopush --- adapters/OctopushVirtualNumberAdapter.php | 5 ----- tests/php-cs-fixer/php_cs.config | 4 ++++ tests/php-cs-fixer/run.php | 10 ++-------- tests/phpstan/config.neon | 6 ++++++ tests/phpstan/run.php | 5 +---- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/adapters/OctopushVirtualNumberAdapter.php b/adapters/OctopushVirtualNumberAdapter.php index 41998c6..98c9a22 100644 --- a/adapters/OctopushVirtualNumberAdapter.php +++ b/adapters/OctopushVirtualNumberAdapter.php @@ -201,11 +201,6 @@ class OctopushVirtualNumberAdapter implements AdapterInterface 'sms_type' => self::SMS_TYPE_LOWCOST, ]; - if ($this->sender !== null) - { - $datas['sms_sender'] = $this->sender; - } - $endpoint = $this->api_url . '/sms/json'; $curl = curl_init(); diff --git a/tests/php-cs-fixer/php_cs.config b/tests/php-cs-fixer/php_cs.config index 2690377..d364092 100644 --- a/tests/php-cs-fixer/php_cs.config +++ b/tests/php-cs-fixer/php_cs.config @@ -13,6 +13,10 @@ $finder = PhpCsFixer\Finder::create() ->exclude('tests/Fixtures') ->in(__DIR__) ->append([__DIR__.'/php-cs-fixer']) + ->in(__DIR__ . '/../../controllers/') + ->in(__DIR__ . '/../../models/') + ->in(__DIR__ . '/../../daemons/') + ->in(__DIR__ . '/../../adapters/') ; $config = PhpCsFixer\Config::create() diff --git a/tests/php-cs-fixer/run.php b/tests/php-cs-fixer/run.php index d2379c3..eb620d6 100644 --- a/tests/php-cs-fixer/run.php +++ b/tests/php-cs-fixer/run.php @@ -13,17 +13,11 @@ } $lint_commands = [ - 'php ' . __DIR__ . '/php-cs-fixer.phar -v --dry-run --config="' . __DIR__ . '/php_cs.config" fix ' . __DIR__ . '/../../controllers/', - 'php ' . __DIR__ . '/php-cs-fixer.phar -v --dry-run --config="' . __DIR__ . '/php_cs.config" fix ' . __DIR__ . '/../../models/', - 'php ' . __DIR__ . '/php-cs-fixer.phar -v --dry-run --config="' . __DIR__ . '/php_cs.config" fix ' . __DIR__ . '/../../daemons/', - 'php ' . __DIR__ . '/php-cs-fixer.phar -v --dry-run --config="' . __DIR__ . '/php_cs.config" fix ' . __DIR__ . '/../../adapters/', + 'php ' . __DIR__ . '/php-cs-fixer.phar -v --dry-run --config="' . __DIR__ . '/php_cs.config" fix', ]; $fix_commands = [ - 'php ' . __DIR__ . '/php-cs-fixer.phar --config="' . __DIR__ . '/php_cs.config" fix ' . __DIR__ . '/../../controllers/', - 'php ' . __DIR__ . '/php-cs-fixer.phar --config="' . __DIR__ . '/php_cs.config" fix ' . __DIR__ . '/../../models/', - 'php ' . __DIR__ . '/php-cs-fixer.phar --config="' . __DIR__ . '/php_cs.config" fix ' . __DIR__ . '/../../daemons/', - 'php ' . __DIR__ . '/php-cs-fixer.phar --config="' . __DIR__ . '/php_cs.config" fix ' . __DIR__ . '/../../adapters/', + 'php ' . __DIR__ . '/php-cs-fixer.phar --config="' . __DIR__ . '/php_cs.config" fix', ]; diff --git a/tests/phpstan/config.neon b/tests/phpstan/config.neon index a565cdb..27e0682 100644 --- a/tests/phpstan/config.neon +++ b/tests/phpstan/config.neon @@ -1,5 +1,11 @@ parameters: reportUnmatchedIgnoredErrors: false + paths: + - %rootDir%/../../controllers/ + - %rootDir%/../../models/ + - %rootDir%/../../adapters/ + - %rootDir%/../../daemons/ + ignoreErrors: - '#Constant RASPISMS_[a-zA-Z0-9\\_]+ not found.#' diff --git a/tests/phpstan/run.php b/tests/phpstan/run.php index c80afd0..6012d3e 100644 --- a/tests/phpstan/run.php +++ b/tests/phpstan/run.php @@ -11,10 +11,7 @@ } $analyse_commands = [ - 'php ' . __DIR__ . '/phpstan.phar analyse --configuration="'. __DIR__ .'/config.neon" --autoload-file=' . __DIR__ . '/../../descartes/load.php ' . __DIR__ . '/../../controllers/', - 'php ' . __DIR__ . '/phpstan.phar analyse --configuration="'. __DIR__ .'/config.neon" --autoload-file=' . __DIR__ . '/../../descartes/load.php ' . __DIR__ . '/../../models/', - 'php ' . __DIR__ . '/phpstan.phar analyse --configuration="'. __DIR__ .'/config.neon" --autoload-file=' . __DIR__ . '/../../descartes/load.php ' . __DIR__ . '/../../adapters/', - 'php ' . __DIR__ . '/phpstan.phar analyse --configuration="'. __DIR__ .'/config.neon" --autoload-file=' . __DIR__ . '/../../descartes/load.php ' . __DIR__ . '/../../daemons/', + 'php ' . __DIR__ . '/phpstan.phar analyse --configuration="'. __DIR__ .'/config.neon" --autoload-file=' . __DIR__ . '/../../descartes/load.php ', ];