Browse Source

Fixed model policy object stub docblocks

tags/1.1.6
Nafies Luthfi 8 years ago
parent
commit
602e83532c
  1. 28
      src/stubs/models/model-policy.stub
  2. 56
      tests/Generators/ModelPolicyGeneratorTest.php

28
src/stubs/models/model-policy.stub

@ -11,11 +11,10 @@ class MasterPolicy
use HandlesAuthorization;
/**
* Determine whether the user can view the project.
*
* @param \App\User $user
* @param \fullMstr $singleMstr
* Determine whether the user can view the master.
*
* @param \App\User $user
* @param \fullMstr $singleMstr
* @return mixed
*/
public function view(User $user, Master $singleMstr)
@ -25,11 +24,10 @@ class MasterPolicy
}
/**
* Determine whether the user can create projects.
*
* @param \App\User $user
* @param \fullMstr $singleMstr
* Determine whether the user can create master.
*
* @param \App\User $user
* @param \fullMstr $singleMstr
* @return mixed
*/
public function create(User $user, Master $singleMstr)
@ -39,11 +37,10 @@ class MasterPolicy
}
/**
* Determine whether the user can update the project.
*
* @param \App\User $user
* @param \fullMstr $singleMstr
* Determine whether the user can update the master.
*
* @param \App\User $user
* @param \fullMstr $singleMstr
* @return mixed
*/
public function update(User $user, Master $singleMstr)
@ -53,11 +50,10 @@ class MasterPolicy
}
/**
* Determine whether the user can delete the project.
*
* @param \App\User $user
* @param \fullMstr $singleMstr
* Determine whether the user can delete the master.
*
* @param \App\User $user
* @param \fullMstr $singleMstr
* @return mixed
*/
public function delete(User $user, Master $singleMstr)

56
tests/Generators/ModelPolicyGeneratorTest.php

@ -28,11 +28,10 @@ class {$this->model_name}Policy
use HandlesAuthorization;
/**
* Determine whether the user can view the project.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* Determine whether the user can view the $this->lang_name.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* @return mixed
*/
public function view(User \$user, {$this->model_name} \${$this->single_model_var_name})
@ -42,11 +41,10 @@ class {$this->model_name}Policy
}
/**
* Determine whether the user can create projects.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* Determine whether the user can create $this->lang_name.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* @return mixed
*/
public function create(User \$user, {$this->model_name} \${$this->single_model_var_name})
@ -56,11 +54,10 @@ class {$this->model_name}Policy
}
/**
* Determine whether the user can update the project.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* Determine whether the user can update the $this->lang_name.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* @return mixed
*/
public function update(User \$user, {$this->model_name} \${$this->single_model_var_name})
@ -70,11 +67,10 @@ class {$this->model_name}Policy
}
/**
* Determine whether the user can delete the project.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* Determine whether the user can delete the $this->lang_name.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* @return mixed
*/
public function delete(User \$user, {$this->model_name} \${$this->single_model_var_name})
@ -144,11 +140,10 @@ class {$this->model_name}Policy
use HandlesAuthorization;
/**
* Determine whether the user can view the project.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* Determine whether the user can view the $this->lang_name.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* @return mixed
*/
public function view(User \$user, {$this->model_name} \${$this->single_model_var_name})
@ -158,11 +153,10 @@ class {$this->model_name}Policy
}
/**
* Determine whether the user can create projects.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* Determine whether the user can create $this->lang_name.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* @return mixed
*/
public function create(User \$user, {$this->model_name} \${$this->single_model_var_name})
@ -172,11 +166,10 @@ class {$this->model_name}Policy
}
/**
* Determine whether the user can update the project.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* Determine whether the user can update the $this->lang_name.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* @return mixed
*/
public function update(User \$user, {$this->model_name} \${$this->single_model_var_name})
@ -186,11 +179,10 @@ class {$this->model_name}Policy
}
/**
* Determine whether the user can delete the project.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* Determine whether the user can delete the $this->lang_name.
*
* @param \\{$userModel} \$user
* @param \\{$this->full_model_name} \${$this->single_model_var_name}
* @return mixed
*/
public function delete(User \$user, {$this->model_name} \${$this->single_model_var_name})

Loading…
Cancel
Save