diff --git a/.github/workflows/coding-standard.yml b/.github/workflows/coding-standard.yml index ecb82bf..ccd5f45 100644 --- a/.github/workflows/coding-standard.yml +++ b/.github/workflows/coding-standard.yml @@ -11,8 +11,8 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ ubuntu-latest, windows-latest, macOS-latest ] - php-versions: [ '8.0', '8.1', '8.2' ] + operating-system: [ubuntu-latest, windows-latest, macOS-latest] + php-versions: ["8.2", "8.3"] steps: - name: Set git to use LF @@ -21,9 +21,7 @@ jobs: git config --global core.eol lf - name: Checkout - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 1 + uses: actions/checkout@v3 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -36,7 +34,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache Composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/.github/workflows/mutation-tests.yml b/.github/workflows/mutation-tests.yml index 45bb3ba..5df8b8b 100644 --- a/.github/workflows/mutation-tests.yml +++ b/.github/workflows/mutation-tests.yml @@ -11,8 +11,8 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ ubuntu-latest ] - php-versions: [ '8.0', '8.1', '8.2' ] + operating-system: [ubuntu-latest] + php-versions: ["8.2", "8.3"] steps: - name: Set git to use LF @@ -21,9 +21,7 @@ jobs: git config --global core.eol lf - name: Checkout - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 1 + uses: actions/checkout@v3 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -36,7 +34,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache Composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 93f0cd0..710271f 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -10,7 +10,6 @@ env: jobs: stale: - runs-on: "ubuntu-latest" steps: diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 62f0c14..b280b6c 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -11,8 +11,8 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ ubuntu-latest, windows-latest, macOS-latest ] - php-versions: ['8.0', '8.1', '8.2' ] + operating-system: [ubuntu-latest, windows-latest, macOS-latest] + php-versions: ["8.2", "8.3"] steps: - name: Set git to use LF @@ -21,9 +21,7 @@ jobs: git config --global core.eol lf - name: Checkout - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 1 + uses: actions/checkout@v3 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -36,7 +34,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache Composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index fc5f94c..08403c3 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -11,8 +11,8 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ ubuntu-latest, windows-latest, macOS-latest ] - php-versions: [ '8.0', '8.1', '8.2' ] + operating-system: [ubuntu-latest, windows-latest, macOS-latest] + php-versions: ["8.2", "8.3"] steps: - name: Set git to use LF @@ -21,9 +21,7 @@ jobs: git config --global core.eol lf - name: Checkout - uses: actions/checkout@v2.3.4 - with: - fetch-depth: 1 + uses: actions/checkout@v3 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -36,7 +34,7 @@ jobs: run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache Composer dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/.gitignore b/.gitignore index 9aeb980..09b36b9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .idea/ .php-cs-fixer.cache +.phpactor.json .phpunit.cache .phpunit.result.cache composer.lock diff --git a/.phan/config.php b/.phan/config.php index 6e546fd..e791ec6 100644 --- a/.phan/config.php +++ b/.phan/config.php @@ -51,7 +51,7 @@ // Note that the **only** effect of choosing `'5.6'` is to infer that functions removed in php 7.0 exist. // (See `backward_compatibility_checks` for additional options) // Automatically inferred from composer.json requirement for "php" of "^7.4 || ^8.0" - 'target_php_version' => '8.0', + 'target_php_version' => '8.2', // If enabled, missing properties will be created when // they are first seen. If false, we'll report an diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..2f04070 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,39 @@ + + */ + +$finder = PhpCsFixer\Finder::create()->in(__DIR__)->notPath('var'); + +$config = new PhpCsFixer\Config(); +$config->setRiskyAllowed(true)->setRules([ + '@Symfony' => true, + '@PER' => true, + 'combine_consecutive_issets' => true, + 'combine_consecutive_unsets' => true, + 'ordered_class_elements' => true, + 'no_superfluous_elseif' => true, + 'no_superfluous_phpdoc_tags' => ['remove_inheritdoc' => true], + 'not_operator_with_successor_space' => true, + + // Risky + 'declare_strict_types' => true, + 'dir_constant' => true, + 'get_class_to_class_keyword' => true, + 'is_null' => true, + 'modernize_strpos' => true, + 'modernize_types_casting' => true, + 'native_constant_invocation' => ['strict' => false], + 'self_accessor' => true, +])->setFinder($finder); + +return $config; diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php deleted file mode 100644 index b6fec6f..0000000 --- a/.php-cs-fixer.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ - -$finder = PhpCsFixer\Finder::create()->in(__DIR__)->notPath('var'); - -$config = new PhpCsFixer\Config(); -$config->setRiskyAllowed(true)->setRules([ - '@Symfony' => true, - 'blank_line_after_opening_tag' => true, - 'is_null' => true, - 'modernize_types_casting' => true, - 'self_accessor' => true, - 'dir_constant' => true, - 'ordered_class_elements' => true, - 'declare_strict_types' => true, - 'no_superfluous_elseif' => true, - 'combine_consecutive_issets' => true, - 'combine_consecutive_unsets' => true, -])->setFinder($finder); - -return $config; diff --git a/CHANGELOG.md b/CHANGELOG.md index 26f0c90..ab3b90e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ -# Change Log +# Changelog All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres -to [Semantic Versioning](http://semver.org). +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] @@ -15,6 +15,22 @@ to [Semantic Versioning](http://semver.org). ### Removed +## [1.2.1] - 2024-01-03 + +### Added + +- PHP 8.3 Support. + +### Changed + +- Updated copyright year. +- Simplify the code making it more concise and readable. +- Refactor code for improved readability and consistency. + +### Removed + +- PHP 8.1 Support. + ## [1.2.0] 2023-02-23 ### Added @@ -88,7 +104,7 @@ to [Semantic Versioning](http://semver.org). monitoring station doesn't measure these. - Minimum requirement for PHP to 7.1.0 - Updated package versions for PHPStan, Mockery and PHPUnit. -- Updated inline documentation (various). +- Updated in-line documentation (various). ### Fixed @@ -97,18 +113,15 @@ to [Semantic Versioning](http://semver.org). ### Removed - Removed type casting as variables are already of proper data type. -- Removed invalid syntaxCheck parameter from the PHPUnit XML configuration. +- Removed invalid `syntaxCheck` parameter from the PHPUnit XML configuration. ## [1.0.0] 2017-02-15 - Initial release -[Unreleased]: https://github.com/azuyalabs/waqi/compare/1.2.0...HEAD - +[Unreleased]: https://github.com/azuyalabs/waqi/compare/1.2.1...HEAD +[1.2.1]: https://github.com/azuyalabs/waqi/compare/1.2.0...1.2.1 [1.2.0]: https://github.com/azuyalabs/waqi/compare/1.1.0...1.2.0 - [1.1.0]: https://github.com/azuyalabs/waqi/compare/1.0.1...1.1.0 - [1.0.1]: https://github.com/azuyalabs/waqi/compare/1.0.0...1.0.1 - [1.0.0]: https://github.com/azuyalabs/waqi/releases/tag/1.0.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1037943..2e2b552 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -10,8 +10,8 @@ When contributing there are a few guidelines I would like you to keep in mind: - **[PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)** Please use the following command after you have completed your work: - ``` bash - $ composer format + ```shell + composer format ``` This will check/correct all the code for the PSR-12 Coding Standard using the @@ -31,12 +31,12 @@ When contributing there are a few guidelines I would like you to keep in mind: ## Running Tests -``` bash -$ composer test +```shell +composer test ``` -or alternatively run with: +,or alternatively run with: -``` bash -$ vendor/bin/phpunit +```shell +vendor/bin/phpunit ``` diff --git a/LICENSE b/LICENSE index e927677..6dc9f4f 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 - 2023 AzuyaLabs +Copyright (c) 2017 - 2024 AzuyaLabs Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 85c73f5..f7721a0 100644 --- a/README.md +++ b/README.md @@ -12,23 +12,23 @@ This packages makes it easy to retrieve the Air Quality Index for your area and data feed (API) of the WAQI project. Note: To make use of this package (and the underlying AQI API) an access token is required. You can acquire your token -here: https://aqicn.org/data-platform/token. +here: [https://aqicn.org/data-platform/token.](https://aqicn.org/data-platform/tokeni). ## System Requirements -You need *PHP >= 8.0* to use 'azuyalabs/waqi'. +You need _PHP >= 8.2_ to use `azuyalabs/waqi`. ## Installation You can pull in this package via composer: -``` bash -$ composer require azuyalabs/waqi +```shell +composer require azuyalabs/waqi ``` ## Usage -Start with including the Composer autoload file in your project: +Start with including the Composer `autoload` file in your project: ```php --> - - - - - tests - - - - - src/ - - + + + + src/ + + + + + tests + + diff --git a/psalm.xml.dist b/psalm.xml.dist index c152451..e356627 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -2,7 +2,7 @@