From dbccc6f4427326b95216bd8bebbc6d2b229565c4 Mon Sep 17 00:00:00 2001 From: Eric Sizemore Date: Thu, 4 Apr 2024 03:48:58 -0400 Subject: [PATCH] more work on docs --- composer.lock | 114 +++++++++++++++++++++++----------------------- docs/changelog.md | 68 +++++++++++++++++++++------ docs/index.md | 23 +++++++--- 3 files changed, 128 insertions(+), 77 deletions(-) diff --git a/composer.lock b/composer.lock index be0268c..34fd043 100644 --- a/composer.lock +++ b/composer.lock @@ -774,16 +774,16 @@ }, { "name": "symfony/cache", - "version": "v7.0.4", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "fc822951dd360a593224bb2cef90a087d0dff60f" + "reference": "2d0d3f92c74c445410d05374908b03e0a1131e2b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/fc822951dd360a593224bb2cef90a087d0dff60f", - "reference": "fc822951dd360a593224bb2cef90a087d0dff60f", + "url": "https://api.github.com/repos/symfony/cache/zipball/2d0d3f92c74c445410d05374908b03e0a1131e2b", + "reference": "2d0d3f92c74c445410d05374908b03e0a1131e2b", "shasum": "" }, "require": { @@ -850,7 +850,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v7.0.4" + "source": "https://github.com/symfony/cache/tree/v7.0.6" }, "funding": [ { @@ -866,20 +866,20 @@ "type": "tidelift" } ], - "time": "2024-02-22T20:27:20+00:00" + "time": "2024-03-27T19:55:25+00:00" }, { "name": "symfony/cache-contracts", - "version": "v3.4.0", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/cache-contracts.git", - "reference": "1d74b127da04ffa87aa940abe15446fa89653778" + "reference": "2c9db6509a1b21dad229606897639d3284f54b2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/1d74b127da04ffa87aa940abe15446fa89653778", - "reference": "1d74b127da04ffa87aa940abe15446fa89653778", + "url": "https://api.github.com/repos/symfony/cache-contracts/zipball/2c9db6509a1b21dad229606897639d3284f54b2a", + "reference": "2c9db6509a1b21dad229606897639d3284f54b2a", "shasum": "" }, "require": { @@ -926,7 +926,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/cache-contracts/tree/v3.4.0" + "source": "https://github.com/symfony/cache-contracts/tree/v3.4.2" }, "funding": [ { @@ -942,7 +942,7 @@ "type": "tidelift" } ], - "time": "2023-09-25T12:52:38+00:00" + "time": "2024-01-23T14:51:35+00:00" }, { "name": "symfony/deprecation-contracts", @@ -1013,16 +1013,16 @@ }, { "name": "symfony/service-contracts", - "version": "v3.4.1", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/service-contracts.git", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0" + "reference": "11bbf19a0fb7b36345861e85c5768844c552906e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/service-contracts/zipball/fe07cbc8d837f60caf7018068e350cc5163681a0", - "reference": "fe07cbc8d837f60caf7018068e350cc5163681a0", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/11bbf19a0fb7b36345861e85c5768844c552906e", + "reference": "11bbf19a0fb7b36345861e85c5768844c552906e", "shasum": "" }, "require": { @@ -1075,7 +1075,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/service-contracts/tree/v3.4.1" + "source": "https://github.com/symfony/service-contracts/tree/v3.4.2" }, "funding": [ { @@ -1091,26 +1091,28 @@ "type": "tidelift" } ], - "time": "2023-12-26T14:02:43+00:00" + "time": "2023-12-19T21:51:00+00:00" }, { "name": "symfony/var-exporter", - "version": "v7.0.4", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/var-exporter.git", - "reference": "dfb0acb6803eb714f05d97dd4c5abe6d5fa9fe41" + "reference": "c74c568d2a15a1d407cf40d61ea82bc2d521e27b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-exporter/zipball/dfb0acb6803eb714f05d97dd4c5abe6d5fa9fe41", - "reference": "dfb0acb6803eb714f05d97dd4c5abe6d5fa9fe41", + "url": "https://api.github.com/repos/symfony/var-exporter/zipball/c74c568d2a15a1d407cf40d61ea82bc2d521e27b", + "reference": "c74c568d2a15a1d407cf40d61ea82bc2d521e27b", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { + "symfony/property-access": "^6.4|^7.0", + "symfony/serializer": "^6.4|^7.0", "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", @@ -1149,7 +1151,7 @@ "serialize" ], "support": { - "source": "https://github.com/symfony/var-exporter/tree/v7.0.4" + "source": "https://github.com/symfony/var-exporter/tree/v7.0.6" }, "funding": [ { @@ -1165,7 +1167,7 @@ "type": "tidelift" } ], - "time": "2024-02-26T10:35:24+00:00" + "time": "2024-03-20T21:25:22+00:00" } ], "packages-dev": [ @@ -2809,16 +2811,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.27.0", + "version": "1.28.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "86e4d5a4b036f8f0be1464522f4c6b584c452757" + "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/86e4d5a4b036f8f0be1464522f4c6b584c452757", - "reference": "86e4d5a4b036f8f0be1464522f4c6b584c452757", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", + "reference": "cd06d6b1a1b3c75b0b83f97577869fd85a3cd4fb", "shasum": "" }, "require": { @@ -2850,9 +2852,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.27.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.28.0" }, - "time": "2024-03-21T13:14:53+00:00" + "time": "2024-04-03T18:51:33+00:00" }, { "name": "phpstan/phpstan", @@ -2860,12 +2862,12 @@ "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "8b3a589eada974f42733255a21bbce4f03a01711" + "reference": "f21d7d8092aa0bd0804d802f3580af93582990fd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/8b3a589eada974f42733255a21bbce4f03a01711", - "reference": "8b3a589eada974f42733255a21bbce4f03a01711", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f21d7d8092aa0bd0804d802f3580af93582990fd", + "reference": "f21d7d8092aa0bd0804d802f3580af93582990fd", "shasum": "" }, "require": { @@ -2915,7 +2917,7 @@ "type": "tidelift" } ], - "time": "2024-03-28T16:04:02+00:00" + "time": "2024-04-04T07:42:38+00:00" }, { "name": "phpstan/phpstan-phpunit", @@ -2976,12 +2978,12 @@ "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "d0dc2f0a6caf4ca2fcb837fb071e7452759a4847" + "reference": "b5233d58637aadee4428961365196b205b557844" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/d0dc2f0a6caf4ca2fcb837fb071e7452759a4847", - "reference": "d0dc2f0a6caf4ca2fcb837fb071e7452759a4847", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/b5233d58637aadee4428961365196b205b557844", + "reference": "b5233d58637aadee4428961365196b205b557844", "shasum": "" }, "require": { @@ -3018,7 +3020,7 @@ "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", "source": "https://github.com/phpstan/phpstan-strict-rules/tree/1.6.x" }, - "time": "2024-03-24T08:12:48+00:00" + "time": "2024-04-03T12:37:37+00:00" }, { "name": "phpunit/php-code-coverage", @@ -4613,16 +4615,16 @@ }, { "name": "symfony/console", - "version": "v7.0.4", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "6b099f3306f7c9c2d2786ed736d0026b2903205f" + "reference": "fde915cd8e7eb99b3d531d3d5c09531429c3f9e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/6b099f3306f7c9c2d2786ed736d0026b2903205f", - "reference": "6b099f3306f7c9c2d2786ed736d0026b2903205f", + "url": "https://api.github.com/repos/symfony/console/zipball/fde915cd8e7eb99b3d531d3d5c09531429c3f9e5", + "reference": "fde915cd8e7eb99b3d531d3d5c09531429c3f9e5", "shasum": "" }, "require": { @@ -4686,7 +4688,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.0.4" + "source": "https://github.com/symfony/console/tree/v7.0.6" }, "funding": [ { @@ -4702,7 +4704,7 @@ "type": "tidelift" } ], - "time": "2024-02-22T20:27:20+00:00" + "time": "2024-04-01T11:04:53+00:00" }, { "name": "symfony/event-dispatcher", @@ -4786,16 +4788,16 @@ }, { "name": "symfony/event-dispatcher-contracts", - "version": "v3.4.0", + "version": "v3.4.2", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher-contracts.git", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df" + "reference": "4e64b49bf370ade88e567de29465762e316e4224" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/a76aed96a42d2b521153fb382d418e30d18b59df", - "reference": "a76aed96a42d2b521153fb382d418e30d18b59df", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/4e64b49bf370ade88e567de29465762e316e4224", + "reference": "4e64b49bf370ade88e567de29465762e316e4224", "shasum": "" }, "require": { @@ -4842,7 +4844,7 @@ "standards" ], "support": { - "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.0" + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.4.2" }, "funding": [ { @@ -4858,20 +4860,20 @@ "type": "tidelift" } ], - "time": "2023-05-23T14:45:45+00:00" + "time": "2024-01-23T14:51:35+00:00" }, { "name": "symfony/filesystem", - "version": "v7.0.3", + "version": "v7.0.6", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12" + "reference": "408105dff4c104454100730bdfd1a9cdd993f04d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/2890e3a825bc0c0558526c04499c13f83e1b6b12", - "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/408105dff4c104454100730bdfd1a9cdd993f04d", + "reference": "408105dff4c104454100730bdfd1a9cdd993f04d", "shasum": "" }, "require": { @@ -4905,7 +4907,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.0.3" + "source": "https://github.com/symfony/filesystem/tree/v7.0.6" }, "funding": [ { @@ -4921,7 +4923,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T15:02:46+00:00" + "time": "2024-03-21T19:37:36+00:00" }, { "name": "symfony/finder", diff --git a/docs/changelog.md b/docs/changelog.md index 4a012ec..a0eee62 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,28 +1,66 @@ -# CHANGELOG -A not so exhaustive list of changes for each release. +# Changelog -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...v2.0.0. +All notable changes to this project will be documented in this file. -Simply replace the version numbers depending on which set of changes you wish to see. +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## 1.1.1 (2024-03-14) + +## [Unreleased] + +**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. + +### 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 + * `vimeo/psalm` as a dev dependency ### Changed - * Updated/refactored some code to reduce duplicate checks/etc. throughout. - * CS improvements/fixes. + * 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. + * Fixes to both code and docblocks/etc. throughout per Psalm. + +### Removed + + * Removed the `$cachePath` property. + * Removed unnecessary comments throughout. + + +## [1.1.1] - 2024-03-14 ### Added * Added PHP-CS-Fixer to dev dependencies. +### Changed + + * Updated/refactored some code to reduce duplicate checks/etc. throughout. + * CS improvements/fixes. + ### Removed * Cleaned up some doc blocks and removed some unnecessary comments. -## 1.1.0 (2023-12-29) +## [1.1.0] - 2023-12-29 + +### Added + + * Added `subscription()` to handle adding, updating, checking and removing a subscription to a project. ### Changed @@ -34,15 +72,17 @@ 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 -### Added - - * Added `subscription()` to handle adding, updating, checking and removing a subscription to a project. - ### Removed * None -## 1.0.0 (2023-12-25) +## [1.0.0] - 2023-12-25 * Initial release + + +[unreleased]: https://github.com/ericsizemore/librariesio/tree/master +[1.1.1]: https://github.com/ericsizemore/librariesio/releases/tag/v1.1.1 +[1.1.0]: https://github.com/ericsizemore/librariesio/releases/tag/v1.1.0 +[1.0.0]: https://github.com/ericsizemore/librariesio/releases/tag/v1.0.0 \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index a03540c..63b6cff 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,16 +1,25 @@ # LibrariesIO - A simple API wrapper/client for the Libraries.io API. -[![PHPMD](https://github.com/ericsizemore/librariesio/actions/workflows/phpmd.yml/badge.svg)](https://github.com/ericsizemore/librariesio/actions/workflows/phpmd.yml) -[![PHPStan](https://github.com/ericsizemore/librariesio/actions/workflows/main.yml/badge.svg)](https://github.com/ericsizemore/librariesio/actions/workflows/main.yml) -[![Psalm Security Scan](https://github.com/ericsizemore/librariesio/actions/workflows/psalm.yml/badge.svg)](https://github.com/ericsizemore/librariesio/actions/workflows/psalm.yml) -[![Tests](https://github.com/ericsizemore/librariesio/actions/workflows/tests.yml/badge.svg)](https://github.com/ericsizemore/librariesio/actions/workflows/tests.yml) -[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ericsizemore/librariesio/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ericsizemore/librariesio/?branch=master) +[![Build Status](https://scrutinizer-ci.com/g/ericsizemore/librariesio/badges/build.png?b=master)](https://scrutinizer-ci.com/g/ericsizemore/librariesio/build-status/master) [![Code Coverage](https://scrutinizer-ci.com/g/ericsizemore/librariesio/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/ericsizemore/librariesio/?branch=master) - +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/ericsizemore/librariesio/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/ericsizemore/librariesio/?branch=master) +[![Tests](https://github.com/ericsizemore/librariesio/actions/workflows/tests.yml/badge.svg)](https://github.com/ericsizemore/librariesio/actions/workflows/tests.yml) +[![PHPStan](https://github.com/ericsizemore/librariesio/actions/workflows/main.yml/badge.svg)](https://github.com/ericsizemore/librariesio/actions/workflows/main.yml) +[![Psalm Static analysis](https://github.com/ericsizemore/librariesio/actions/workflows/psalm.yml/badge.svg?branch=master)](https://github.com/ericsizemore/librariesio/actions/workflows/psalm.yml) +[![PHPMD](https://github.com/ericsizemore/librariesio/actions/workflows/phpmd.yml/badge.svg)](https://github.com/ericsizemore/librariesio/actions/workflows/phpmd.yml) +[![Type Coverage](https://shepherd.dev/github/ericsizemore/librariesio/coverage.svg)](https://shepherd.dev/github/ericsizemore/librariesio) +[![Psalm Level](https://shepherd.dev/github/ericsizemore/librariesio/level.svg)](https://shepherd.dev/github/ericsizemore/librariesio) [![Latest Stable Version](https://img.shields.io/packagist/v/esi/librariesio.svg)](https://packagist.org/packages/esi/librariesio) [![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. @@ -37,7 +46,7 @@ require 'vendor/autoload.php'; ?> ``` -For more information see the [installation](docs/installation.md) docs. +For more information see the [installation](installation.md) docs. ## Basic Usage