Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Commit

Permalink
Switch from PSR-0 to PSR-4 and update README
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Eckerstorfer committed Nov 18, 2014
1 parent 8ab286c commit 6d8bba8
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Braincrafted\Json

Developed by [Florian Eckerstorfer](https://florian.ec) in Vienna, Europe.


Installation
------------

Expand All @@ -19,6 +20,7 @@ $ composer require braincrafted/json:@stable
*__Tip:__ You should replace `@stable` with the most recent version from the
[releases](https://github.com/braincrafted/json/releases) page.*


Usage
-----

Expand All @@ -32,6 +34,9 @@ echo Json::encode(array('name' => 'Bilbo Baggins'));
// Decode JSON:
print_r(Json::decode('{"name": "Bilbo Baggins"}'));

// Decode JSON into an array:
print_r(Json::decode('{"name": "Bilbo Baggins"}', Json::DECODE_ASSOC));

// Error handling
try {
Json::decode('{"name": "Bilbo Baggins"'); // missing }
Expand All @@ -44,6 +49,12 @@ try {
Changelog
---------

### Version 0.3 (18 November 2014)

- Switched from PSR-0 to PSR-4
- Use `Json::DECODE_ASSOC` and `Json::DECODE_OBJECT` as second argument for `Json::decode()`


### Version 0.2 (15 November 2013)

- Changed namespace to `Braincrafted`
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
"phpunit/phpunit": "3.7.x"
},
"autoload": {
"psr-0": { "Braincrafted\\Json": "src/" }
"psr-4": { "Braincrafted\\Json\\": "src/" }
}
}
}
4 changes: 2 additions & 2 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<phpunit bootstrap="tests/bootstrap.php" colors="true">
<testsuites>
<testsuite name="Braincrafted\Json Test Suite">
<directory>tests/Braincrafted/Json/</directory>
<directory>tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist>
<directory suffix=".php">src/Braincrafted/Json/</directory>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 6d8bba8

Please sign in to comment.