-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for groups on sync tasks
Support composer 2 libs in compiler
- Loading branch information
1 parent
5483c7e
commit bb0d592
Showing
30 changed files
with
140 additions
and
277 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
<?php declare(strict_types=1); | ||
|
||
namespace SyncIt\Commands; | ||
|
||
|
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,46 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace SyncIt\Commands\Behaviours; | ||
|
||
use Somnambulist\Collection\MutableCollection as Collection; | ||
use Symfony\Component\Console\Input\InputInterface; | ||
use SyncIt\Models\SyncTask; | ||
use function count; | ||
use function trim; | ||
|
||
/** | ||
* Trait GetLabelsFromInput | ||
* | ||
* @package SyncIt\Commands\Behaviours | ||
* @subpackage SyncIt\Commands\Behaviours\GetLabelsFromInput | ||
*/ | ||
trait GetLabelsFromInput | ||
{ | ||
|
||
private function getLabelsFromInput(InputInterface $input, Collection $tasks): array | ||
{ | ||
if (!$labels = $input->getOption('label')) { | ||
if (!$labels = $input->getArgument('label')) { | ||
return []; | ||
} | ||
} | ||
|
||
if (count($labels) === 1) { | ||
$label = trim($labels[0]); | ||
|
||
if ('all' == $label) { | ||
$labels = $tasks->keys()->toArray(); | ||
} elseif (!$tasks->keys()->contains($label)) { | ||
$labels = $tasks | ||
->filter(function (SyncTask $task) use ($label) { | ||
return $task->getGroups()->contains($label); | ||
}) | ||
->keys() | ||
->toArray() | ||
; | ||
} | ||
} | ||
|
||
return $labels; | ||
} | ||
} |
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
<?php declare(strict_types=1); | ||
|
||
namespace SyncIt\Commands\Behaviours; | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
<?php declare(strict_types=1); | ||
|
||
namespace SyncIt\Commands\Behaviours; | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
<?php declare(strict_types=1); | ||
|
||
namespace SyncIt\Commands; | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
<?php declare(strict_types=1); | ||
|
||
namespace SyncIt\Commands; | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
<?php declare(strict_types=1); | ||
|
||
namespace SyncIt\Commands; | ||
|
||
|
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 |
---|---|---|
@@ -1,6 +1,4 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
<?php declare(strict_types=1); | ||
|
||
namespace SyncIt\Commands; | ||
|
||
|
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.