From ba48d3a262aaf9905b47c29d23fb300a114dbc36 Mon Sep 17 00:00:00 2001 From: Julio Foulquie Date: Tue, 29 Mar 2022 21:48:09 -0300 Subject: [PATCH] whitespaces --- generator/tests/MethodTest.php | 8 ++--- .../PhpStanFunctions/PhpStanTypeTest.php | 34 +++++++++---------- 2 files changed, 20 insertions(+), 22 deletions(-) diff --git a/generator/tests/MethodTest.php b/generator/tests/MethodTest.php index 0b467c87..3b8dda9b 100644 --- a/generator/tests/MethodTest.php +++ b/generator/tests/MethodTest.php @@ -65,7 +65,7 @@ public function testGetTypeHintFromRessource() $this->assertEquals('', $params[0]->getSignatureType()); $this->assertEquals('int', $params[1]->getDocBlockType()); $this->assertEquals('int', $params[1]->getSignatureType()); - + $docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/hash/functions/hash-update.xml'); $xmlObject = $docPage->getMethodSynopsis(); $method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader(), Method::FALSY_TYPE); @@ -73,7 +73,7 @@ public function testGetTypeHintFromRessource() $this->assertEquals('\HashContext', $params[0]->getDocBlockType()); $this->assertEquals('\HashContext', $params[0]->getSignatureType()); } - + public function testImapOpen5Parameter() { $docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/imap/functions/imap-open.xml'); @@ -81,7 +81,7 @@ public function testImapOpen5Parameter() $method = new Method($xmlObject[0], $docPage->loadAndResolveFile(), $docPage->getModule(), new PhpStanFunctionMapReader(), Method::FALSY_TYPE); $params = $method->getParams(); $this->assertEquals('\array', $params[5]->getDocBlockType()); - $this->assertEquals('array', $params[5]->getSignatureType()); + $this->assertEquals('array', $params[5]->getSignatureType()); } public function testGetInitializer() @@ -94,7 +94,7 @@ public function testGetInitializer() $this->assertEquals('', $params[0]->getDefaultValue()); $this->assertEquals('false', $params[1]->getDefaultValue()); } - + public function testGetReturnDocBlock(): void { $docPage = new DocPage(__DIR__ . '/../doc/doc-en/en/reference/array/functions/array-replace.xml'); diff --git a/generator/tests/PhpStanFunctions/PhpStanTypeTest.php b/generator/tests/PhpStanFunctions/PhpStanTypeTest.php index d25c8df9..37deb655 100644 --- a/generator/tests/PhpStanFunctions/PhpStanTypeTest.php +++ b/generator/tests/PhpStanFunctions/PhpStanTypeTest.php @@ -3,13 +3,12 @@ namespace Safe\PhpStanFunctions; - use PHPUnit\Framework\TestCase; use Safe\Method; class PhpStanTypeTest extends TestCase { - public function testMixedTypes(): void + public function testMixedTypes(): void { $param = new PhpStanType('array|string|int'); $this->assertEquals('\array|string|int', $param->getDocBlockType()); @@ -53,8 +52,8 @@ public function testGenerics(): void $this->assertEquals('array{0:float,1:float,2:float,3:float,4:float,5:float}', $param->getDocBlockType()); $this->assertEquals('array', $param->getSignatureType()); } - - public function testNullable(): void + + public function testNullable(): void { $param = new PhpStanType('array|null'); $this->assertEquals(true, $param->isNullable()); @@ -76,8 +75,8 @@ public function testNullable(): void $this->assertEquals('\HashContext|null', $param->getDocBlockType()); $this->assertEquals('?\HashContext', $param->getSignatureType()); } - - public function testParenthesisOutsideOfCallable(): void + + public function testParenthesisOutsideOfCallable(): void { $param = new PhpStanType('(?int)|(?string)'); $this->assertEquals(true, $param->isNullable()); @@ -92,8 +91,8 @@ public function testFalsable(): void $this->assertEquals('string|false', $param->getDocBlockType()); $this->assertEquals('string', $param->getSignatureType()); } - - public function testResource(): void + + public function testResource(): void { $param = new PhpStanType('resource'); $this->assertEquals('resource', $param->getDocBlockType()); @@ -106,8 +105,8 @@ public function testNamespace(): void $this->assertEquals('\GMP', $param->getDocBlockType()); $this->assertEquals('\GMP', $param->getSignatureType()); } - - public function testVoid(): void + + public function testVoid(): void { $param = new PhpStanType(''); $this->assertEquals('', $param->getDocBlockType()); @@ -117,8 +116,8 @@ public function testVoid(): void $this->assertEquals('void', $param->getDocBlockType()); $this->assertEquals('void', $param->getSignatureType()); } - - public function testOciSpecialCases(): void + + public function testOciSpecialCases(): void { $param = new PhpStanType('OCI-Collection'); $this->assertEquals('\OCI-Collection', $param->getDocBlockType()); @@ -128,14 +127,14 @@ public function testOciSpecialCases(): void $this->assertEquals('\OCI-Lob', $param->getDocBlockType()); $this->assertEquals('', $param->getSignatureType()); } - - public function testErrorTypeInteraction(): void + + public function testErrorTypeInteraction(): void { //bool => void if the method is falsy $param = new PhpStanType('bool'); $this->assertEquals('void', $param->getDocBlockType(Method::FALSY_TYPE)); $this->assertEquals('void', $param->getSignatureType(Method::FALSY_TYPE)); - + //int|false => int if the method is falsy $param = new PhpStanType('int|false'); $this->assertEquals('int', $param->getDocBlockType(Method::FALSY_TYPE)); @@ -146,8 +145,8 @@ public function testErrorTypeInteraction(): void $this->assertEquals('int', $param->getDocBlockType(Method::NULLSY_TYPE)); $this->assertEquals('int', $param->getSignatureType(Method::NULLSY_TYPE)); } - - public function testDuplicateType(): void + + public function testDuplicateType(): void { $param = new PhpStanType('array|array|array>'); $this->assertEquals('array|array|array>', $param->getDocBlockType()); @@ -188,5 +187,4 @@ public function testNumbersAreRemoved(): void $this->assertEquals('int', $param->getDocBlockType()); $this->assertEquals('int', $param->getSignatureType()); } - }