Skip to content

Commit

Permalink
bot: fix cs [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
nikophil authored and kbond committed Feb 1, 2025
1 parent 9032c38 commit 5681bb9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/Maker/Factory/FactoryGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(
private \Traversable $defaultPropertiesGuessers,
private FactoryClassMap $factoryClassMap,
private NamespaceGuesser $namespaceGuesser,
private bool $forceProperties = false
private bool $forceProperties = false,
) {
}

Expand Down
8 changes: 4 additions & 4 deletions src/Maker/Factory/MakeFactoryData.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ final class MakeFactoryData
public const STATIC_ANALYSIS_TOOL_PHPSTAN = 'phpstan';
public const STATIC_ANALYSIS_TOOL_PSALM = 'psalm';

private static ReflectionExtractor|null $propertyInfo = null;
private static ?ReflectionExtractor $propertyInfo = null;

/** @var list<string> */
private array $uses;
Expand All @@ -46,7 +46,7 @@ public function __construct(
private string $staticAnalysisTool,
private bool $persisted,
bool $withPhpDoc,
private bool $forceProperties
private bool $forceProperties,
) {
$this->uses = [
$this->getFactoryClass(),
Expand Down Expand Up @@ -166,13 +166,13 @@ public function getDefaultProperties(): array
*
* We do this here because we need to get the class of the Entity which only seems to be accessible here.
*/
$defaultProperties = array_filter($defaultProperties, function (string $propertyName) use ($class): bool {
$defaultProperties = \array_filter($defaultProperties, function(string $propertyName) use ($class): bool {
if (true === $this->forceProperties) {
return true;
}

return self::propertyInfo()->isWritable($class, $propertyName) || self::propertyInfo()->isInitializable($class, $propertyName);
}, ARRAY_FILTER_USE_KEY);
}, \ARRAY_FILTER_USE_KEY);

\ksort($defaultProperties);

Expand Down
5 changes: 3 additions & 2 deletions tests/Fixture/ObjectWithNonWriteable.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class ObjectWithNonWriteable
private string $baz;

public function __construct(
public readonly string $foo
public readonly string $foo,
) {
$this->bar = 'bar';
}
Expand All @@ -28,9 +28,10 @@ public function getBaz(): string
return $this->baz;
}

public function setBaz(string $baz): ObjectWithNonWriteable
public function setBaz(string $baz): self
{
$this->baz = $baz;

return $this;
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Fixture/TestKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function configureContainer(ContainerBuilder $c, LoaderInterface $load
{
parent::configureContainer($c, $loader);

if ($this->getEnvironment() !== 'test') {
if ('test' !== $this->getEnvironment()) {
$loader->load(\sprintf('%s/config/%s.yaml', __DIR__, $this->getEnvironment()));
}

Expand Down

0 comments on commit 5681bb9

Please sign in to comment.