PHPackages                             esperecyan/webidl - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. esperecyan/webidl

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

esperecyan/webidl
=================

Provides the utility class for casting a given value in accordance with WebIDL (Web IDL) type to help with PHP type declarations. / WebIDL (Web IDL) の型に沿うように、与えられた値をキャストするユーティリティクラスを提供し、PHP の型宣言を補助します。

v2.3.0(3y ago)08.3k1[1 PRs](https://github.com/esperecyan/webidl/pulls)2MPL-2.0PHPPHP &gt;=5.4CI passing

Since Jun 20Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/esperecyan/webidl)[ Packagist](https://packagist.org/packages/esperecyan/webidl)[ Docs](https://github.com/esperecyan/webidl)[ GitHub Sponsors](https://github.com/esperecyan)[ RSS](/packages/esperecyan-webidl/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (7)Dependencies (4)Versions (13)Used By (2)

English / [日本語](README.ja.md)

Web IDL
=======

[](#web-idl)

Provides the utility class for casting a given value in accordance with [WebIDL (Web IDL)](https://www.w3.org/TR/WebIDL-1/ "This document defines an interface definition language, Web IDL, that can be used to describe interfaces that are intended to be implemented in web browsers.") type to help with PHP type declarations.

Description
-----------

[](#description)

This library makes [type declarations help API](#type-declarations-help-api) and the exceptions defined by Web IDL available in PHP. This library is for Web standards API implementors and is not intended to be used directly by a PHP project.

If you want your users to install this library simultaneously with your library, append `"esperecyan/webidl": "^2.1.0"` to [require property](https://getcomposer.org/doc/01-basic-usage.md#the-require-key "require takes an object that maps package names to package versions.") in [composer.json](https://getcomposer.org/doc/01-basic-usage.md#composer-json-project-setup "This file describes the dependencies of your project and may contain other metadata as well.") of your library, such as the following.

```
{
	"name": "esperecyan/url",
	"description": "Makes the algorithms and APIs defined by URL Standard available on PHP.",
	"require": {
		"php": ">=7.4",
		"esperecyan/webidl": "^2.1.0"
	},
	"autoload": {
		"psr-4": {
			"esperecyan\\url\\": "src/"
		}
	},
}
```

For details of Composer, see [Composer documentation](https://getcomposer.org/doc/00-intro.md "Composer is a tool for dependency management in PHP. It allows you to declare the dependent libraries your project needs and it will install them in your project for you.").

Example
-------

[](#example)

```
