Skip to content

Commit

Permalink
use only no-dev deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Vitexus committed Nov 27, 2024
1 parent 99541f9 commit eb1140a
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 3 deletions.
165 changes: 165 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
<?php

declare(strict_types=1);

/**
* phpunit-skeleton-generator
*
* Copyright (c) 2012-2014, Sebastian Bergmann <[email protected]>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* Neither the name of Sebastian Bergmann nor the names of his
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
* *
* @author Sebastian Bergmann <[email protected]>
* @copyright 2012-2014 Sebastian Bergmann <[email protected]>
* @license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
* @since File available since Release 2.0.0
*/

use Ergebnis\PhpCsFixer\Config\Factory;
use Ergebnis\PhpCsFixer\Config\Rules;
use Ergebnis\PhpCsFixer\Config\RuleSet\Php74;

$header = <<<'HEADER'
phpunit-skeleton-generator
Copyright (c) 2012-2014, Sebastian Bergmann <[email protected]>.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
Neither the name of Sebastian Bergmann nor the names of his
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*
@author Sebastian Bergmann <[email protected]>
@copyright 2012-2014 Sebastian Bergmann <[email protected]>
@license http://www.opensource.org/licenses/BSD-3-Clause The BSD 3-Clause License
@since File available since Release 2.0.0
HEADER;

$ruleSet = Php74::create()->withHeader($header)->withRules(Rules::fromArray([
'blank_line_before_statement' => [
'statements' => [
'break',
'continue',
'declare',
'default',
'do',
'exit',
'for',
'foreach',
'goto',
'if',
'include',
'include_once',
'require',
'require_once',
'return',
'switch',
'throw',
'try',
'while',
],
],
'concat_space' => [
'spacing' => 'none',
],
'date_time_immutable' => false,
'error_suppression' => false,
'final_class' => false,
'mb_str_functions' => false,
'native_function_invocation' => [
'exclude' => [
'sprintf',
],
'include' => [
'@compiler_optimized',
],
'scope' => 'all',
'strict' => false,
],
'php_unit_internal_class' => false,
'php_unit_test_annotation' => [
'style' => 'prefix',
],
'php_unit_test_class_requires_covers' => false,
'return_to_yield_from' => false,
'phpdoc_array_type' => false,
'phpdoc_list_type' => false,
'attribute_empty_parentheses' => false,
'final_public_method_for_abstract_class' => false,
'class_attributes_separation' => [
'elements' => [
'const' => 'only_if_meta',
'property' => 'only_if_meta',
'trait_import' => 'none',
'case' => 'none',
],
],
'yoda_style' => false,
'php_unit_test_case_static_method_calls' => false,
]));

$config = Factory::fromRuleSet($ruleSet);

$config->getFinder()
->append([
__DIR__.'/.php-cs-fixer.dist.php',
])
->in('src')
->in('tests');

$config->setCacheFile(__DIR__.'/.build/php-cs-fixer/.php-cs-fixer.cache');

return $config;
5 changes: 2 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/make -f

export DH_VERBOSE = 1
export DH_VERBOSE=1
export COMPOSER_NO_DEV=1

%:
dh $@
Expand All @@ -17,5 +18,3 @@ override_dh_prep:
override_dh_install:
dh_install
mv debian/phpunit-skelgen/usr/bin/phpunit-skeleton-generator.phar debian/phpunit-skelgen/usr/bin/phpunit-skelgen


2 changes: 2 additions & 0 deletions phpstan-default-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
ignoreErrors:
9 changes: 9 additions & 0 deletions phpstan-default.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
includes:
- phpstan-default-baseline.neon

parameters:
inferPrivatePropertyTypeFromConstructor: true
level: 6
paths:
- src
- tests

0 comments on commit eb1140a

Please sign in to comment.