Skip to content

Commit

Permalink
pint refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
andrii-trush committed Oct 22, 2024
1 parent 086d606 commit b0035b8
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config/config.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

return [
'enum_locations' => [
Expand Down
7 changes: 4 additions & 3 deletions src/Concerns/HasLabel.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?php

declare(strict_types=1);

namespace IsapOu\EnumHelpers\Concerns;

use Illuminate\Support\Facades\Config;
use Illuminate\Support\Str;

use function get_class;
use function rtrim;
use function trans;

Expand All @@ -27,7 +28,7 @@ public function getLabel(?string $prefix = null, ?string $namespace = null): str
$namespace .= '::';
}

return trans(vsprintf('%s%s%s.%s', [$namespace, $prefix, get_class($this), $this->name]));
return trans(vsprintf('%s%s%s.%s', [$namespace, $prefix, \get_class($this), $this->name]));
}

protected function getPrefix(): ?string
Expand All @@ -39,4 +40,4 @@ protected function getNamespace(): ?string
{
return Config::get('enum-helpers.label.namespace');
}
}
}
4 changes: 3 additions & 1 deletion src/Concerns/InteractWithCollection.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

namespace IsapOu\EnumHelpers\Concerns;

use Illuminate\Support\Collection;
Expand All @@ -25,4 +27,4 @@ public static function keyValuePairs(): Collection
{
return static::collection()->mapWithKeys(fn ($enum) => [$enum->name => $enum->value]);
}
}
}
4 changes: 3 additions & 1 deletion src/Contracts/HasLabel.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<?php

declare(strict_types=1);

namespace IsapOu\EnumHelpers\Contracts;

interface HasLabel
{
public function getLabel(): ?string;
}
}
2 changes: 1 addition & 1 deletion src/ServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace IsapOu\EnumHelpers;

Expand Down

0 comments on commit b0035b8

Please sign in to comment.