• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlocati / ip-lib / 13131091430
99%
master: 99%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 04 Feb 2025 08:17AM UTC
Jobs 1
Files 16
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Feb 2025 08:16AM UTC coverage: 98.552% (-0.07%) from 98.622%
13131091430

push

github

web-flow
Add `split` and `getNetworkPrefix` to IP ranges (#93)

* [feat] add method split to range ips, to convert range smaller range

* [refactor] change split method to array

* [style]

* [refactor] delete interface split

* [test] add test

* [style]

* [test] php 5.3, 5.4, 5.5 compatibility

* Describe the type of the result of the split method

* Be sure that we receive an int as the argument of the split method

* Always run all tests

* Fix and simplify tests

* Use Coveralls only for the mlocati's repo

* Simplify "if" statements

* Document that split() can throw a \RuntimeException

* Optimization + accept a network prefix that's the same as the range's one

* Use OutOfBoundsException if $networkPrefix is invalid

* Check maximum range sizes for 32-bit systems

* Fix running Coveralls

* [feat] handle pattern range and update DocBlock

* [fix] move split method to single class

* [fix] fix class pattern

* [chore] update return type

* [test] add single test and pattern test

* [style] add readme

* [style]

* Add getNetworkPrefix() to RangeInterface

This implies checking $networkPrefix for Single::split() too, without efforts

* Add $forceSubnet parameter, test overflow for 64-bit systems too

* Fix coding style

* Improve documentation about the split() method

* Add @since to split()

---------

Co-authored-by: Michele Locati <michele@locati.it>

28 of 29 new or added lines in 2 files covered. (96.55%)

885 of 898 relevant lines covered (98.55%)

222.74 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
97.06
-2.94% src/Range/Single.php
Jobs
ID Job ID Ran Files Coverage
1 13131091430.1 04 Feb 2025 08:17AM UTC 16
98.55
GitHub Action Run
Source Files on build 13131091430
  • Tree
  • List 16
  • Changed 9
  • Source Changed 0
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 86ec0cff on github
  • Prev Build on main (#12259366166)
  • Next Build on main (#13137250770)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc