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

Release/v2.0.3 #4

Merged
merged 10 commits into from
Sep 29, 2022
Merged
134 changes: 60 additions & 74 deletions .github/lang/es-ES/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ Biblioteca PHP para el manejo de _links_ y _scripts_ HTML.

## Requisitos

Esta biblioteca es compatible con las versiones de PHP: 8.1.
- Sistema operativo: Linux | Windows.

- Versiones de PHP: 8.1 | 8.2.

## Instalación

Expand Down Expand Up @@ -64,47 +66,37 @@ git clone https://github.com/josantonius/php-asset.git

### Clase Asset

```php
use Josantonius\Asset\Asset;
```

Crear objeto:

```php
$asset = new Asset();
```
`Josantonius\Asset\Asset`

Imprime los _scripts_ añadidos para el _body_:

```php
$asset->outputBodyScripts(): string
public function outputBodyScripts(): string;
```

Imprime los _scripts_ añadidos para el _head_:

```php
$asset->outputHeadScripts(): string
public function outputHeadScripts(): string;
```

Imprime los _links_ añadidos:

```php
$asset->outputLinks(): string
public function outputLinks(): string;
```

### Fachada Asset

```php
use Josantonius\Asset\Facades\Asset;
```
`Josantonius\Asset\Facades\Asset`

Agregar _script_ en el _body_:

```php
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
*/
Asset::addBodyScript(
public static function addBodyScript(
null|bool $async = null,
null|string $crossorigin = null,
null|bool $defer = null,
Expand All @@ -115,7 +107,7 @@ Asset::addBodyScript(
null|string $referrerpolicy = null,
null|string $src = null,
null|string $type = null
): BodyScript
): BodyScript;
```

Agregar _script_ en el _head_:
Expand All @@ -124,7 +116,7 @@ Agregar _script_ en el _head_:
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
*/
Asset::addHeadScript(
public static function addHeadScript(
null|bool $async = null,
null|string $crossorigin = null,
null|bool $defer = null,
Expand All @@ -135,7 +127,7 @@ Asset::addHeadScript(
null|string $referrerpolicy = null,
null|string $src = null,
null|string $type = null
): HeadScript
): HeadScript;
```

Agregar _link_:
Expand All @@ -144,7 +136,7 @@ Agregar _link_:
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
*/
Asset::addLink(
public static function addLink(
null|string $as = null,
null|string $crossorigin = null,
null|bool $disabled = null,
Expand All @@ -162,109 +154,103 @@ Asset::addLink(
null|string $target = null,
null|string $title = null,
null|string $type = null,
): Link
): Link;
```

Imprime los _scripts_ añadidos para el _body_:

```php
Asset::outputBodyScripts(): string
public static function outputBodyScripts(): string;
```

Imprime los _scripts_ añadidos para el _head_:

```php
Asset::outputHeadScripts(): string
public static function outputHeadScripts(): string;
```

Imprime los _links_ añadidos:

```php
Asset::outputLinks(): string
public static function outputLinks(): string;
```

### Clase BodyScript

```php
use Josantonius\Asset\Elements\BodyScript;
```
`Josantonius\Asset\Elements\BodyScript`

Agregar _script_ en el _body_:

```php
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
*/
new BodyScript(
null|bool $async = null,
null|string $crossorigin = null,
null|bool $defer = null,
null|string $fetchpriority = null,
null|string $integrity = null,
null|bool $nomodule = null,
null|string $nonce = null,
null|string $referrerpolicy = null,
null|string $src = null,
null|string $type = null
public function __construct(
private null|bool $async = null,
private null|string $crossorigin = null,
private null|bool $defer = null,
private null|string $fetchpriority = null,
private null|string $integrity = null,
private null|bool $nomodule = null,
private null|string $nonce = null,
private null|string $referrerpolicy = null,
private null|string $src = null,
private null|string $type = null
);
```

### Clase HeadScript

```php
use Josantonius\Asset\Elements\HeadScript;
```
`Josantonius\Asset\Elements\HeadScript`

Agregar _script_ en el _head_:

```php
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script
*/
new HeadScript(
null|bool $async = null,
null|string $crossorigin = null,
null|bool $defer = null,
null|string $fetchpriority = null,
null|string $integrity = null,
null|bool $nomodule = null,
null|string $nonce = null,
null|string $referrerpolicy = null,
null|string $src = null,
null|string $type = null
public function __construct(
private null|bool $async = null,
private null|string $crossorigin = null,
private null|bool $defer = null,
private null|string $fetchpriority = null,
private null|string $integrity = null,
private null|bool $nomodule = null,
private null|string $nonce = null,
private null|string $referrerpolicy = null,
private null|string $src = null,
private null|string $type = null
);
```

### Clase Link

```php
use Josantonius\Asset\Elements\Link;
```
`Josantonius\Asset\Elements\Link`

Agregar _link_:

```php
/**
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link
*/
new Link(
null|string $as = null,
null|string $crossorigin = null,
null|bool $disabled = null,
null|string $fetchpriority = null,
null|string $href = null,
null|string $hreflang = null,
null|string $imagesizes = null,
null|string $imagesrcset = null,
null|string $integrity = null,
null|string $media = null,
null|string $prefetch = null,
null|string $referrerpolicy = null,
null|string $rel = null,
null|string $sizes = null,
null|string $target = null,
null|string $title = null,
null|string $type = null,
public function __construct(
private null|string $as = null,
private null|string $crossorigin = null,
private null|bool $disabled = null,
private null|string $fetchpriority = null,
private null|string $href = null,
private null|string $hreflang = null,
private null|string $imagesizes = null,
private null|string $imagesrcset = null,
private null|string $integrity = null,
private null|string $media = null,
private null|string $prefetch = null,
private null|string $referrerpolicy = null,
private null|string $rel = null,
private null|string $sizes = null,
private null|string $target = null,
private null|string $title = null,
private null|string $type = null,
);
```

Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ jobs:
name: 'PHPUnit (PHP ${{ matrix.php }} - ${{ matrix.system }})'
strategy:
matrix:
system: ['ubuntu-latest']
system: ['ubuntu-latest', 'windows-latest']
php:
- '8.1'
- '8.2'
steps:
- name: Checkout Code
uses: actions/checkout@v3
Expand Down
41 changes: 28 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
# CHANGELOG

## [v2.0.2](https://github.com/josantonius/php-json/releases/tag/v2.0.2) (2022-08-10)
## [v2.0.3](https://github.com/josantonius/php-asset/releases/tag/v2.0.3) (2022-09-29)

* The notation type in the test function names has been changed from camel to snake case for readability.

* Functions were added to document the methods and avoid confusion.

* Disabled the ´CamelCaseMethodName´ rule in ´phpmd.xml´ to avoid warnings about function names in tests.

* The alignment of the asterisks in the comments has been fixed.

* Tests for Windows have been added.

* Tests for PHP 8.2 have been added.

## [v2.0.2](https://github.com/josantonius/php-asset/releases/tag/v2.0.2) (2022-08-10)

* improve documentation in `README` files.

## [v2.0.1](https://github.com/josantonius/php-json/releases/tag/v2.0.1) (2022-07-13)
## [v2.0.1](https://github.com/josantonius/php-asset/releases/tag/v2.0.1) (2022-07-13)

* Remove unused class in `Josantonius\Asset\Facades\Asset`.

* improve documentation in `README` files.

## [v2.0.0](https://github.com/josantonius/php-json/releases/tag/v2.0.0) (2022-06-30)
## [v2.0.0](https://github.com/josantonius/php-asset/releases/tag/v2.0.0) (2022-06-30)

> Version 1.x is considered as deprecated and unsupported.
> In this version (2.x) the library was completely restructured.
Expand Down Expand Up @@ -93,21 +107,21 @@

`.php_cs.dist` file.

## [1.1.7](https://github.com/josantonius/php-json/releases/tag/1.1.0) (2018-01-05)
## [1.1.7](https://github.com/josantonius/php-asset/releases/tag/1.1.0) (2018-01-05)

* The tests were fixed.

* Changes in documentation.

## [1.1.6](https://github.com/josantonius/php-json/releases/tag/1.1.6) (2017-11-08)
## [1.1.6](https://github.com/josantonius/php-asset/releases/tag/1.1.6) (2017-11-08)

* Implemented `PHP Mess Detector` to detect inconsistencies in code styles.

* Implemented `PHP Code Beautifier and Fixer` to fixing errors automatically.

* Implemented `PHP Coding Standards Fixer` to organize PHP code automatically according to PSR standards.

## [1.1.5](https://github.com/josantonius/php-json/releases/tag/1.1.5) (2017-10-24)
## [1.1.5](https://github.com/josantonius/php-asset/releases/tag/1.1.5) (2017-10-24)

* Implemented `PSR-4 autoloader standard` from all library files.

Expand Down Expand Up @@ -181,7 +195,7 @@
* Added `Josantonius\Asset\UnifyFilesTest->testOutputStylesAndScripts()` method.
* Added `Josantonius\Asset\UnifyFilesTest->testIfUnifiedFilesWasCreated()` method.

## [1.1.4](https://github.com/josantonius/php-json/releases/tag/1.1.4) (2017-09-10)
## [1.1.4](https://github.com/josantonius/php-asset/releases/tag/1.1.4) (2017-09-10)

* Unit tests supported by `PHPUnit` were added.

Expand Down Expand Up @@ -215,31 +229,32 @@
* Added `Josantonius\Asset\Test\AssetTest::testAddMultipleJsFileAttr()` method.
* Added `Josantonius\Asset\Test\AssetTest::testAddMultipleJsFileSameAttr()` method.

## [1.1.3](https://github.com/josantonius/php-json/releases/tag/1.1.3) (2017-07-15)
## [1.1.3](https://github.com/josantonius/php-asset/releases/tag/1.1.3) (2017-07-15)

* Deleted `Josantonius\Asset\Exception\AssetException` class.
* Deleted `Josantonius\Asset\Exception\Exceptions` abstract class.
* Deleted `Josantonius\Asset\Exception\AssetException->__construct()` method.

## [1.1.2](https://github.com/josantonius/php-json/releases/tag/1.1.2) (2017-03-18)
## [1.1.2](https://github.com/josantonius/php-asset/releases/tag/1.1.2) (2017-03-18)

* Some files were excluded from download and comments and readme files were updated.

## [1.1.1](https://github.com/josantonius/php-json/releases/tag/1.1.1) (2017-02-17)
## [1.1.1](https://github.com/josantonius/php-asset/releases/tag/1.1.1) (2017-02-17)

* Added `Josantonius\Asset\Tests\AssetTest::testAddOneJsFileAttr()` method.
* Added `Josantonius\Asset\Tests\AssetTest::testAddMultipleJsFileAttr()` method.
* Added `Josantonius\Asset\Tests\AssetTest::testAddMultipleJsFileSameAttr()` method.
* Added `$attr` parameter in `Josantonius\Asset\Asset::resource()` method.
* Added `$attr` parameter in `Josantonius\Asset\Asset::js()` method.

## [1.1.0](https://github.com/josantonius/php-json/releases/tag/1.1.0) (2017-01-30)
## [1.1.0](https://github.com/josantonius/php-asset/releases/tag/1.1.0) (2017-01-30)

* Compatible with PHP 5.6 or higher.

## [1.0.0](https://github.com/josantonius/php-json/releases/tag/1.0.0) (2016-12-14)
## [1.0.0](https://github.com/josantonius/php-asset/releases/tag/1.0.0) (2016-12-14)

* Compatible only with PHP 7.0 or higher. In the next versions, the library will be modified to make it compatible with PHP 5.6 or higher.
* Compatible only with PHP 7.0 or higher. In the next versions,
the library will be modified to make it compatible with PHP 5.6 or higher.

* Added `Josantonius\Asset\Asset` class.
* Added `Josantonius\Asset\Asset::resource()` method.
Expand Down
Loading