Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
caiquearaujo committed May 14, 2023
2 parents f3519e0 + cc7254c commit d49064f
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Expand Up @@ -79,4 +79,8 @@

## `2.1.0` at `2023-03-10`

* Replaced ApplicationModel with ApplicationInterface.
* Replaced ApplicationModel with ApplicationInterface.

## `2.1.1` at `2023-05-14`

* Added interfaces for Arrayable, Importable, SensitiveDataArrayable objects.
2 changes: 1 addition & 1 deletion composer.json
Expand Up @@ -2,7 +2,7 @@
"name": "piggly/php-api-client",
"description": "A client starter-kit used to interact with any REST API.",
"minimum-stability": "stable",
"version": "2.1.0",
"version": "2.1.1",
"keywords": [
"piggly",
"api",
Expand Down
25 changes: 25 additions & 0 deletions src/Interfaces/Arrayable.php
@@ -0,0 +1,25 @@
<?php

namespace Piggly\ApiClient\Interfaces;

/**
* Object that can be converted to array.
*
* @since 2.1.1
* @category Interfaces
* @package Piggly\ApiClient
* @subpackage Piggly\ApiClient\Interfaces
* @author Caique Araujo <caique@piggly.com.br>
* @author Piggly Lab <dev@piggly.com.br>
* @copyright 2023 Piggly Lab
*/
interface Arrayable
{
/**
* Convert object to array.
*
* @return array
* @since 2.1.1
*/
public function toArray(): array;
}
26 changes: 26 additions & 0 deletions src/Interfaces/Importable.php
@@ -0,0 +1,26 @@
<?php

namespace Pgly\PagarMe\Api\Interfaces;

/**
* Object that can be imported from an array.
*
* @since 2.1.1
* @category Interfaces
* @package Piggly\ApiClient
* @subpackage Piggly\ApiClient\Interfaces
* @author Caique Araujo <caique@piggly.com.br>
* @author Piggly Lab <dev@piggly.com.br>
* @copyright 2023 Piggly Lab
*/
interface Importable
{
/**
* Import data from an array.
*
* @param array $data
* @return mixed
* @since 2.1.1
*/
public static function import(array $data);
}
26 changes: 26 additions & 0 deletions src/Interfaces/SensitiveDataArrayable.php
@@ -0,0 +1,26 @@
<?php

namespace Piggly\ApiClient\Interfaces;

/**
* Object that can be converted to array.
*
* @since 2.1.1
* @category Interfaces
* @package Piggly\ApiClient
* @subpackage Piggly\ApiClient\Interfaces
* @author Caique Araujo <caique@piggly.com.br>
* @author Piggly Lab <dev@piggly.com.br>
* @copyright 2023 Piggly Lab
*/
interface SensitiveDataArrayable
{
/**
* Convert object to a censored array.
* It must hide sensitive data.
*
* @return array
* @since 2.1.1
*/
public function toCensoredArray(): array;
}

0 comments on commit d49064f

Please sign in to comment.