-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat) initial version #8
Conversation
6d2e6bd
to
0c25e1b
Compare
phpstan.neon.dist
Outdated
paths: | ||
- src | ||
tmpDir: build/phpstan | ||
ignoreErrors: | ||
- | ||
message: '#Call to an undefined static method Yard\\SkeletonPackage\\Facades\\Example::getQuote\(\)#' | ||
message: '#Call to an undefined static method Yard\\UserRoles\\Facades\\UserRoles::getQuote\(\)#' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Je hebt denk ik niet de laatste versie van de skeleton package? yardinternet/skeleton-package@c72e49d
0c25e1b
to
16a9840
Compare
16a9840
to
7304427
Compare
Coverage report for commit: c8c5fd8
Summary - Lines: - | Methods: -
🤖 comment via lucassabreu/comment-coverage-clover |
src/UserRoles.php
Outdated
|
||
|
||
//Remove current custom roles | ||
$current_roles = \wp_roles()->roles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$currentRoles
src/UserRoles.php
Outdated
Assert::stringNotEmpty($prefix); | ||
|
||
|
||
//Remove current custom roles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Een aparte method voor maken?
|
||
Assert::isArray($roles); | ||
Assert::stringNotEmpty($prefix); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace
src/UserRoles.php
Outdated
|
||
private function setRolesForSite(): void | ||
{ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whitespace
src/UserRoles.php
Outdated
|
||
//Remove current custom roles | ||
$current_roles = \wp_roles()->roles; | ||
$current_roles = array_filter( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$customRoles
?
src/UserRoles.php
Outdated
remove_role($role); | ||
} | ||
|
||
// Add custom roles |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aparte method voor maken. addCustomRoles()
dan kan de comment weg
src/UserRoles.php
Outdated
$capabilities = []; | ||
|
||
$capGroups = config('user-roles.cap_groups'); | ||
Assert::isArray($capGroups); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$capGroups
kan ook leeg zijn. Dan kan deze stap worden overgeslagen (nu krijg je een exception)
src/UserRoles.php
Outdated
|
||
$capGroups = config('user-roles.cap_groups'); | ||
Assert::isArray($capGroups); | ||
foreach ($properties['cap_groups'] as $group) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ook $properties['cap_groups']
kan leeg zijn.
src/UserRoles.php
Outdated
} | ||
} | ||
|
||
foreach ($properties['post_type_caps'] as $postType) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
En $properties['post_type_caps']
kan ook leeg zijn.
src/UserRoles.php
Outdated
foreach ($properties['post_type_caps'] as $postType) { | ||
$postTypeCaps = get_post_type_object($postType)?->cap; | ||
Assert::object($postTypeCaps); | ||
foreach(array_values((array)$postTypeCaps) as $cap) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of
foreach($postTypeCaps as $key => $cap) {
No description provided.