Skip to content

Commit

Permalink
Merge pull request #192 from Frameck/main
Browse files Browse the repository at this point in the history
Policies return type
  • Loading branch information
bezhanSalleh authored Jul 31, 2023
2 parents c937760 + 30bbcfe commit bf6aeec
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions stubs/DefaultPolicy.stub
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function viewAny({{ auth_model_name }} ${{ auth_model_variable }})
public function viewAny({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ ViewAny }}');
}
Expand All @@ -28,7 +28,7 @@ class {{ modelPolicy }}
* @param \{{ model_fqcn }} ${{ model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function view({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }})
public function view({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ View }}');
}
Expand All @@ -39,7 +39,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function create({{ auth_model_name }} ${{ auth_model_variable }})
public function create({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Create }}');
}
Expand All @@ -51,7 +51,7 @@ class {{ modelPolicy }}
* @param \{{ model_fqcn }} ${{ model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function update({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }})
public function update({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Update }}');
}
Expand All @@ -63,7 +63,7 @@ class {{ modelPolicy }}
* @param \{{ model_fqcn }} ${{ model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function delete({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }})
public function delete({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Delete }}');
}
Expand All @@ -74,7 +74,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function deleteAny({{ auth_model_name }} ${{ auth_model_variable }})
public function deleteAny({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ DeleteAny }}');
}
Expand All @@ -86,7 +86,7 @@ class {{ modelPolicy }}
* @param \{{ model_fqcn }} ${{ model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function forceDelete({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }})
public function forceDelete({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ ForceDelete }}');
}
Expand All @@ -97,7 +97,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function forceDeleteAny({{ auth_model_name }} ${{ auth_model_variable }})
public function forceDeleteAny({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ ForceDeleteAny }}');
}
Expand All @@ -109,7 +109,7 @@ class {{ modelPolicy }}
* @param \{{ model_fqcn }} ${{ model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function restore({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }})
public function restore({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Restore }}');
}
Expand All @@ -120,7 +120,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function restoreAny({{ auth_model_name }} ${{ auth_model_variable }})
public function restoreAny({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ RestoreAny }}');
}
Expand All @@ -132,7 +132,7 @@ class {{ modelPolicy }}
* @param \{{ model_fqcn }} ${{ model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function replicate({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }})
public function replicate({{ auth_model_name }} ${{ auth_model_variable }}, {{ model_name }} ${{ model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Replicate }}');
}
Expand All @@ -143,7 +143,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function reorder({{ auth_model_name }} ${{ auth_model_variable }})
public function reorder({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Reorder }}');
}
Expand Down
24 changes: 12 additions & 12 deletions stubs/UserPolicy.stub
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function viewAny({{ auth_model_name }} ${{ auth_model_variable }})
public function viewAny({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ ViewAny }}');
}
Expand All @@ -27,7 +27,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function view({{ auth_model_name }} ${{ auth_model_variable }})
public function view({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ View }}');
}
Expand All @@ -38,7 +38,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function create({{ auth_model_name }} ${{ auth_model_variable }})
public function create({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Create }}');
}
Expand All @@ -49,7 +49,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function update({{ auth_model_name }} ${{ auth_model_variable }})
public function update({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Update }}');
}
Expand All @@ -60,7 +60,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function delete({{ auth_model_name }} ${{ auth_model_variable }})
public function delete({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Delete }}');
}
Expand All @@ -71,7 +71,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function deleteAny({{ auth_model_name }} ${{ auth_model_variable }})
public function deleteAny({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ DeleteAny }}');
}
Expand All @@ -82,7 +82,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function forceDelete({{ auth_model_name }} ${{ auth_model_variable }})
public function forceDelete({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ ForceDelete }}');
}
Expand All @@ -93,7 +93,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function forceDeleteAny({{ auth_model_name }} ${{ auth_model_variable }})
public function forceDeleteAny({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ ForceDeleteAny }}');
}
Expand All @@ -104,7 +104,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function restore({{ auth_model_name }} ${{ auth_model_variable }})
public function restore({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Restore }}');
}
Expand All @@ -115,7 +115,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function restoreAny({{ auth_model_name }} ${{ auth_model_variable }})
public function restoreAny({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ RestoreAny }}');
}
Expand All @@ -126,7 +126,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function replicate({{ auth_model_name }} ${{ auth_model_variable }})
public function replicate({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Replicate }}');
}
Expand All @@ -137,7 +137,7 @@ class {{ modelPolicy }}
* @param \{{ auth_model_fqcn }} ${{ auth_model_variable }}
* @return \Illuminate\Auth\Access\Response|bool
*/
public function reorder({{ auth_model_name }} ${{ auth_model_variable }})
public function reorder({{ auth_model_name }} ${{ auth_model_variable }}): bool
{
return ${{ auth_model_variable }}->can('{{ Reorder }}');
}
Expand Down

0 comments on commit bf6aeec

Please sign in to comment.