Skip to content
Permalink
Browse files

Merge pull request #14 from ergebnis/fix/date-interval

Fix: Remove FieldDef::past(), FieldDef::future(), and DateIntervalHelper
  • Loading branch information
localheinz committed Mar 8, 2020
2 parents 76133e3 + 58326cc commit 0248e3d81a8ce55c7c65ddd41cd61be1b874fbf0
@@ -10,7 +10,7 @@ on: # yamllint disable-line rule:truthy

env:
MIN_COVERED_MSI: 91
MIN_MSI: 52
MIN_MSI: 45
REQUIRED_PHP_EXTENSIONS: "mbstring"

jobs:
@@ -17,12 +17,14 @@ For a full diff see [`fa9c564...master`][fa9c564...master].

* Removed possibility to set the entity namespace on the `FixtureFactory` ([#3]), by [@localheinz]
* Removed `StatusArrayType` ([#13]), by [@localheinz]
* Removed `FieldDef::past()`, `FieldDef::future()`, and `DateIntervalHelper` ([#14]), by [@localheinz]

[fa9c564...master]: https://github.com/ergebnis/factory-bot/compare/fa9c564...master

[#1]: https://github.com/ergebnis/factory-bot/pull/1
[#3]: https://github.com/ergebnis/factory-bot/pull/3
[#6]: https://github.com/ergebnis/factory-bot/pull/6
[#13]: https://github.com/ergebnis/factory-bot/pull/13
[#14]: https://github.com/ergebnis/factory-bot/pull/14

[@localheinz]: https://github.com/localheinz
@@ -1,5 +1,5 @@
MIN_COVERED_MSI:=91
MIN_MSI:=52
MIN_MSI:=45

.PHONY: it
it: coding-standards dependency-analysis static-code-analysis tests ## Runs the coding-standards, dependency-analysis, static-code-analysis, and tests targets
@@ -1,35 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^File is missing a \"declare\\(strict_types\\=1\\)\" declaration\\.$#"
count: 1
path: src/Doctrine/DateIntervalHelper.php

-
message: "#^Class FactoryGirl\\\\Provider\\\\Doctrine\\\\DateIntervalHelper is neither abstract nor final\\.$#"
count: 1
path: src/Doctrine/DateIntervalHelper.php

-
message: "#^Constructor in FactoryGirl\\\\Provider\\\\Doctrine\\\\DateIntervalHelper has parameter \\$negative with default value\\.$#"
count: 1
path: src/Doctrine/DateIntervalHelper.php

-
message: "#^Access to an undefined property FactoryGirl\\\\Provider\\\\Doctrine\\\\DateIntervalHelper\\:\\:\\$time\\.$#"
count: 5
path: src/Doctrine/DateIntervalHelper.php

-
message: "#^Method FactoryGirl\\\\Provider\\\\Doctrine\\\\DateIntervalHelper\\:\\:modify\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Doctrine/DateIntervalHelper.php

-
message: "#^Method FactoryGirl\\\\Provider\\\\Doctrine\\\\DateIntervalHelper\\:\\:assertIntegerish\\(\\) has no return typehint specified\\.$#"
count: 1
path: src/Doctrine/DateIntervalHelper.php

-
message: "#^File is missing a \"declare\\(strict_types\\=1\\)\" declaration\\.$#"
count: 1
@@ -1195,36 +1165,6 @@ parameters:
count: 1
path: test/Doctrine/Fixtures/TestCase.php

-
message: "#^File is missing a \"declare\\(strict_types\\=1\\)\" declaration\\.$#"
count: 1
path: test/Doctrine/Fixtures/TimeTest.php

-
message: "#^Class \"FactoryGirl\\\\Tests\\\\Provider\\\\Doctrine\\\\Fixtures\\\\TimeTest\" is not allowed to extend \"FactoryGirl\\\\Tests\\\\Provider\\\\Doctrine\\\\Fixtures\\\\TestCase\"\\.$#"
count: 1
path: test/Doctrine/Fixtures/TimeTest.php

-
message: "#^Class FactoryGirl\\\\Tests\\\\Provider\\\\Doctrine\\\\Fixtures\\\\TimeTest is neither abstract nor final\\.$#"
count: 1
path: test/Doctrine/Fixtures/TimeTest.php

-
message: "#^Method FactoryGirl\\\\Tests\\\\Provider\\\\Doctrine\\\\Fixtures\\\\TimeTest\\:\\:testGetTimePast\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Doctrine/Fixtures/TimeTest.php

-
message: "#^Dynamic call to static method PHPUnit\\\\Framework\\\\Assert\\:\\:assertSame\\(\\)\\.$#"
count: 4
path: test/Doctrine/Fixtures/TimeTest.php

-
message: "#^Method FactoryGirl\\\\Tests\\\\Provider\\\\Doctrine\\\\Fixtures\\\\TimeTest\\:\\:testGetTimeFuture\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Doctrine/Fixtures/TimeTest.php

-
message: "#^File is missing a \"declare\\(strict_types\\=1\\)\" declaration\\.$#"
count: 1
@@ -1270,36 +1210,6 @@ parameters:
count: 1
path: test/Doctrine/Fixtures/TransitiveReferencesTest.php

-
message: "#^File is missing a \"declare\\(strict_types\\=1\\)\" declaration\\.$#"
count: 1
path: test/Doctrine/ORM/DateIntervalHelperTest.php

-
message: "#^Class FactoryGirl\\\\Tests\\\\Provider\\\\Doctrine\\\\ORM\\\\DateIntervalHelperTest is neither abstract nor final\\.$#"
count: 1
path: test/Doctrine/ORM/DateIntervalHelperTest.php

-
message: "#^Method FactoryGirl\\\\Tests\\\\Provider\\\\Doctrine\\\\ORM\\\\DateIntervalHelperTest\\:\\:testYearsRejectsInvalidValue\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Doctrine/ORM/DateIntervalHelperTest.php

-
message: "#^Method FactoryGirl\\\\Tests\\\\Provider\\\\Doctrine\\\\ORM\\\\DateIntervalHelperTest\\:\\:testMonthsRejectsInvalidValue\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Doctrine/ORM/DateIntervalHelperTest.php

-
message: "#^Method FactoryGirl\\\\Tests\\\\Provider\\\\Doctrine\\\\ORM\\\\DateIntervalHelperTest\\:\\:testDaysRejectsInvalidValue\\(\\) has no return typehint specified\\.$#"
count: 1
path: test/Doctrine/ORM/DateIntervalHelperTest.php

-
message: "#^Anonymous function should have native return typehint \"array\"\\.$#"
count: 1
path: test/Doctrine/ORM/DateIntervalHelperTest.php

-
message: "#^File is missing a \"declare\\(strict_types\\=1\\)\" declaration\\.$#"
count: 1
@@ -1,38 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="3.9.4@352bd3f5c5789db04e4010856c2f4e01ed354f4e">
<file src="src/Doctrine/DateIntervalHelper.php">
<MissingReturnType occurrences="2">
<code>modify</code>
<code>assertIntegerish</code>
</MissingReturnType>
<MixedInferredReturnType occurrences="1">
<code>\DateTime|int|string</code>
</MixedInferredReturnType>
<MixedMethodCall occurrences="3">
<code>add</code>
<code>getTimestamp</code>
<code>format</code>
</MixedMethodCall>
<MixedReturnStatement occurrences="3">
<code>$this-&gt;time</code>
<code>$this-&gt;time-&gt;getTimestamp()</code>
<code>$this-&gt;time-&gt;format('d-m-y')</code>
</MixedReturnStatement>
<RedundantConditionGivenDocblockType occurrences="3">
<code>assertIntegerish</code>
<code>assertIntegerish</code>
<code>assertIntegerish</code>
</RedundantConditionGivenDocblockType>
<UndefinedThisPropertyAssignment occurrences="1">
<code>$this-&gt;time</code>
</UndefinedThisPropertyAssignment>
<UndefinedThisPropertyFetch occurrences="4">
<code>$this-&gt;time</code>
<code>$this-&gt;time</code>
<code>$this-&gt;time</code>
<code>$this-&gt;time</code>
</UndefinedThisPropertyFetch>
</file>
<file src="src/Doctrine/EntityDef.php">
<MissingClosureReturnType occurrences="4">
<code>function () use ($defaultFieldValue) {</code>
@@ -494,12 +461,6 @@
<code>getName</code>
</MixedMethodCall>
</file>
<file src="test/Doctrine/Fixtures/TimeTest.php">
<MissingReturnType occurrences="2">
<code>testGetTimePast</code>
<code>testGetTimeFuture</code>
</MissingReturnType>
</file>
<file src="test/Doctrine/Fixtures/TransitiveReferencesTest.php">
<MissingReturnType occurrences="3">
<code>simpleSetup</code>
@@ -522,21 +483,6 @@
<code>getSpaceShip</code>
</MixedMethodCall>
</file>
<file src="test/Doctrine/ORM/DateIntervalHelperTest.php">
<MissingReturnType occurrences="3">
<code>testYearsRejectsInvalidValue</code>
<code>testMonthsRejectsInvalidValue</code>
<code>testDaysRejectsInvalidValue</code>
</MissingReturnType>
<MixedArgument occurrences="3">
<code>$years</code>
<code>$months</code>
<code>$days</code>
</MixedArgument>
<MixedInferredReturnType occurrences="1">
<code>array</code>
</MixedInferredReturnType>
</file>
<file src="test/Doctrine/ORM/RepositoryTest.php">
<MissingPropertyType occurrences="1">
<code>$user-&gt;id</code>

This file was deleted.

@@ -46,22 +46,6 @@ public static function sequence($funcOrString, $firstNum = 1)
};
}

/**
* @return DateIntervalHelper
*/
public static function past()
{
return new DateIntervalHelper(new \DateTime(), true);
}

/**
* @return DateIntervalHelper
*/
public static function future()
{
return new DateIntervalHelper(new \DateTime(), false);
}

/**
* Defines a field to `get()` a named entity from the factory.
*
@@ -33,7 +33,6 @@ public function testSrcClassesHaveUnitTests(): void
'Ergebnis\\FactoryBot\\',
'Ergebnis\\FactoryBot\\Test\\Unit',
[
Doctrine\DateIntervalHelper::class,
Doctrine\EntityDef::class,
Doctrine\EntityDefinitionUnavailable::class,
Doctrine\FieldDef::class,

0 comments on commit 0248e3d

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