mirror of
https://github.com/retailcrm/url-validator.git
synced 2024-11-23 05:36:07 +03:00
Add php8 support, update dependencies (#5)
* add php8 support, symfony 6 support, update dev dependencies * share matrix for code quality tools
This commit is contained in:
parent
610b1ae0b7
commit
77e2d1e5bb
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-version: ['7.3', '7.4']
|
||||
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2']
|
||||
steps:
|
||||
- name: Check out code into the workspace
|
||||
uses: actions/checkout@v2
|
||||
@ -35,4 +35,4 @@ jobs:
|
||||
- name: Run tests
|
||||
run: composer run-script phpunit-ci
|
||||
- name: Coverage
|
||||
run: bash <(curl -s https://codecov.io/bash)
|
||||
run: bash <(curl -s https://codecov.io/bash)
|
||||
|
18
.github/workflows/code_quality.yml
vendored
18
.github/workflows/code_quality.yml
vendored
@ -11,6 +11,9 @@ jobs:
|
||||
phpcs:
|
||||
name: "PHP CodeSniffer"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2']
|
||||
steps:
|
||||
- name: Check out code into the workspace
|
||||
uses: actions/checkout@v2
|
||||
@ -19,6 +22,9 @@ jobs:
|
||||
phpmd:
|
||||
name: "PHP MessDetector"
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2']
|
||||
steps:
|
||||
- name: Check out code into the workspace
|
||||
uses: actions/checkout@v2
|
||||
@ -28,15 +34,19 @@ jobs:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
level: 'warning'
|
||||
reporter: github-pr-check
|
||||
standard: './phpmd.xml'
|
||||
standard: './phpmd.xml.dist'
|
||||
target_directory: 'src'
|
||||
phpstan:
|
||||
name: PHPStan
|
||||
runs-on: ubuntu-18.04
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
php-version: ['7.3', '7.4', '8.0', '8.1', '8.2']
|
||||
steps:
|
||||
- name: Check out code into the workspace
|
||||
uses: actions/checkout@v2
|
||||
- name: Run PHPStan
|
||||
uses: docker://oskarstark/phpstan-ga:0.12.88
|
||||
uses: docker://oskarstark/phpstan-ga:1.8.0
|
||||
with:
|
||||
args: analyse src -c phpstan.neon --memory-limit=1G --no-progress
|
||||
args: analyse src -c phpstan.neon --memory-limit=1G --no-progress
|
||||
|
||||
|
@ -14,12 +14,12 @@
|
||||
"require": {
|
||||
"php": ">=7.3",
|
||||
"ext-json": "*",
|
||||
"symfony/validator": "^3 || ^4 || ^5"
|
||||
"symfony/validator": "^3 || ^4 || ^5 || ^6"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5.7",
|
||||
"squizlabs/php_codesniffer": "3.*",
|
||||
"phpstan/phpstan": "^0.12.92",
|
||||
"phpstan/phpstan": "^1.10",
|
||||
"phpmd/phpmd": "^2.10"
|
||||
},
|
||||
"support": {
|
||||
@ -40,9 +40,9 @@
|
||||
"scripts": {
|
||||
"phpunit": "./vendor/bin/phpunit -c phpunit.xml.dist --coverage-text",
|
||||
"phpunit-ci": "@php -dpcov.enabled=1 -dpcov.directory=. -dpcov.exclude=\"~vendor~\" ./vendor/bin/phpunit --teamcity -c phpunit.xml.dist",
|
||||
"phpmd": "./vendor/bin/phpmd src text ./phpmd.xml",
|
||||
"phpcs": "./vendor/bin/phpcs -p src --runtime-set testVersion 7.3-8.0 && ./vendor/bin/phpcs -p tests --runtime-set testVersion 7.3-8.0 --warning-severity=0",
|
||||
"phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon src --memory-limit=-1",
|
||||
"phpmd": "./vendor/bin/phpmd src text ./phpmd.xml.dist",
|
||||
"phpcs": "./vendor/bin/phpcs -p --standard=phpcs.xml.dist --runtime-set testVersion 7.3-8.2 --warning-severity=0",
|
||||
"phpstan": "./vendor/bin/phpstan analyse -c phpstan.neon",
|
||||
"verify": [
|
||||
"@phpcs",
|
||||
"@phpmd",
|
||||
|
@ -5,43 +5,43 @@
|
||||
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
|
||||
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
|
||||
<description>Ruleset</description>
|
||||
<rule ref="rulesets/controversial.xml" />
|
||||
<rule ref="rulesets/unusedcode.xml" />
|
||||
|
||||
<rule ref="rulesets/design.xml">
|
||||
<exclude name="CouplingBetweenObjects" />
|
||||
<rule ref="rulesets/controversial.xml"/>
|
||||
<rule ref="rulesets/design.xml"/>
|
||||
<rule ref="rulesets/naming.xml">
|
||||
<exclude name="ShortVariable" />
|
||||
<exclude name="LongVariable" />
|
||||
<exclude name="LongClassName" />
|
||||
<exclude name="ShortMethodName" />
|
||||
</rule>
|
||||
<rule ref="rulesets/cleancode.xml">
|
||||
<exclude name="StaticAccess" />
|
||||
<exclude name="ElseExpression" />
|
||||
</rule>
|
||||
<rule ref="rulesets/unusedcode.xml">
|
||||
<exclude name="UnusedFormalParameter" />
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml">
|
||||
<exclude name="TooManyPublicMethods" />
|
||||
<exclude name="TooManyFields" />
|
||||
</rule>
|
||||
<rule ref="rulesets/naming.xml">
|
||||
<exclude name="ShortVariable" />
|
||||
</rule>
|
||||
|
||||
<rule ref="rulesets/naming.xml/ShortVariable">
|
||||
<properties>
|
||||
<property name="minimum" value="2" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/TooManyPublicMethods">
|
||||
<rule ref="rulesets/naming.xml/LongVariable">
|
||||
<properties>
|
||||
<property name="maxmethods" value="20" />
|
||||
<property name="maximum" value="30" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/codesize.xml/TooManyFields">
|
||||
<rule ref="rulesets/naming.xml/LongClassName">
|
||||
<properties>
|
||||
<property name="maxfields" value="30" />
|
||||
<property name="maximum" value="80" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="rulesets/design.xml/CouplingBetweenObjects">
|
||||
<rule ref="rulesets/naming.xml/ShortMethodName">
|
||||
<properties>
|
||||
<property name="maximum" value="15" />
|
||||
<property name="minimum" value="2" />
|
||||
</properties>
|
||||
</rule>
|
||||
|
||||
<exclude-pattern>tests/*</exclude-pattern>
|
||||
</ruleset>
|
@ -6,3 +6,5 @@ parameters:
|
||||
paths:
|
||||
- src
|
||||
- tests
|
||||
bootstrapFiles:
|
||||
- ./vendor/autoload.php
|
||||
|
@ -19,7 +19,6 @@
|
||||
<coverage>
|
||||
<include>
|
||||
<directory>src</directory>
|
||||
<directory>dev</directory>
|
||||
</include>
|
||||
<report>
|
||||
<clover outputFile="coverage.xml"/>
|
||||
|
@ -21,19 +21,20 @@ class CrmUrlValidatorTest extends TestCase
|
||||
public function testValidateSuccess(): void
|
||||
{
|
||||
$validCrms = [
|
||||
'https://asd.retailcrm.ru',
|
||||
'https://test.retailcrm.pro',
|
||||
'https://raisa.retailcrm.es',
|
||||
'https://blabla.simla.com',
|
||||
'https://blabla.simlachat.com',
|
||||
'https://blabla.simlachat.ru',
|
||||
'https://blabla.ecomlogic.com',
|
||||
'https://retailcrm.tvoydom.ru',
|
||||
'https://retailcrm.inventive.ru',
|
||||
'https://crm.baucenter.ru',
|
||||
'https://crm.holodilnik.ru',
|
||||
'https://crm.eco.lanit.ru',
|
||||
'https://ecom.inventive.ru',
|
||||
'https://retailcrm.tvoydom.ru',
|
||||
'https://test.retailcrm.ru',
|
||||
'https://test.retailcrm.pro',
|
||||
'https://test.retailcrm.es',
|
||||
'https://test.simla.com',
|
||||
'https://test.simlachat.com',
|
||||
'https://test.ecomlogic.com',
|
||||
'https://test.retailcrm.io',
|
||||
'https://test.simla.io'
|
||||
];
|
||||
|
||||
$translator = new class () implements TranslatorInterface, LocaleAwareInterface {
|
||||
|
Loading…
Reference in New Issue
Block a user