Skip to content
Permalink
Browse files

Merge pull request #52 from ergebnis/fix/unused

Fix: Remove unused accessor, constructor parameter, and field
  • Loading branch information
localheinz committed Mar 15, 2020
2 parents 9df002f + a265189 commit 963f71f218ed1bb62badef34f0d7859044b96ed4
Showing with 8 additions and 37 deletions.
  1. +1 −1 .github/workflows/integrate.yaml
  2. +1 −1 Makefile
  3. +0 −10 phpstan-baseline.neon
  4. +5 −10 psalm-baseline.xml
  5. +1 −14 src/EntityDef.php
  6. +0 −1 src/FixtureFactory.php
@@ -10,7 +10,7 @@ on: # yamllint disable-line rule:truthy

env:
MIN_COVERED_MSI: 94
MIN_MSI: 85
MIN_MSI: 86
REQUIRED_PHP_EXTENSIONS: "mbstring"

jobs:
@@ -1,5 +1,5 @@
MIN_COVERED_MSI:=94
MIN_MSI:=85
MIN_MSI:=86

.PHONY: it
it: coding-standards dependency-analysis static-code-analysis doctrine tests ## Runs the coding-standards, dependency-analysis, static-code-analysis, doctrine, and tests targets
@@ -1,20 +1,10 @@
parameters:
ignoreErrors:
-
message: "#^Property Ergebnis\\\\FactoryBot\\\\EntityDef\\:\\:\\$name has no typehint specified\\.$#"
count: 1
path: src/EntityDef.php

-
message: "#^Property Ergebnis\\\\FactoryBot\\\\EntityDef\\:\\:\\$entityType has no typehint specified\\.$#"
count: 1
path: src/EntityDef.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\EntityDef\\:\\:__construct\\(\\) has parameter \\$name with no typehint specified\\.$#"
count: 1
path: src/EntityDef.php

-
message: "#^Method Ergebnis\\\\FactoryBot\\\\EntityDef\\:\\:__construct\\(\\) has parameter \\$type with no typehint specified\\.$#"
count: 1
@@ -7,14 +7,12 @@
<code>static function () use ($def) {</code>
<code>static function () use ($f) {</code>
</MissingClosureReturnType>
<MissingParamType occurrences="4">
<code>$name</code>
<MissingParamType occurrences="3">
<code>$type</code>
<code>$def</code>
<code>$f</code>
</MissingParamType>
<MissingPropertyType occurrences="4">
<code>$name</code>
<MissingPropertyType occurrences="3">
<code>$entityType</code>
<code>$fieldDefs</code>
<code>$config</code>
@@ -24,8 +22,7 @@
<code>normalizeFieldDef</code>
<code>ensureInvokable</code>
</MissingReturnType>
<MixedArgument occurrences="2">
<code>$type</code>
<MixedArgument occurrences="1">
<code>$f</code>
</MixedArgument>
<MixedArgumentTypeCoercion occurrences="2">
@@ -39,16 +36,14 @@
<MixedFunctionCall occurrences="1">
<code>\call_user_func_array($f, \func_get_args())</code>
</MixedFunctionCall>
<MixedInferredReturnType occurrences="3">
<code>string</code>
<MixedInferredReturnType occurrences="2">
<code>string</code>
<code>array</code>
</MixedInferredReturnType>
<MixedOperand occurrences="1">
<code>$this-&gt;entityType</code>
</MixedOperand>
<MixedReturnStatement occurrences="3">
<code>$this-&gt;name</code>
<MixedReturnStatement occurrences="2">
<code>$this-&gt;entityType</code>
<code>$this-&gt;config</code>
</MixedReturnStatement>
@@ -25,18 +25,15 @@ final class EntityDef
*/
private $metadata;

private $name;

private $entityType;

private $fieldDefs;

private $config;

public function __construct(ORM\Mapping\ClassMetadata $metadata, $name, $type, array $fieldDefs, array $config)
public function __construct(ORM\Mapping\ClassMetadata $metadata, $type, array $fieldDefs, array $config)
{
$this->metadata = $metadata;
$this->name = $name;
$this->entityType = $type;
$this->fieldDefs = [];
$this->config = $config;
@@ -45,16 +42,6 @@ public function __construct(ORM\Mapping\ClassMetadata $metadata, $name, $type, a
$this->defaultDefsFromMetadata();
}

/**
* Returns the name of the entity definition.
*
* @return string
*/
public function getName()
{
return $this->name;
}

/**
* Returns the fully qualified name of the entity class.
*
@@ -227,7 +227,6 @@ public function defineEntity($name, array $fieldDefs = [], array $config = [])

$this->entityDefs[$name] = new EntityDef(
$metadata,
$name,
$type,
$fieldDefs,
$config

0 comments on commit 963f71f

Please sign in to comment.
You can’t perform that action at this time.