use-php-namespace 0.0.1

PHP namespace metadata primitives for RustUse.
Documentation
  • Coverage
  • 15.63%
    5 out of 32 items documented1 out of 28 items with examples
  • Size
  • Source code size: 9.9 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 833.49 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-namespace

PHP namespace metadata primitives for RustUse.

Experimental

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

Example

use use_php_namespace::{PhpFullyQualifiedName, PhpNamespaceAlias, PhpNamespacePath};

let namespace = PhpNamespacePath::new("App\\Http\\Controller")?;
let name = PhpFullyQualifiedName::new("\\App\\Http\\Controller\\HomeController")?;
let alias = PhpNamespaceAlias::new("HomeController")?;

assert_eq!(namespace.segments(), vec!["App", "Http", "Controller"]);
assert_eq!(name.to_string(), "\\App\\Http\\Controller\\HomeController");
assert_eq!(alias.as_str(), "HomeController");
# Ok::<(), use_php_namespace::PhpNamespaceError>(())

Scope

  • Namespace paths, fully qualified names, relative names, aliases/imports, and global namespace metadata.

Non-goals

  • Name resolution, autoloading, filesystem mapping, or symbol indexing.

License

Licensed under either Apache-2.0 or MIT.