Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Merge pull request #1 from delatbabel/add-docblocks
Browse files Browse the repository at this point in the history
Add docblock
  • Loading branch information
Mario Bašić committed Dec 7, 2015
2 parents 3485c2d + 0297543 commit 9f8484f
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 7 deletions.
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@
</exclude>
</whitelist>
</filter>
</phpunit>
</phpunit>
2 changes: 1 addition & 1 deletion src/Facades/Syndra.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ protected static function getFacadeAccessor()
{
return 'syndra';
}
}
}
39 changes: 36 additions & 3 deletions src/Syndra.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,42 @@
<?php namespace Laravelista\Syndra;
<?php
/**
* Class Syndra
*
* @author Mario Basic
*/

namespace Laravelista\Syndra;

use Illuminate\Http\JsonResponse;
use Illuminate\Http\Response;

/**
* Class Syndra
*
* This package returns generic (predefined) JSON responses for common API actions like creating,
* updating, destroying, indexing and showing a resource.
*
* It can be easily extended and modified.
*
* It can be used anywhere in your application (controllers, routes etc...)
*
* ### Examples
*
* #### OK Response
*
* <code>
* return $this->syndra->respondOk('post_deleted');
* </code>
*
* #### Respond with a JSON validation error.
*
* <code>
* return Syndra::respondValidationError($errors);
* </code>
*
* @see ...
* @link https://github.com/laravelista/Syndra/wiki
*/
class Syndra
{

Expand Down Expand Up @@ -192,5 +226,4 @@ public function respondUnauthorized($message)
return $this->setStatusCode(Response::HTTP_UNAUTHORIZED)
->respondWithError($message);
}

}
}
2 changes: 1 addition & 1 deletion src/SyndraServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ public function provides()
{
return [];
}
}
}
2 changes: 1 addition & 1 deletion tests/SyndraTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,4 @@ public function it_responds_with_unauthorized()

$this->assertEquals('{"error":{"message":"something","status_code":401}}', json_encode($response->getData()));
}
}
}

0 comments on commit 9f8484f

Please sign in to comment.