Skip to content
Snippets Groups Projects
Commit 2be7ffda authored by Anastaszor's avatar Anastaszor
Browse files

Updated ci workflow with php7.4+

parent 22a15b7f
No related branches found
No related tags found
No related merge requests found
Pipeline #912199686 passed
......@@ -23,19 +23,6 @@ variables:
# And image files at
# https://gitlab.com/php-extended/docker-images
php-7.3:
stage: test
image: "$CI_REGISTRY/php-extended/docker-images:php-7.3-cli-dev"
except:
- tags
retry:
max: 2
when:
- runner_system_failure
- stuck_or_timeout_failure
script:
- ./runtests.sh --ci
php-7.4:
stage: test
image: "$CI_REGISTRY/php-extended/docker-images:php-7.4-cli-dev"
......
......@@ -31,12 +31,40 @@ if(!\class_exists('PhpCsFixer\Config'))
class Config {}
}
$finder = \PhpCsFixer\Finder::create()
->in(__DIR__.DIRECTORY_SEPARATOR.'src')
;
$finder = \PhpCsFixer\Finder::create();
$directories = [
'src', // libraries
'test', // tests in object libraries
'tests', // other folder for tests
];
if(is_dir(__DIR__.DIRECTORY_SEPARATOR.'models'))
{
// yii2 directory structure
$directories += ['assets', 'commands', 'config', 'mail', 'models', 'views', 'widgets'];
}
if(is_dir(__DIR__.DIRECTORY_SEPARATOR.'migrations'))
{
// symfony directory structure
$directories += ['migrations', 'translations'];
}
if(is_dir(__DIR__.DIRECTORY_SEPARATOR.'test'))
$finder->in(__DIR__.DIRECTORY_SEPARATOR.'test');
if(is_dir(__DIR__.DIRECTORY_SEPARATOR.'app'))
{
// laravel directory structure
$directories += ['app', 'database', 'routes'];
}
foreach($directories as $curDir)
{
$fullPath = __DIR__.DIRECTORY_SEPARATOR.$curDir;
if(is_dir($fullPath))
{
$finder->in($fullPath);
}
}
$composer_file = file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'composer.json');
$composer_json = json_decode($composer_file, true);
......@@ -75,7 +103,7 @@ $config = (new \PhpCsFixer\Config())
->setUsingCache(false)
->setRiskyAllowed(false)
->setRules([
// @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/3.0/doc/rules/index.rst
// @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/doc/list.rst
// Alias Rules
'array_push' => true, // risky
......@@ -381,10 +409,11 @@ $config = (new \PhpCsFixer\Config())
// Namespace Notation Rules
'blank_line_after_namespace' => true,
'clean_namespace' => true,
'no_blank_lines_before_namespace' => false, // conflicts single_blank_line_before_namespace
'no_leading_namespace_whitespace' => true,
'single_blank_line_before_namespace' => true,
'blank_lines_before_namespace' => [
'min_line_breaks' => 2,
'max_line_breaks' => 2,
],
// Naming Rules
'no_homoglyph_names' => true, // risky
......
......@@ -12,7 +12,7 @@ all classes of this library is made through their autoloader.
- Download `composer.phar` from [their website](https://getcomposer.org/download/).
- Then run the following command to install this library as dependency :
- `php composer.phar install php-extended/php-css-selector-interface ^5`
- `php composer.phar install php-extended/php-css-selector-interface ^6`
## Basic Usage
......
......@@ -23,9 +23,9 @@
"source" : "https://gitlab.com/php-extended/php-css-selector-interface"
},
"require" : {
"php" : ">=7.3",
"php-extended/php-html-interface" : "^5",
"php-extended/php-parser-interface" : "^5",
"php" : ">=7.4",
"php-extended/php-html-interface" : "^6",
"php-extended/php-parser-interface" : "^6",
"php-extended/polyfill-php80-stringable" : "^1.2",
"psr/http-message" : "^1"
},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment