-
-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(em):
composer.json
schema issues
- Loading branch information
Showing
4 changed files
with
74 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Flarum\ExtensionManager; | ||
|
||
/** | ||
* @todo: fix in 2.0 | ||
*/ | ||
trait AllValidatorRules | ||
{ | ||
protected function makeValidator(array $attributes) | ||
{ | ||
$rules = $this->getRules(); | ||
|
||
$validator = $this->validator->make($attributes, $rules, $this->getMessages()); | ||
|
||
foreach ($this->configuration as $callable) { | ||
$callable($this, $validator); | ||
} | ||
|
||
return $validator; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of Flarum. | ||
* | ||
* For detailed copyright and license information, please view the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Flarum\ExtensionManager; | ||
|
||
use Flarum\Foundation\AbstractValidator; | ||
|
||
class ConfigureAuthValidator extends AbstractValidator | ||
{ | ||
use AllValidatorRules; | ||
|
||
protected $rules = [ | ||
'github-oauth' => ['sometimes', 'array'], | ||
'github-oauth.*' => ['sometimes', 'string'], | ||
'gitlab-oauth' => ['sometimes', 'array'], | ||
'gitlab-oauth.*' => ['sometimes', 'string'], | ||
'gitlab-token' => ['sometimes', 'array'], | ||
'gitlab-token.*' => ['sometimes', 'string'], | ||
'bearer' => ['sometimes', 'array'], | ||
'bearer.*' => ['sometimes', 'string'], | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters