Skip to content

Commit

Permalink
Merge branch 'release/4.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
zanbaldwin committed May 19, 2022
2 parents accf8ea + 636e8f3 commit 5dcd303
Show file tree
Hide file tree
Showing 58 changed files with 2,853 additions and 643 deletions.
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
* text=auto

/.github/ export-ignore
/docs/ export-ignore
/tests/ export-ignore
/mkdocs.yaml export-ignore
32 changes: 32 additions & 0 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: "Static Analysis"

on:
pull_request:
branches:
- 'develop'
push:
branches:
- 'develop'
- 'master'

jobs:

psalm:
runs-on: 'ubuntu-20.04'
strategy:
matrix:
php:
- '8.1'
steps:
- uses: 'actions/checkout@v2'
- uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php }}'
- uses: 'ramsey/composer-install@v2'
with:
dependency-versions: 'highest'
# Require vimeo/psalm via command-line instead of adding to Composer's
# "require-dev"; we only want to run static analysis once on the highest
# version of PHP available. Also, Psalm on 5.6? No, thank you.
- run: 'composer require --dev vimeo/psalm'
- run: './vendor/bin/psalm --config="tests/psalm.xml" --threads="$(nproc)" --php-version="5.6" --no-cache --stats --show-info=false --output-format="github"'
55 changes: 55 additions & 0 deletions .github/workflows/testing.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: "Linting and Unit Tests"

on:
pull_request:
branches:
- 'develop'
push:
branches:
- 'develop'
- 'master'

jobs:

syntax-linting:
runs-on: 'ubuntu-20.04'
strategy:
matrix:
php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
steps:
- uses: 'actions/checkout@v2'
- uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php }}'
- run: 'find src/ -type f -name "*.php" -print0 | xargs -0 -n1 -P4 php -l -n | (! grep -v "No syntax errors detected" )'

unit-testing:
runs-on: 'ubuntu-20.04'
strategy:
matrix:
php:
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
- '8.1'
steps:
- uses: 'actions/checkout@v2'
- uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php }}'
- uses: 'ramsey/composer-install@v2'
with:
dependency-versions: 'highest'
- run: './vendor/bin/phpunit --bootstrap="tests/bootstrap.php" --test-suffix="Test.php" tests'
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/build/
/.idea/
/build/
/gh-pages/
/vendor/
# Because this library will never be the root package, don't commit Composer's lock file.
/composer.lock
37 changes: 0 additions & 37 deletions .travis.yml

This file was deleted.

41 changes: 41 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Darsyn IP

## `4.2.0`

- Added `IpInterface::equals()` method for comparing two IP addresses.
- Added `getCommonCidr(IpInterface $ip): int` for determining how in range two
IP addresses are according to their common CIDR value.
- Added `isBenchmarking()`, `isDocumentation()`, and `isPublicUse()` type
methods for both IPv4 and IPv6 addresses.
- Added `isBroadcast()`, `isShared()`, and `isFutureReserved()` type methods for
IPv4 addresses.
- Added `getMulticastScope()`, `isUniqueLocal()`, `isUnicast()`, and
`isUnicastGlobal()` type methods for IPv6 addresses.
- Added `Ipv6::fromEmbedded()` factory method to create an instance of an
IPv4-embedded address as IPv6 instead of Multi.
- Made internal helper methods for dealing with binary data into utility
classes: `Darsyn\IP\Util\Binary` and `Darsyn\IP\Util\MbString`.
- Complete documentation overhaul
- Increase test coverage.
- Started using static analysis both locally and via GitHub actions.
- Documentation and tests are excluded from the Git archive to reduce download
size when installing Composer dependency as dist.
- Updated Code of Conduct to Contributor Covenant v2.1

## `4.0.2`

- Add return types to DocComments to prevent
[`symfony/error-handler`](https://github.com/symfony/symfony/tree/5.4/src/Symfony/Component/ErrorHandler)
from throwing deprecation errors

## `4.0.1`

- Add Code of Conduct to project.
- Add new internal helper for dealing with binary strings.
- Add namespace indicator to function calls to speed up symbol resolution.
- Add `__toString()` to IP objects.
- Update unit tests, now runnable on all PHP versions 5.6 to 8.1

## `4.0.0`

- Complete rewrite of library.
40 changes: 20 additions & 20 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.
nationality, personal appearance, race, caste, color, religion, or sexual
identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.
Expand All @@ -22,17 +22,17 @@ community include:
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community
* Focusing on what is best not just for us as individuals, but for the overall
community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* The use of sexualized language or imagery, and sexual attention or advances of
any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Publishing others' private information, such as a physical or email address,
without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

Expand Down Expand Up @@ -82,15 +82,15 @@ behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.
**Community Impact**: A violation through a single incident or series of
actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.
like social media. Violating these terms may lead to a temporary or permanent
ban.

### 3. Temporary Ban

Expand All @@ -106,27 +106,27 @@ Violating these terms may lead to a permanent ban.
### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.
**Consequence**: A permanent ban from any sort of public interaction within the
community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
[https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0].
version 2.1, available at
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].

Community Impact Guidelines were inspired by
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].

For answers to common questions about this code of conduct, see the FAQ at
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available
at [https://www.contributor-covenant.org/translations][translations].
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
[https://www.contributor-covenant.org/translations][translations].

[homepage]: https://www.contributor-covenant.org
[v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[![Build Status](https://app.travis-ci.com/darsyn/ip.svg?branch=develop "Build Status Badge")](https://app.travis-ci.com/darsyn/ip)

IP is an immutable value object for (both version 4 and 6) IP addresses. Several
helper methods are provided for ranges, broadcast and network addresses, subnet
masks, whether an IP is a certain type (defined by RFC's), etc.
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
},
"require-dev": {
"ext-pdo": "*",
"doctrine/dbal": "^2.3"
"doctrine/dbal": "^2.3",
"phpunit/phpunit": "*"
},
"prefer-stable": true,
"config": {
Expand Down
16 changes: 7 additions & 9 deletions docs/02-installation.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
## Installation
# Installation

### System Requirements
## System Requirements

- This library will not support end-of-life PHP versions, therefore only PHP
5.6+ is supported. You can expect support for 7.0+ only commencing 1st January
2019.
- All functionality can be implemented without using new language features, so
this library will support PHP versions `5.6` onwards.
- This library cannot be used on 32-bits systems due to a dependency on the
in-built PHP functions `inet_pton` and `inet_ntop`. This dependency may be
circumvented in a future version but is not guaranteed.
in-built PHP functions `inet_pton` and `inet_ntop`.

### Install
## Install

The library is available on [Packagist](https://packagist.org/packages/darsyn/ip)
and should be installed using [Composer](https://getcomposer.org/). This can be
done by running the following command on a composer installed box:
done by running the following command:

```bash
$ composer require darsyn/ip
Expand Down
Loading

0 comments on commit 5dcd303

Please sign in to comment.