Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
g105b committed Jan 16, 2021
1 parent cf7f419 commit f78070a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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",

Expand Down

0 comments on commit f78070a

Please sign in to comment.