Skip to content
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

Merged
merged 4 commits into from
Aug 7, 2024
Merged

(feat) initial version #8

merged 4 commits into from
Aug 7, 2024

Conversation

ictbeheer
Copy link
Contributor

No description provided.

@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request root release tests labels Aug 6, 2024
@ictbeheer ictbeheer force-pushed the feat/initial-version branch from 6d2e6bd to 0c25e1b Compare August 6, 2024 09:12
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\(\)#'
Copy link
Member

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

@ictbeheer ictbeheer force-pushed the feat/initial-version branch from 0c25e1b to 16a9840 Compare August 6, 2024 11:42
@ictbeheer ictbeheer force-pushed the feat/initial-version branch from 16a9840 to 7304427 Compare August 6, 2024 11:47
Copy link

github-actions bot commented Aug 6, 2024

Coverage report for commit: c8c5fd8
File: coverage.xml

Cover ┌─────────────────────────┐ Freq.
   0% │ ███████████████████████ │ 100.0%
  10% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  20% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  30% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  40% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  50% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  60% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  70% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  80% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
  90% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
 100% │ ░░░░░░░░░░░░░░░░░░░░░░░ │  0.0%
      └─────────────────────────┘
 *Legend:* █ = Current Distribution 
Summary - Lines: - | Methods: -
FilesLinesMethodsBranches
src/Console
   UserRolesCommand.php--100.00%
src/Facades
   UserRoles.php--100.00%
src
   UserRoles.php--100.00%
   UserRolesServiceProvider.php--100.00%

🤖 comment via lucassabreu/comment-coverage-clover



//Remove current custom roles
$current_roles = \wp_roles()->roles;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$currentRoles

Assert::stringNotEmpty($prefix);


//Remove current custom roles
Copy link
Member

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);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace


private function setRolesForSite(): void
{

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whitespace


//Remove current custom roles
$current_roles = \wp_roles()->roles;
$current_roles = array_filter(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$customRoles ?

remove_role($role);
}

// Add custom roles
Copy link
Member

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

$capabilities = [];

$capGroups = config('user-roles.cap_groups');
Assert::isArray($capGroups);
Copy link
Member

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)


$capGroups = config('user-roles.cap_groups');
Assert::isArray($capGroups);
foreach ($properties['cap_groups'] as $group) {
Copy link
Member

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.

}
}

foreach ($properties['post_type_caps'] as $postType) {
Copy link
Member

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.

foreach ($properties['post_type_caps'] as $postType) {
$postTypeCaps = get_post_type_object($postType)?->cap;
Assert::object($postTypeCaps);
foreach(array_values((array)$postTypeCaps) as $cap) {
Copy link
Member

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) {

@ictbeheer ictbeheer merged commit 4c9cf2f into main Aug 7, 2024
@ictbeheer ictbeheer deleted the feat/initial-version branch August 7, 2024 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request release root tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants