You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
732 B
33 lines
732 B
<?php
|
|
|
|
namespace App\Console\Commands\Handlers;
|
|
|
|
use App\Console\Commands\Contracts\AttributeScanHandler;
|
|
|
|
class LayoutAttributeHandler implements AttributeScanHandler
|
|
{
|
|
public function attributeClass(): string
|
|
{
|
|
return 'Layout';
|
|
}
|
|
|
|
public function extractTranslationKeys(array $arguments): array
|
|
{
|
|
$keys = [];
|
|
|
|
foreach ($arguments as $argument) {
|
|
if(is_array($argument)) {
|
|
foreach ($argument as $label) {
|
|
$keys[] = $label;
|
|
}
|
|
}
|
|
}
|
|
|
|
return $keys;
|
|
}
|
|
|
|
private function isTranslationKey(string $value): bool
|
|
{
|
|
return str_contains($value, '/') || str_contains($value, '.');
|
|
}
|
|
}
|
|
|