Skip to content

Commit

Permalink
Merge branch 'release/1.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
stelgenhof committed Jan 3, 2024
2 parents ce8fba5 + 1fc1e9d commit 0a7319e
Show file tree
Hide file tree
Showing 24 changed files with 385 additions and 175 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/coding-standard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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') }}
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/mutation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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') }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ env:

jobs:
stale:

runs-on: "ubuntu-latest"

steps:
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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') }}
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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') }}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea/
.php-cs-fixer.cache
.phpactor.json
.phpunit.cache
.phpunit.result.cache
composer.lock
Expand Down
2 changes: 1 addition & 1 deletion .phan/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 39 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php

declare(strict_types=1);
/**
* This file is part of the WAQI (World Air Quality Index) package.
*
* Copyright (c) 2017 - 2024 AzuyaLabs
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* @author Sacha Telgenhof <me at sachatelgenhof dot com>
*/

$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;
32 changes: 0 additions & 32 deletions .php-cs-fixer.php

This file was deleted.

33 changes: 23 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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]

Expand All @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
```
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<?php
Expand Down Expand Up @@ -71,7 +71,7 @@ measurement. It contains 4 elements:

Example output (for 'New York'):

```
```shell
- 'aqi': 15
- 'pollution_level': Good
- 'health_implications': Air quality is considered satisfactory, and air pollution poses little or no risk.
Expand Down Expand Up @@ -109,7 +109,7 @@ Secondly, the API method `getAttributions()` will return a list of EPA attributi

Other API methods that provide additional information, are:

- `getMeasurementTime()`: returns the date/time the last measurement was taken. (as a DateTime object).
- `getMeasurementTime()`: returns the date/time the last measurement was taken. (as a `DateTime` object).
- `getHumidity()`: returns the humidity (in %) measured at this monitoring station at the time of measurement.
- `getTemperature()`: returns the temperature (in degrees Celsius) measured at this monitoring station at the time of
measurement.
Expand All @@ -127,20 +127,20 @@ Please see [CHANGELOG](CHANGELOG.md) for more information what has changed.
This package comes with a [PHPUnit](https://phpunit.de) test suite. To run the tests, run the following command from the
project directory:

``` bash
$ composer test
```shell
composer test
```

or alternatively run with:
,or alternatively run with:

``` bash
$ vendor/bin/phpunit
```shell
vendor/bin/phpunit
```

## Contributing

Contributions are encouraged and welcome; I am always happy to get feedback or pull requests on GitHub :)
Create [Github Issues](https://github.com/azuyalabs/waqi/issues) for bugs and new features and comment on the ones you
Create [GitHub Issues](https://github.com/azuyalabs/waqi/issues) for bugs and new features and comment on the ones you
are interested in.

If you enjoy what I am making, an extra cup of coffee is very much appreciated :). Your support helps me to put more
Expand Down
Loading

0 comments on commit 0a7319e

Please sign in to comment.