Skip to content

Commit

Permalink
Merge pull request datamweb#7 from datamweb/fix-not-display-ci-debugg…
Browse files Browse the repository at this point in the history
…ing-tool

fix: not display ci debugging tools
  • Loading branch information
datamweb authored Nov 3, 2022
2 parents 71426b9 + 681b9bd commit c070ea1
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions src/Libraries/Basic/ShieldOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

class ShieldOAuth
{
private $oauthClassFiles = '';

public static function setOAuth(string $serviceName): object
{
$serviceName = ucfirst($serviceName);
Expand Down Expand Up @@ -61,8 +59,6 @@ public function allOAuth(): string
// show only all *OAuth.php files
$files = $files->retainPattern('*OAuth.php');

$this->setOtherOAuth($files);

$allAllowedRoutes = '';

foreach ($files as $file) {
Expand All @@ -73,23 +69,9 @@ public function allOAuth(): string
return mb_substr($allAllowedRoutes, 0, -1);
}

public function setOtherOAuth($files)
{
return $this->oauthClassFiles = $files;
}

private function otherOAuth(): array
{
$files = $this->oauthClassFiles;
$allAllowedRoutes = '';

foreach ($files as $file) {
// make string github|google and ... from class name
$allAllowedRoutes .= strtolower(str_replace($search = 'OAuth.php', $replace = '|', $subject = $file->getBasename()));
}
$allAllowedRoutes = mb_substr($allAllowedRoutes, 0, -1);

$pieces = explode('|', $allAllowedRoutes);
$pieces = explode('|', $this->allOAuth());

return array_diff($pieces, ['github', 'google']);
}
Expand Down

0 comments on commit c070ea1

Please sign in to comment.