use-php-type 0.0.1

PHP type metadata primitives for RustUse.
Documentation
  • Coverage
  • 12%
    6 out of 50 items documented1 out of 17 items with examples
  • Size
  • Source code size: 11.83 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 716.32 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 2s Average build duration of successful builds.
  • all releases: 2s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • RustUse/use-php
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-php-type

PHP type metadata primitives for RustUse.

Experimental

use-php-type is experimental while use-php remains below 0.3.0.

Example

use use_php_type::{PhpScalarType, PhpType, PhpTypeName};

let dto = PhpType::named(PhpTypeName::new("App\\Dto\\UserData")?);
let union = PhpType::union(vec![PhpType::scalar(PhpScalarType::String), dto])?;

assert_eq!(union.kind().as_str(), "union");
assert_eq!(union.to_string(), "string|App\\Dto\\UserData");
# Ok::<(), use_php_type::PhpTypeError>(())

Scope

  • Scalar, nullable, union, intersection, mixed, never, void, callable, iterable, object, and class-like type labels.

Non-goals

  • Type checking, variance, generics, PHPStan/Psalm parsing, or runtime reflection.

License

Licensed under either Apache-2.0 or MIT.