Lue dans les fichiers PHP du paquet au commit add501303bcb : ses espaces de noms, classes, interfaces et énumérations, leurs constantes, propriétés et méthodes publiques avec leur PHPDoc, et les options que prennent ses fabriques. Rien n’en est exécuté.
CodataSourceclassThe fundamental physical constants of CODATA, as NIST publishes them (physics.nist.gov/cuu/Constants): each constant an entity - the proton mass, the speed of light in vacuum, the Newtonian constant of gravitation... -, by NIST's short name ("mp", "c", "bg") or its name, with its value, standard uncertainty and unit (a Quantity), whether it is exact, the value as NIST writes it, and the adjustment it comes from (2022); a search by words of their names.
5 methods · 3 constants
CodataSourceFactoryclassCODATA's fundamental physical constants, as NIST publishes them: each constant by its short name or its name, its value, uncertainty and unit; a search - no key needed, two calls in all.
2 options
Omnilab\Codata
CodataSource class
final class CodataSource extends HttpSource CodataSource.php:32
The fundamental physical constants of CODATA, as NIST publishes them (physics.nist.gov/cuu/Constants): each constant an entity - the proton mass, the speed of light in vacuum, the Newtonian constant of gravitation... -, by NIST's short name ("mp", "c", "bg") or its name, with its value, standard uncertainty and unit (a Quantity), whether it is exact, the value as NIST writes it, and the adjustment it comes from (2022); a search by words of their names.
Two calls in all, whatever is asked after: NIST's text table of every value (allascii.txt) and its list of every constant, which gives each its short name; both kept for the source's life. No key; US government work.
const BASE_URI = 'https://physics.nist.gov/'const TABLE = 'cuu/Constants/Table/allascii.txt'The text table of every value, and the list that names each constant.
const LIST = 'cgi-bin/cuu/Category?view=html&All+values.x=87&All+values.y=21'
CodataSource::getName()
public function getName(): stringCodataSource::capabilities()
public function capabilities(): arrayCodataSource::entity()
public function entity(Identifier|string $id): ?EntityA constant by NIST's short name ("mp", "codata:mp", its NIST page) or by its name, NIST's or the table's ("proton mass", "proton mag.
mom.", case aside); another base's identifier is refused before any call; null when no constant has that name.
CodataSource::search()
public function search(Query $query): PageThe constants whose name holds every word of the text (case aside): the name itself first, then the names that begin with the text, then the others, each in NIST's order (alphabetical); a domain other than "other" answers nothing (the core has no physics: a constant is of Domain::OTHER).
CodataSource::adjustment()
public function adjustment(): ?stringThe adjustment the values come from: "2022" (read from the table).
CodataSourceFactory class
final class CodataSourceFactory extends SourceFactory CodataSourceFactory.php:19
CODATA's fundamental physical constants, as NIST publishes them: each constant by its short name or its name, its value, uncertainty and unit; a search - no key needed, two calls in all.
options: mailto: 'support@glitchr.io' # in the User-Agent base_uri: 'https://physics.nist.gov/'
Options
| Option | Default | |
|---|---|---|
throttle | 0.0 | |
base_uri | CodataSource::BASE_URI |