Skip to content

Commit

Permalink
Merge pull request #21 from datashaman/develop
Browse files Browse the repository at this point in the history
More small fixes
  • Loading branch information
datashaman authored Apr 29, 2019
2 parents cc61a96 + a538008 commit 6a20f19
Show file tree
Hide file tree
Showing 16 changed files with 158 additions and 235 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@
/.phpunit.result.cache
/report/
/vendor/
/vendor-bin/
/.vscode/
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,12 @@ docs-functions:
phpcheck:
@phpcheck

phpcheck-coverage-html:
phpcheck-coverage:
sudo phpenmod xdebug
@phpcheck --coverage-html report/phpcheck-coverage
sudo phpdismod xdebug
@xdg-open report/phpcheck-coverage/index.html

phpcheck-coverage-console:
sudo phpenmod xdebug
@phpcheck --coverage-text
sudo phpdismod xdebug

phpcheck-coverage-text:
sudo phpenmod xdebug
@phpcheck --coverage-text report/phpcheck-coverage.txt
sudo phpdismod xdebug

phpcheck-log-junit:
@phpcheck --log-junit build/phpcheck.xml

Expand Down
2 changes: 1 addition & 1 deletion checks/GeneratorCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function ($interval) use ($ord) {

public function checkStrings(string $string): bool
{
return \mb_strlen($string) < 100;
return \mb_strlen($string) <= 30;
}

/**
Expand Down
9 changes: 9 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"webmozart/assert": "^1.4"
},
"require-dev": {
"bamarni/composer-bin-plugin": "^1.3",
"cache/redis-adapter": "^1.0",
"friendsofphp/php-cs-fixer": "^2.14",
"knplabs/github-api": "^2.11",
Expand All @@ -47,6 +48,9 @@
"phpunit/phpunit": "^8.1",
"symfony/templating": "^4.2"
},
"suggest": {
"ext-simplexml": "Enables JUnit XML report"
},
"config": {
"platform": {
"php": "7.2.0"
Expand All @@ -72,5 +76,10 @@
"Datashaman\\PHPCheck\\Checks\\": "checks/",
"Datashaman\\PHPCheck\\Tests\\": "tests/"
}
},
"scripts": {
"bin": "echo 'bin not installed'",
"post-install-cmd": ["@composer bin all install --ansi"],
"post-update-cmd": ["@composer bin all update --ansi"]
}
}
24 changes: 0 additions & 24 deletions examples/check_encoder.php

This file was deleted.

19 changes: 0 additions & 19 deletions playground/quickcheck.php

This file was deleted.

22 changes: 20 additions & 2 deletions src/Args.php
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
<?php

<?php declare(strict_types=1);
/*
* This file is part of the phpcheck package.
*
* ©Marlin Forbes <marlinf@datashaman.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Datashaman\PHPCheck;

class Args
{
public $bootstrap;

public $coverageHtml = false;

public $coverageText = false;

public $filter;

public $logJunit = false;

public $logText = false;

public $maxSuccess = Runner::MAX_SUCCESS;

public $noAnsi;

public $noDefects;

public $path;

public $output;

public $subject;
}
18 changes: 9 additions & 9 deletions src/CheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,17 @@ protected function execute(InputInterface $input, OutputInterface $output): ?int
{
$args = new Args();

$args->bootstrap = $input->getOption('bootstrap');
$args->bootstrap = $input->getOption('bootstrap');
$args->coverageHtml = $input->getOption('coverage-html');
$args->coverageText = $input->getOption('coverage-text');
$args->filter = $input->getOption('filter');
$args->logJunit = $input->getOption('log-junit');
$args->logText = $input->getOption('log-text');
$args->maxSuccess = $input->getOption('max-success');
$args->noAnsi = $input->getOption('no-ansi');
$args->noDefects = $input->getOption('no-defects');
$args->output = $output;
$args->path = $input->getArgument('path');
$args->filter = $input->getOption('filter');
$args->logJunit = $input->getOption('log-junit');
$args->logText = $input->getOption('log-text');
$args->maxSuccess = $input->getOption('max-success');
$args->noAnsi = $input->getOption('no-ansi');
$args->noDefects = $input->getOption('no-defects');
$args->output = $output;
$args->path = $input->getArgument('path');

$result = app('runner')->execute($args);

Expand Down
6 changes: 1 addition & 5 deletions src/Coverage/TextCoverage.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/
namespace Datashaman\PHPCheck\Coverage;

use function Datashaman\PHPCheck\app;
use SebastianBergmann\CodeCoverage\Report\Text;

/**
Expand All @@ -18,12 +17,9 @@
class TextCoverage extends Coverage
{
private $_output;

private $_noAnsi;

/**
* @param null|string $output
* @param null|bool $noAnsi
*/
public function __construct(
string $output = null,
bool $noAnsi = null
Expand Down
4 changes: 2 additions & 2 deletions src/Events/EndEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct(
) {
parent::__construct();
$this->function = $function;
$this->tags = $tags;
$this->status = $status;
$this->tags = $tags;
$this->status = $status;
}
}
6 changes: 3 additions & 3 deletions src/Events/ResultEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public function __construct(
) {
parent::__construct();
$this->function = $function;
$this->tags = $tags;
$this->args = $args;
$this->cause = $cause;
$this->tags = $tags;
$this->args = $args;
$this->cause = $cause;
}
}
2 changes: 1 addition & 1 deletion src/Events/StartEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ public function __construct(
) {
parent::__construct();
$this->function = $function;
$this->tags = $tags;
$this->tags = $tags;
}
}
2 changes: 1 addition & 1 deletion src/Random.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function random($min = 0, $max = null)
{
do {
$value = parent::random($min, $max);
} while (!is_int($value));
} while (!\is_int($value));

return $value;
}
Expand Down
Loading

0 comments on commit 6a20f19

Please sign in to comment.