Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
charset = utf-8
indent_size = 4
indent_style = space
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
23 changes: 13 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,37 @@ You need to have the [cURL](http://php.net/manual/en/book.curl.php)-extension in

## Usage
``` php
require_once 'src/Mailinator/Mailinator.php';
require_once __DIR__ . '/vendor/autoload.php';

use Mailinator\Mailinator;

$mailinator = new Mailinator('my_token');

//Get messages in inbox//
try
{
print_r($mailinator->inbox('randominbox'));
print_r($mailinator->inbox('randominbox'));
} catch(Exception $e) {
// Process the error
echo "Something went wrong: " . $e->getMessage();
// Process the error
echo "Something went wrong: " . $e->getMessage();
}

//Get a message//
try
{
print_r($mailinator->message('mail-id'));
print_r($mailinator->message('mail-id'));
} catch(Exception $e) {
// Process the error
echo "Something went wrong: " . $e->getMessage();
// Process the error
echo "Something went wrong: " . $e->getMessage();
}

//Delete a message//
try
{
print_r($mailinator->delete('mail-id'));
print_r($mailinator->delete('mail-id'));
} catch(Exception $e) {
// Process the error
echo "Something went wrong: " . $e->getMessage();
// Process the error
echo "Something went wrong: " . $e->getMessage();
}
```

Expand Down
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@
"require": {
"php": ">=5.2.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "@stable"
},
"autoload": {
"psr-0": {
"Mailinator": "src/"
}
},
"config": {
"optimize-autoloader": true
}
}
Loading