Skip to content

Commit

Permalink
Fix phpdoc, update README.md, clean tests, and update styleci.yml
Browse files Browse the repository at this point in the history
… configuration. (#7)
  • Loading branch information
terabytesoftw committed Jan 23, 2024
1 parent c175b48 commit af42eaf
Show file tree
Hide file tree
Showing 41 changed files with 280 additions and 116 deletions.
7 changes: 4 additions & 3 deletions .styleci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@ enabled:
- combine_nested_dirname
- declare_strict_types
- dir_constant
- empty_loop_body_braces
- fully_qualified_strict_types
- function_to_constant
- hash_to_slash_comment
- integer_literal_case
- is_null
- logical_operators
- magic_constant_casing
Expand Down Expand Up @@ -56,7 +58,6 @@ enabled:
- phpdoc_order
- phpdoc_property
- phpdoc_scalar
- phpdoc_separation
- phpdoc_singular_inheritdoc
- phpdoc_trim
- phpdoc_trim_consecutive_blank_line_separation
Expand All @@ -78,9 +79,9 @@ enabled:
- trailing_comma_in_multiline_array
- unalign_double_arrow
- unalign_equals
- empty_loop_body_braces
- integer_literal_case
- union_type_without_spaces

disabled:
- function_declaration
- psr12_braces
- psr12_class_definition
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Change Log
==========

## 0.1.1 Under development
## 0.1.1 January 23, 2024

- Bug #7: Fix phpdoc, update `README.md`, clean tests, and update `styleci.yml` configuration (@terabytesoftw)

## 0.1.0 January 21, 2024

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@
"sort-packages": true
},
"extra": {
"config-plugin-options": {
"source-directory": "config"
},
"config-plugin": {
"params": "yiisoft-aliases.php"
},
"config-plugin-options": {
"source-directory": "config"
}
},
"scripts": {
Expand Down
11 changes: 7 additions & 4 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## Using assets

Assets are files that are not processed by Webpack. They are copied directly to the output folder. This includes images,
fonts, and any other files that you want to use in your project.
Assets are files that Webpack does not process.

They are copied directly to the output folder.

This includes images, fonts, and any other files that you want to use in your project.

To use an asset, you need to import it from JavaScript or CSS.

Expand All @@ -21,7 +24,7 @@ use Yii\Asset\Css\FontAwesome;
* @var \Yiisoft\Assets\AssetManager $assetManager
*/

// Register the asset bundle with a asset manager component.
// Register the asset bundle with an asset manager component.
$assetManager->register(FontAwesome::class);

// Set parameters for the registered asset bundle a view component.
Expand All @@ -32,7 +35,7 @@ $this->addJsStrings($assetManager->getJsStrings());
$this->addJsVars($assetManager->getJsVars());
```

Also you can register the asset bundle via container configuration:
Also, you can register the asset bundle via container configuration:

```php
file: ./config/params.php
Expand Down
5 changes: 5 additions & 0 deletions docs/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ To run the checker, execute the following command:
composer run check-dependencies
```

## Easy coding standard

The code is checked with [Easy Coding Standard](https://github.com/easy-coding-standard/easy-coding-standard) and
[PHP CS Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer). To run it:

## Mutation testing

Mutation testing is checked with [Infection](https://infection.github.io/). To run it:
Expand Down
38 changes: 19 additions & 19 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
bootstrap="tests/Support/bootstrap.php"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends,defects"
failOnRisky="true"
failOnWarning="true"
stopOnFailure="false"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd"
bootstrap="tests/Support/bootstrap.php"
cacheDirectory=".phpunit.cache"
colors="true"
executionOrder="depends,defects"
failOnRisky="true"
failOnWarning="true"
stopOnFailure="false"
>
<testsuites>
<testsuite name="Asset-Fontawesome-Free">
<directory>tests</directory>
</testsuite>
</testsuites>
<testsuites>
<testsuite name="Asset-Fontawesome-Free">
<directory>tests</directory>
</testsuite>
</testsuites>

<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
<source>
<include>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
3 changes: 3 additions & 0 deletions src/Css/Depend/DependCdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Yiisoft\Assets\AssetBundle;

/**
* FontAwesome CDN CSS bundle.
*/
final class DependCdn extends AssetBundle
{
public bool $cdn = true;
Expand Down
7 changes: 6 additions & 1 deletion src/Css/FontAwesome.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

use function defined;

/**
* FontAwesome CSS bundle.
*/
final class FontAwesome extends AssetBundle
{
public string|null $basePath = '@assets';
Expand All @@ -23,7 +28,7 @@ public function __construct()

$this->css = [$cssFiles];
$this->publishOptions = [
'filter' => $pathMatcher->only("**/css/{$cssFiles}", "**/{$fontAwesomeFile}", '**/webfonts/*'),
'filter' => $pathMatcher->only("**/css/$cssFiles", "**/$fontAwesomeFile", '**/webfonts/*'),
];
}
}
7 changes: 6 additions & 1 deletion src/Css/FontAwesomeBrand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

use function defined;

/**
* FontAwesome brand CSS bundle.
*/
final class FontAwesomeBrand extends AssetBundle
{
public string|null $basePath = '@assets';
Expand All @@ -23,7 +28,7 @@ public function __construct()

$this->css = [$cssFiles];
$this->publishOptions = [
'filter' => $pathMatcher->only("**/css/{$cssFiles}", "**/{$fontAwesomeFile}", '**/webfonts/fa-brands*'),
'filter' => $pathMatcher->only("**/css/$cssFiles", "**/$fontAwesomeFile", '**/webfonts/fa-brands*'),
];
}
}
3 changes: 3 additions & 0 deletions src/Css/FontAwesomeBrandCdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Yiisoft\Assets\AssetBundle;

/**
* FontAwesome brand CDN CSS bundle.
*/
final class FontAwesomeBrandCdn extends AssetBundle
{
public bool $cdn = true;
Expand Down
3 changes: 3 additions & 0 deletions src/Css/FontAwesomeCdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Yiisoft\Assets\AssetBundle;

/**
* FontAwesome all CDN CSS bundle.
*/
final class FontAwesomeCdn extends AssetBundle
{
public bool $cdn = true;
Expand Down
5 changes: 5 additions & 0 deletions src/Css/FontAwesomeRegular.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

use function defined;

/**
* FontAwesome regular CSS bundle.
*/
final class FontAwesomeRegular extends AssetBundle
{
public string|null $basePath = '@assets';
Expand Down
3 changes: 3 additions & 0 deletions src/Css/FontAwesomeRegularCdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Yiisoft\Assets\AssetBundle;

/**
* FontAwesome regular CDN CSS bundle.
*/
final class FontAwesomeRegularCdn extends AssetBundle
{
public bool $cdn = true;
Expand Down
7 changes: 6 additions & 1 deletion src/Css/FontAwesomeSolid.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

use function defined;

/**
* FontAwesome solid CSS bundle.
*/
final class FontAwesomeSolid extends AssetBundle
{
public string|null $basePath = '@assets';
Expand All @@ -24,7 +29,7 @@ public function __construct()

$this->css = [$cssFiles];
$this->publishOptions = [
'filter' => $pathMatcher->only("**/css/{$cssFiles}", "**/{$fontAwesomeFile}", '**/webfonts/fa-solid*'),
'filter' => $pathMatcher->only("**/css/$cssFiles", "**/$fontAwesomeFile", '**/webfonts/fa-solid*'),
];
}
}
3 changes: 3 additions & 0 deletions src/Css/FontAwesomeSolidCdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Yiisoft\Assets\AssetBundle;

/**
* FontAwesome solid CDN CSS bundle.
*/
final class FontAwesomeSolidCdn extends AssetBundle
{
public bool $cdn = true;
Expand Down
3 changes: 3 additions & 0 deletions src/Js/Depend/DependCdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Yiisoft\Assets\AssetBundle;

/**
* FontAwesome CDN JS bundle.
*/
final class DependCdn extends AssetBundle
{
public bool $cdn = true;
Expand Down
7 changes: 6 additions & 1 deletion src/Js/FontAwesome.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

use function defined;

/**
* FontAwesome JS bundle.
*/
final class FontAwesome extends AssetBundle
{
public string|null $basePath = '@assets';
Expand All @@ -23,7 +28,7 @@ public function __construct()

$this->js = [$jsFiles];
$this->publishOptions = [
'filter' => $pathMatcher->only("**/js/{$jsFiles}", "**/{$fontAwesomeFile}", '**/webfonts/*'),
'filter' => $pathMatcher->only("**/js/$jsFiles", "**/$fontAwesomeFile", '**/webfonts/*'),
];
}
}
7 changes: 6 additions & 1 deletion src/Js/FontAwesomeBrand.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

use function defined;

/**
* FontAwesome brand JS bundle.
*/
final class FontAwesomeBrand extends AssetBundle
{
public string|null $basePath = '@assets';
Expand All @@ -24,7 +29,7 @@ public function __construct()

$this->js = [$jsFiles];
$this->publishOptions = [
'filter' => $pathMatcher->only("**/js/{$jsFiles}", "**/{$fontAwesomeFile}", '**/webfonts/fa-brands*'),
'filter' => $pathMatcher->only("**/js/$jsFiles", "**/$fontAwesomeFile", '**/webfonts/fa-brands*'),
];
}
}
3 changes: 3 additions & 0 deletions src/Js/FontAwesomeBrandCdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Yiisoft\Assets\AssetBundle;

/**
* FontAwesome brand CDN JS bundle.
*/
final class FontAwesomeBrandCdn extends AssetBundle
{
public bool $cdn = true;
Expand Down
3 changes: 3 additions & 0 deletions src/Js/FontAwesomeCdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Yiisoft\Assets\AssetBundle;

/**
* FontAwesome all CDN JS bundle.
*/
final class FontAwesomeCdn extends AssetBundle
{
public bool $cdn = true;
Expand Down
7 changes: 6 additions & 1 deletion src/Js/FontAwesomeRegular.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

use function defined;

/**
* FontAwesome regular JS bundle.
*/
final class FontAwesomeRegular extends AssetBundle
{
public string|null $basePath = '@assets';
Expand All @@ -23,7 +28,7 @@ public function __construct()

$this->js = [$jsFiles];
$this->publishOptions = [
'filter' => $pathMatcher->only("**/js/{$jsFiles}", "**/{$fontAwesomeFile}", '**/webfonts/fa-regular*'),
'filter' => $pathMatcher->only("**/js/$jsFiles", "**/$fontAwesomeFile", '**/webfonts/fa-regular*'),
];
}
}
3 changes: 3 additions & 0 deletions src/Js/FontAwesomeRegularCdn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Yiisoft\Assets\AssetBundle;

/**
* FontAwesome regular CDN JS bundle.
*/
final class FontAwesomeRegularCdn extends AssetBundle
{
public bool $cdn = true;
Expand Down
7 changes: 6 additions & 1 deletion src/Js/FontAwesomeSolid.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
use Yiisoft\Assets\AssetBundle;
use Yiisoft\Files\PathMatcher\PathMatcher;

use function defined;

/**
* FontAwesome solid JS bundle.
*/
final class FontAwesomeSolid extends AssetBundle
{
public string|null $basePath = '@assets';
Expand All @@ -23,7 +28,7 @@ public function __construct()

$this->js = [$jsFiles];
$this->publishOptions = [
'filter' => $pathMatcher->only("**/{$jsFiles}", "**/{$fontAwesomeFile}", '**/webfonts/fa-solid*'),
'filter' => $pathMatcher->only("**/$jsFiles", "**/$fontAwesomeFile", '**/webfonts/fa-solid*'),
];
}
}

0 comments on commit af42eaf

Please sign in to comment.