Skip to content

Commit

Permalink
Adapt to new widgets feature "theme config" (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Nov 16, 2023
1 parent e6861fd commit bdfe924
Show file tree
Hide file tree
Showing 50 changed files with 629 additions and 669 deletions.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -28,7 +28,7 @@
"yiisoft/hydrator-validator": "dev-master",
"yiisoft/strings": "^2.0",
"yiisoft/validator": "^1.0",
"yiisoft/widget": "^2.0"
"yiisoft/widget": "^2.1"
},
"require-dev": {
"maglnet/composer-require-checker": "^4.2",
Expand Down
4 changes: 2 additions & 2 deletions config/bootstrap.php
Expand Up @@ -3,15 +3,15 @@
declare(strict_types=1);

use Psr\Container\ContainerInterface;
use Yiisoft\Form\Field;
use Yiisoft\Form\ThemeContainer;

/**
* @var array $params
*/

return [
static function (ContainerInterface $container) use ($params) {
Field::initialize(
ThemeContainer::initialize(
$params['yiisoft/form']['configs'],
$params['yiisoft/form']['defaultConfig'],
);
Expand Down
2 changes: 1 addition & 1 deletion docs/creating-forms.md
Expand Up @@ -132,4 +132,4 @@ $this->setTitle($title);
There is a way to declare validation rules using attributes.
For detailed information of using attributes see [Yiisoft Validator](https://github.com/yiisoft/validator).

> If you are using attributes then there is no need to declare the `getRules` method.
> If you are using attributes then there is no need to declare the `getRules` method.
4 changes: 2 additions & 2 deletions docs/fields-configuration.md
Expand Up @@ -3,6 +3,6 @@
Configuration levels:

- widget factory configuration;
- common configuration in field factory;
- individual configuration in field factory;
- common configuration from theme (optional);
- individual configuration from theme (optional);
- configuration at the place of use.
48 changes: 30 additions & 18 deletions phpunit.xml.dist
@@ -1,20 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" colors="true" verbose="true" bootstrap="vendor/autoload.php" failOnRisky="true" failOnWarning="true" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>./</directory>
</include>
<exclude>
<directory>./tests</directory>
<directory>./vendor</directory>
</exclude>
</coverage>
<php>
<ini name="error_reporting" value="-1"/>
</php>
<testsuites>
<testsuite name="YiiForm">
<directory>./tests</directory>
</testsuite>
</testsuites>

<phpunit
bootstrap="vendor/autoload.php"
colors="true"
verbose="true"
failOnRisky="true"
failOnWarning="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="false"
executionOrder="random"
resolveDependencies="true"
>
<php>
<ini name="error_reporting" value="-1"/>
</php>

<testsuites>
<testsuite name="Yii Form tests">
<directory>./tests</directory>
</testsuite>
</testsuites>

<coverage>
<include>
<directory>./src</directory>
<directory>./config</directory>
</include>
</coverage>
</phpunit>

0 comments on commit bdfe924

Please sign in to comment.