Skip to content

Commit

Permalink
add comments && update annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
leo108 committed Jan 16, 2017
1 parent 9d404fe commit 246c113
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 6 deletions.
17 changes: 16 additions & 1 deletion src/Contracts/Interactions/UserLogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,32 @@
interface UserLogin
{
/**
* Retrive user from credential in request
*
* @param Request $request
* @return UserModel
* @return UserModel|null
*/
public function login(Request $request);

/**
* Get current logged in user
*
* @param Request $request
* @return UserModel|null
*/
public function getCurrentUser(Request $request);

/**
* Show failed message when authenticate failed
*
* @param Request $request
* @return Response
*/
public function showAuthenticateFailed(Request $request);

/**
* Show login page with warning message
*
* @param Request $request
* @param string $jumpUrl
* @param string $service
Expand All @@ -41,25 +49,32 @@ public function showAuthenticateFailed(Request $request);
public function showLoginWarnPage(Request $request, $jumpUrl, $service);

/**
* Show login page
*
* @param Request $request
* @param array $errors
* @return Response
*/
public function showLoginPage(Request $request, array $errors = []);

/**
* Redirect to home page
*
* @param array $errors
* @return Response
*/
public function redirectToHome(array $errors = []);

/**
* Execute logout logic (clear session / cookie etc)
*
* @param Request $request
* @return void
*/
public function logout(Request $request);

/**
*
* @param Request $request
* @return Response
*/
Expand Down
4 changes: 4 additions & 0 deletions src/Contracts/Models/UserModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@
interface UserModel
{
/**
* Get user's name (should be unique in whole cas system)
*
* @return string
*/
public function getName();

/**
* Get user's attributes
*
* @return array
*/
public function getCASAttributes();
Expand Down
1 change: 0 additions & 1 deletion src/Contracts/Responses/ProxyFailureResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Leo108\CAS\Contracts\Responses;


interface ProxyFailureResponse extends BaseResponse
{
/**
Expand Down
1 change: 0 additions & 1 deletion src/Contracts/TicketLocker.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

namespace Leo108\CAS\Contracts;


interface TicketLocker
{
/**
Expand Down
1 change: 1 addition & 0 deletions src/Models/PGTicket.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* @property Carbon $created_at
* @property Carbon $expire_at
* @property UserModel $user
* @property Service $service
*/
class PGTicket extends Model
{
Expand Down
7 changes: 7 additions & 0 deletions src/Models/ServiceHost.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

use Illuminate\Database\Eloquent\Model;

/**
* Class ServiceHost
* @package Leo108\CAS\Models
*
* @property integer $service_id
* @property Service $service
*/
class ServiceHost extends Model
{
protected $table = 'cas_service_hosts';
Expand Down
1 change: 1 addition & 0 deletions src/Models/Ticket.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* @property Carbon $created_at
* @property Carbon $expire_at
* @property UserModel $user
* @property Service $service
*/
class Ticket extends Model
{
Expand Down
4 changes: 2 additions & 2 deletions src/Repositories/TicketRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function __construct(Ticket $ticket, ServiceRepository $serviceRepository
* @param string $serviceUrl
* @param array $proxies
* @throws CasException
* @return \Leo108\CAS\Models\Ticket
* @return Ticket
*/
public function applyTicket(UserModel $user, $serviceUrl, $proxies = [])
{
Expand Down Expand Up @@ -117,4 +117,4 @@ function ($ticket) {
10
);
}
}
}
2 changes: 1 addition & 1 deletion src/Responses/BaseXmlResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,4 @@ public function toResponse()

return new Response($content, 200, ['Content-Type' => 'application/xml']);
}
}
}

0 comments on commit 246c113

Please sign in to comment.