Skip to content
This repository has been archived by the owner on Mar 1, 2023. It is now read-only.

Fixed emoji output - cannot declare class because of require_once #119

Merged
merged 10 commits into from
Aug 11, 2019
27 changes: 14 additions & 13 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
* text=auto
*.php text eol=lf

tests/ export-ignore
build export-ignore
.github export-ignore
tests/ export-ignore
build/ export-ignore
.github/ export-ignore

.php_cs export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
.editorconfig export-ignore
codecov.yml export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
CONTRIBUTING.md export-ignore
README.md export-ignore
.php_cs export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.travis.yml export-ignore
.editorconfig export-ignore
codecov.yml export-ignore
phpstan.neon export-ignore
phpunit.xml.dist export-ignore
infection.json.dist export-ignore
CONTRIBUTING.md export-ignore
README.md export-ignore
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ composer.lock

.php_cs.cache
.phpunit.result.cache
infectionlog.json
infectionlog.txt

/build/logs
/vendor
2 changes: 2 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ $config = new Config(null, [
],
],
'comment_to_phpdoc' => false,
'final_class' => false,
'PhpCsFixerCustomFixers/no_commented_out_code' => false,
]);
$config->getFinder()
->files()
Expand Down
5 changes: 0 additions & 5 deletions .prettyci.composer.json

This file was deleted.

30 changes: 22 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,33 +44,47 @@ script:
jobs:
allow_failures:
- php: nightly
- php: 7.4
- php: 7.4snapshot
include:
- stage: Test
php: 7.1
env: PHPUNIT=true SETUP=lowest REMOVE_XDEBUG=true COMPOSER_VERSION=1.6.5
php: 7.2
env: PHPUNIT=true SETUP=lowest REMOVE_XDEBUG=true COMPOSER_VERSION=1.7.0
- stage: Test
php: 7.2
env: PHPUNIT=true SETUP=high REMOVE_XDEBUG=true COMPOSER_VERSION=1.7.0
- stage: Test
php: 7.3
env: PHPUNIT=true SETUP=high REMOVE_XDEBUG=true COMPOSER_VERSION=1.8.0
- stage: Test
php: 7.4
env: PHPUNIT=true SETUP=high REMOVE_XDEBUG=true COMPOSER_VERSION=1.8.0
php: 7.3
env: PHPUNIT=true SETUP=high REMOVE_XDEBUG=true COMPOSER_VERSION=1.9.0
- stage: Test
php: 7.4snapshot
env: PHPUNIT=true SETUP=high REMOVE_XDEBUG=true COMPOSER_VERSION=1.9.0
- stage: Test
php: nightly
env: PHPUNIT=true SETUP=high REMOVE_XDEBUG=true COMPOSER_VERSION=1.8.0
env: PHPUNIT=true SETUP=high REMOVE_XDEBUG=true COMPOSER_VERSION=1.9.0

- stage: Static Analysis
php: 7.2
env: REMOVE_XDEBUG=false SETUP=high COMPOSER_VERSION=1.8.0
env: REMOVE_XDEBUG=false SETUP=high COMPOSER_VERSION=1.9.0
script:
- composer phpstan
# - stage: Static Analysis
# php: 7.2
# env: REMOVE_XDEBUG=false SETUP=high COMPOSER_VERSION=1.9.0
# script:
# - composer psalm

- stage: Mutation
php: 7.2
env: REMOVE_XDEBUG=true SETUP=high COMPOSER_VERSION=1.9.0
script:
- ulimit -n 4096 && phpdbg -qrr ./vendor/bin/infection -vvv --min-msi=40 --min-covered-msi=60

- stage: Coverage
php: 7.2
env: REMOVE_XDEBUG=false SETUP=high COMPOSER_VERSION=1.8.0
env: REMOVE_XDEBUG=false SETUP=high COMPOSER_VERSION=1.9.0
script:
- bash -xc "$TEST -c ./phpunit.xml.dist --coverage-clover=coverage.xml"
after_success:
Expand Down
5 changes: 4 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ environment:
matrix:
- dependencies: lowest
PHP_VERSION: 7.2
COMPOSER_VERSION: 1.6.5
COMPOSER_VERSION: 1.7.0
- dependencies: high
PHP_VERSION: 7.2
COMPOSER_VERSION: 1.7.0
- dependencies: high
PHP_VERSION: 7.3
COMPOSER_VERSION: 1.8.0
- dependencies: high
PHP_VERSION: 7.3
COMPOSER_VERSION: 1.9.0

matrix:
fast_finish: true
Expand Down
24 changes: 13 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,28 @@
}
],
"require": {
"php": "^7.1",
"php": "^7.2",
"ext-json": "*",
"ext-tokenizer": "*",
"composer-plugin-api": "^1.0"
},
"require-dev": {
"composer/composer": "^1.6.5 || ^1.7.0 || ^1.8.0",
"mockery/mockery": "^1.0.0",
"narrowspark/testing-helper": "^6.0.0",
"composer/composer": "^1.7.0 || ^1.8.0 || ^1.9.0",
"mockery/mockery": "^1.2.2",
"narrowspark/testing-helper": "^8.0.0",
"nyholm/nsa": "^1.1.0",
"phpunit/phpunit": "^7.2.0",
"ocramius/package-versions": "^1.4.0",
"narrowspark/coding-standard": "^1.4.0"
"phpunit/phpunit": "^8.3.3",
"ocramius/package-versions": "^1.4.0 || ^1.5.0",
"narrowspark/coding-standard": "^2.1.1",
"infection/infection": "^0.13.4"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist"
},
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
"dev-master": "2.0.x-dev"
},
"class": [
"Narrowspark\\Automatic\\Security\\SecurityPlugin",
Expand All @@ -66,8 +67,7 @@
"psr-4": {
"Narrowspark\\Automatic\\Test\\": "tests/Automatic/",
"Narrowspark\\Automatic\\Common\\Test\\": "tests/Common/",
"Narrowspark\\Automatic\\Security\\Test\\": "tests/Security/",
"Narrowspark\\Automatic\\Functional\\Test\\": "tests/Functional/"
"Narrowspark\\Automatic\\Security\\Test\\": "tests/Security/"
},
"files": [
"tests/Automatic/TmpDirMock.php"
Expand All @@ -79,10 +79,12 @@
"coverage": "phpunit --coverage-html=\"build/logs\"",
"cs": "php-cs-fixer fix",
"phpstan": "phpstan analyse -c phpstan.neon -l 7 src --memory-limit=-1",
"psalm": "psalm",
"test": "phpunit",
"infection": "infection",
"test-common": "phpunit --testsuite=\"Narrowspark Automatic Common Test Suite\"",
"test-automatic": "phpunit --testsuite=\"Narrowspark Automatic Test Suite\"",
"changelog": "changelog-generator generate --config=\".changelog\" --file --prepend"
"changelog": "changelog-generator generate --config=\".changelog\" --file --prepend"
},
"support": {
"issues": "https://github.com/narrowspark/automatic/issues",
Expand Down
14 changes: 14 additions & 0 deletions infection.json.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"timeout": 15,
"source": {
"directories": [
"src"
]
},
"logs": {
"text": "infection.log"
},
"mutators": {
"@default": true
}
}
15 changes: 15 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,18 @@ parameters:
# Automatic
- '#does not call parent constructor from Composer\\Repository\\ComposerRepository#'
- '#Call to function method_exists\(\) with Symfony\\Component\\Console\\Style\\SymfonyStyle and#'

# CopyFromPackageConfigurator
- '#Variable method call on Symfony\\Component\\Filesystem\\Filesystem#'

# EnvConfigurator - phpstan missing support
- '#Strict comparison using \!== between bool and null will always evaluate to true#'

# Package
- '#Variable method call on Narrowspark\\Automatic\\Common\\Package#'

# PhpScriptExtender
- "#Casting to string something that's already string#"

# GetGenericPropertyReaderTrait
- '#Variable property access on mixed#'
13 changes: 12 additions & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/7.0/phpunit.xsd"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
cacheResult="true"
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
failOnRisky="true"
failOnWarning="true"
backupGlobals="true"
columns="max"
executionOrder="random"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
resolveDependencies="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutResourceUsageDuringSmallTests="true"
beStrictAboutChangesToGlobalState="true"
>
<php>
<ini name="error_reporting" value="-1" />
Expand Down
55 changes: 55 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0"?>
<psalm
totallyTyped="false"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
>
<projectFiles>
<directory name="src" />
<ignoreFiles>
<directory name="vendor" />
</ignoreFiles>
</projectFiles>

<issueHandlers>
<LessSpecificReturnType errorLevel="info" />

<!-- level 3 issues - slightly lazy code writing, but provably low false-negatives -->

<DeprecatedMethod errorLevel="info" />
<DeprecatedProperty errorLevel="info" />
<DeprecatedClass errorLevel="info" />
<DeprecatedConstant errorLevel="info" />
<DeprecatedFunction errorLevel="info" />
<DeprecatedInterface errorLevel="info" />
<DeprecatedTrait errorLevel="info" />

<InternalMethod errorLevel="info" />
<InternalProperty errorLevel="info" />
<InternalClass errorLevel="info" />

<MissingClosureReturnType errorLevel="info" />
<MissingReturnType errorLevel="info" />
<MissingPropertyType errorLevel="info" />
<InvalidDocblock errorLevel="info" />
<MisplacedRequiredParam errorLevel="info" />

<PropertyNotSetInConstructor errorLevel="info" />
<MissingConstructor errorLevel="info" />
<MissingClosureParamType errorLevel="info" />
<MissingParamType errorLevel="info" />

<RedundantCondition errorLevel="info" />

<DocblockTypeContradiction errorLevel="info" />
<RedundantConditionGivenDocblockType errorLevel="info" />

<UnresolvableInclude errorLevel="info" />

<RawObjectIteration errorLevel="info" />

<InvalidStringClass errorLevel="info" />
</issueHandlers>
</psalm>
Loading