Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Behat CoverageUtil for config with no excluded dir #1876

Merged
merged 4 commits into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/db.default.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

$sqliteFile = __DIR__ . '/_demo-data/db.sqlite';
if (!file_exists($sqliteFile)) {
throw new \Exception('Sqlite database does not exist, create it first.');
throw new \Exception('Sqlite database does not exist, create it first');
}
$db = new Persistence\Sql('sqlite:' . $sqliteFile);
unset($sqliteFile);
10 changes: 8 additions & 2 deletions src/Behat/CoverageUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ public static function startFromPhpunitConfig(string $phpunitConfigDir): void
$filter = new Filter();

$phpunitCoverageConfig = simplexml_load_file($phpunitConfigDir . '/phpunit.xml.dist')->coverage;
foreach ($phpunitCoverageConfig->include->directory as $path) {
foreach ($phpunitCoverageConfig->include->directory ?? [] as $path) {
$filter->includeDirectory($phpunitConfigDir . '/' . $path);
}
foreach ($phpunitCoverageConfig->exclude->directory as $path) {
foreach ($phpunitCoverageConfig->include->file ?? [] as $path) {
$filter->includeFile($phpunitConfigDir . '/' . $path);
}
foreach ($phpunitCoverageConfig->exclude->directory ?? [] as $path) {
$filter->excludeDirectory($phpunitConfigDir . '/' . $path);
}
foreach ($phpunitCoverageConfig->exclude->file ?? [] as $path) {
$filter->excludeFile($phpunitConfigDir . '/' . $path);
}

static::start($filter);

Expand Down
4 changes: 2 additions & 2 deletions src/Form/Control/Dropdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ protected function _renderItemsForValues(): void
* Used when a custom callback is defined for row rendering. Sets
* values to row template and appends it to main template.
*
* @param mixed $row
* @param int|string|int $key
* @param mixed $row
* @param int|string $key
*/
protected function _addCallBackRow($row, $key = null): void
{
Expand Down
4 changes: 1 addition & 3 deletions src/Header.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
namespace Atk4\Ui;

/**
* Class implements Headers.
*
* Set size to 1, 2, 3, 4 or 5 if you are looking for Page Header. The size is not affected by
* header placement on the page. Specify number to constructor like this:
* header placement on the page. Specify number to constructor like this:.
*
* $h = new Header(['size' => 1]); // creates <h1>..</h1> header.
*
Expand Down
1 change: 0 additions & 1 deletion src/JsToast.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Atk4\Core\DiContainerTrait;

/**
* Class JsToast
* Generate a Fomantic-UI toast module command in js.
* $('body').toast({options}).
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Atk4\Ui;

/**
* Class implements Loader, which is a View that will dynamically render it's content.
* Dynamically render it's content.
* To provide content for a loader, use set() callback.
*/
class Loader extends View
Expand Down
12 changes: 4 additions & 8 deletions src/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@
namespace Atk4\Ui;

/**
* Class implements Messages (a visual box).
*
* Specify type = info | warning | error | success
*
* Message::addTo($page, [
* 'type' => 'error',
* 'text' => 'Unable to save your document',
* ])
* ->text->addParagraph('')
* 'type' => 'error',
* 'text' => 'Unable to save your document',
* ])
* ->text->addParagraph('').
*/
class Message extends View
{
Expand Down
4 changes: 1 addition & 3 deletions src/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
namespace Atk4\Ui;

/**
* Class implements ProgressBar.
*
* $bar = ProgressBar::addTo($app, [10, 'label' => 'Processing files']);
* $bar = ProgressBar::addTo($app, [10, 'label' => 'Processing files']);.
*/
class ProgressBar extends View
{
Expand Down
2 changes: 1 addition & 1 deletion src/Table/Column/ColorRating.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Atk4\Ui\Table;

/**
* Class ColorRating can be defined like this:
* Example seed:
* [ColorRating::class, [
* 'min' => 1,
* 'max' => 3,
Expand Down