Skip to content

Commit

Permalink
2.0.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
ericsizemore committed Mar 15, 2024
1 parent 5620bfd commit f381095
Show file tree
Hide file tree
Showing 27 changed files with 1,256 additions and 1,117 deletions.
11 changes: 11 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

declare(strict_types=1);

$header = <<<'EOF'
This file is part of Esi\LibrariesIO.
(c) 2023-2024 Eric Sizemore <https://github.com/ericsizemore>
For the full copyright and license information, please view
the LICENSE file that was distributed with this source code.
EOF;

$config = new PhpCsFixer\Config();
$config
->setRiskyAllowed(true)
Expand Down Expand Up @@ -53,6 +62,8 @@
'declare_parentheses' => true,
'declare_strict_types' => true,
//'global_namespace_import' => ['import_classes' => true, 'import_constants' => true, 'import_functions' => true],
'header_comment' => ['comment_type' => 'PHPDoc', 'header' => $header, 'separate' => 'top'],
'ordered_class_elements' => ['order' => ['use_trait', 'case', 'constant_public', 'constant_protected', 'constant_private', 'property_public', 'property_protected', 'property_private', 'construct', 'destruct', 'magic', 'phpunit', 'method_public', 'method_protected', 'method_private'], 'sort_algorithm' => 'alpha'],
])
->setLineEnding("\n")
->setFinder(
Expand Down
66 changes: 59 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,64 @@
## CHANGELOG
# CHANGELOG
A not so exhaustive list of changes for each release.

For a more detailed listing of changes between each version,
you can use the following url: https://github.com/ericsizemore/librariesio/compare/v1.0.0...v1.1.1.
you can use the following url: https://github.com/ericsizemore/librariesio/compare/v1.0.0...v2.0.0.

Simply replace the version numbers depending on which set of changes you wish to see.

### 1.1.1 (2024-03-14)

* Added PHP-CS-Fixer to dev dependencies.
## 2.0.0-dev (TBD, ~2024-04-01)

**NOTE:** Version 2.0.0 *should* be backwards compatible (for the most part) with 1.x.
However, if you make use of the `raw`, `toArray`, or `toObject` functions, please check the **CHANGED** section below.

### Changed

* The `LibrariesIO` constructor now takes a new option `$clientOptions` which is an array of options to pass to the Guzzle Client.
* Note, the class will ignore 'base_uri', 'http_errors', 'handler' and 'query' if passed into `$clientOptions`
* Changed unit tests to pass a `MockHandler` instance to the class (via `$clientOptions`), which is handled in the `AbstractClient` constructor, to ease mocking and testing.
* The `$client` property is now private.
* `raw`, `toArray`, `toObject` are no longer part of the main `LibrariesIO` class.
* They are instead in the `Utils` class and can be accessed statically:
* `Utils::raw()`, `Utils::toArray()`, `Utils::toObject()`
* The `LibrariesIO` class now only defines functions to access the API endpoints and leaves the rest of the work up to `AbstractClient` and `Utils`.
* `Exception\RateLimitExceededException` now takes `GuzzleHttp\Exception\ClientException` as a parameter.

### Added

* `AbstractClient` class which the main `LibrariesIO` class extends.
* `Utils` class which holds various useful static methods used throughout the library.
* New exceptions:
* Exception\InvalidApiKeyException
* Exception\InvalidEndpointException
* Exception\InvalidEndpointOptionsException

### Removed

* Removed the `$cachePath` property.
* Removed unnecessary comments throughout.


## 1.1.1 (2024-03-14)

### Changed

* Updated/refactored some code to reduce duplicate checks/etc. throughout.
* CS improvements/fixes.

### Added

* Added PHP-CS-Fixer to dev dependencies.

### Removed

* Cleaned up some doc blocks and removed some unnecessary comments.

### 1.1.0 (2023-12-29)

* Added `subscription()` to handle adding, updating, checking and removing a subscription to a project.
## 1.1.0 (2023-12-29)

### Changed

* Updated `makeRequest()` with a `$method` parameter to handle post, put, and delete requests in addition to get.
* Visibility changed to `protected` for:
* endpointParameters()
Expand All @@ -24,6 +67,15 @@ Simply replace the version numbers depending on which set of changes you wish to
* Converted line endings to linux, some files snuck through with Windows line endings
* Documentation updated

### 1.0.0 (2023-12-25)
### Added

* Added `subscription()` to handle adding, updating, checking and removing a subscription to a project.

### Removed

* None


## 1.0.0 (2023-12-25)

* Initial release
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ The MIT License (MIT)

The MIT License (MIT)

Copyright (c) 2023 Eric Sizemore
Copyright (c) 2023-2024 Eric Sizemore

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
[![Downloads per Month](https://img.shields.io/packagist/dm/esi/librariesio.svg)](https://packagist.org/packages/esi/librariesio)
[![License](https://img.shields.io/packagist/l/esi/librariesio.svg)](https://packagist.org/packages/esi/librariesio)

## 2.0.0 Important Note

* The `master` branch is for development of the upcoming version 2.0.0.
* Should be okay, but would still advise caution using in production.
* Function parameters, class api's, etc. may change during development.
* The [docs](docs) have not yet been updated with changes.

## Important Note

This project was born from the desire to expand my knowledge of API's and GuzzleHttp. My implementation is far from perfect, so I am open to any and all feedback that one may wish to provide.
Expand Down Expand Up @@ -87,11 +94,12 @@ As an example, let's say you want to get a list of the available platforms. To d
<?php

use Esi\LibrariesIO\LibrariesIO;
use Esi\LibrariesIO\Utils;

$api = new LibrariesIO('..yourapikey..', \sys_get_temp_dir());
$response = $api->platform();

print_r($api->toArray($response));
print_r(Utils::toArray($response));

/*
Array
Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

| Version | Supported |
|---------|--------------------|
| 2.0.x | :white_check_mark: |
| 1.1.x | :white_check_mark: |
| 1.0.x | :white_check_mark: |

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@
"phpstan/phpstan": "^1.11 <2.0",
"phpstan/phpstan-phpunit": "^1.4",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "^11"
"phpunit/phpunit": "^11.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Esi\\LibrariesIO\\": "src/"
Expand Down
Loading

0 comments on commit f381095

Please sign in to comment.