From f78070ad26a1fab6ea511eaf94164c7b9723c769 Mon Sep 17 00:00:00 2001 From: Greg Bowler Date: Sat, 16 Jan 2021 17:40:47 +0000 Subject: [PATCH] Add readme --- README.md | 20 ++++++++++++++++++++ composer.json | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..23880f8 --- /dev/null +++ b/README.md @@ -0,0 +1,20 @@ +An interface for objects that expose type-safe getter methods. +============================================================== + +Throughout PHP.Gt repositories, wherever an object represents enclosed data, a consistent interface is used to expose the data in a type-safe manner. + +The following methods are defined by this interface: + ++ `get(string $name):mixed` - A non-type-safe getter, used for getting keys that are not of an inbuilt type ++ `getString(string $name):string` ++ `getInt(string $name):int` ++ `getFloat(string $name):float` ++ `getBool(string $name):bool` ++ `getDateTime(string $name):DateTimeInterface` + +Common areas you will see this interface used: + ++ Database rows ++ User input (from the query string or posted form data) ++ Session and cookie storage ++ [DataObject](https://github.com/PhpGt/DataObject) \ No newline at end of file diff --git a/composer.json b/composer.json index 01d6d04..5195912 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "phpgt/typesafegetter", - "description": " An interface for objects that expose type-safe getter methods.", + "description": "An interface for objects that expose type-safe getter methods.", "type": "library", "license": "MIT",