Skip to content

sweetrdf/IRI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRI (Fork)

Note

This is a fork of the Original IRI class written by Markus Lanthaler. I maintain it in my spare time to keep it alive and usable on the latest PHP versions. Code is more or less maintained but not developed any further. If you wanna participate, feel free to open a pull request!

This is a simple PHP class to ease IRI handling. Currently it just supports parsing of IRIs and relative IRI resolution.

With more than 800 tests, this class is extensively tested.

Installation

The easiest way to use IRI is to integrate it as a dependency in your project's composer.json file:

{
    "require": {
        "sweetrdf/iri": "^1"
    }
}

or run:

composer install sweetrdf/iri

Of course you can also just download an archive from Github.

Compatible with original ml/iri

This library is intented to be a drop-in replacement for the original ml/iri library. However, the IRI class was adapted to be more type safe:

  • Added declare(strict_types=1); to the file
  • Added explicit type information to each class property
  • Added explicit return value types to each class method

IRI does not throw an InvalidArgumentException anymore if an invalid value was given in the constructor! In this case PHP itself will complain.

Credits

Most test cases come either directly from the URI specification, from Graham Klyne's, or Tim Berners-Lee's test suite.

About

Fork of the PHP class easing URI/IRI handling

Resources

License

Stars

Watchers

Forks

Contributors

Languages

  • PHP 98.4%
  • Other 1.6%