-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
117 changed files
with
5,167 additions
and
577 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
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
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,49 @@ | ||
<?php | ||
/* | ||
* This file is part of the FreshCentrifugoBundle. | ||
* | ||
* (c) Artem Henvald <genvaldartem@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Fresh\CentrifugoBundle\Command\Argument; | ||
|
||
use Fresh\CentrifugoBundle\Service\CentrifugoChecker; | ||
use Symfony\Component\Console\Exception\InvalidArgumentException; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
/** | ||
* ArgumentChannelsTrait. | ||
* | ||
* @author Artem Henvald <genvaldartem@gmail.com> | ||
*/ | ||
trait ArgumentChannelsTrait | ||
{ | ||
protected readonly CentrifugoChecker $centrifugoChecker; | ||
|
||
/** @var string[] */ | ||
private array $channels; | ||
|
||
/** | ||
* @param InputInterface $input | ||
* | ||
* @throws InvalidArgumentException | ||
*/ | ||
protected function initializeChannelsArgument(InputInterface $input): void | ||
{ | ||
try { | ||
/** @var string[] $channels */ | ||
$channels = (array) $input->getArgument('channels'); | ||
foreach ($channels as $channel) { | ||
$this->centrifugoChecker->assertValidChannelName($channel); | ||
} | ||
$this->channels = $channels; | ||
} catch (\Throwable $e) { | ||
throw new InvalidArgumentException($e->getMessage()); | ||
} | ||
} | ||
} |
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,37 @@ | ||
<?php | ||
/* | ||
* This file is part of the FreshCentrifugoBundle. | ||
* | ||
* (c) Artem Henvald <genvaldartem@gmail.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Fresh\CentrifugoBundle\Command\Argument; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
|
||
/** | ||
* ArgumentPatternTrait. | ||
* | ||
* @author Artem Henvald <genvaldartem@gmail.com> | ||
*/ | ||
trait ArgumentPatternTrait | ||
{ | ||
protected ?string $pattern = null; | ||
|
||
/** | ||
* @param InputInterface $input | ||
*/ | ||
protected function initializePatternArgument(InputInterface $input): void | ||
{ | ||
$pattern = $input->getArgument('pattern'); | ||
|
||
if (\is_string($pattern) && !empty($pattern)) { | ||
$this->pattern = $pattern; | ||
} | ||
} | ||
} |
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
Oops, something went wrong.