Lines Matching refs:BuilderHelpers
15 $this->assertEquals($builder->getNode(), BuilderHelpers::normalizeNode($builder));
18 $this->assertSame($attribute, BuilderHelpers::normalizeNode($attribute));
22 BuilderHelpers::normalizeNode('test');
27 $this->assertSame($stmt, BuilderHelpers::normalizeStmt($stmt));
30 $normalizedExpr = BuilderHelpers::normalizeStmt($expr);
36 BuilderHelpers::normalizeStmt(new Node\Attribute(new Node\Name('Test')));
42 BuilderHelpers::normalizeStmt('test');
47 $this->assertSame($identifier, BuilderHelpers::normalizeIdentifier($identifier));
48 $this->assertEquals($identifier, BuilderHelpers::normalizeIdentifier('fn'));
52 BuilderHelpers::normalizeIdentifier(1);
57 $this->assertSame($identifier, BuilderHelpers::normalizeIdentifierOrExpr($identifier));
60 $this->assertSame($expr, BuilderHelpers::normalizeIdentifierOrExpr($expr));
61 $this->assertEquals($identifier, BuilderHelpers::normalizeIdentifierOrExpr('fn'));
65 BuilderHelpers::normalizeIdentifierOrExpr(1);
70 $this->assertSame($name, BuilderHelpers::normalizeName($name));
73 BuilderHelpers::normalizeName('\\Namespace\\Test')
77 BuilderHelpers::normalizeName('namespace\\Test')
79 $this->assertEquals($name, BuilderHelpers::normalizeName('test'));
83 BuilderHelpers::normalizeName('');
89 BuilderHelpers::normalizeName(1);
94 $this->assertSame($expr, BuilderHelpers::normalizeNameOrExpr($expr));
97 $this->assertSame($name, BuilderHelpers::normalizeNameOrExpr($name));
100 BuilderHelpers::normalizeNameOrExpr('\\Namespace\\Test')
104 BuilderHelpers::normalizeNameOrExpr('namespace\\Test')
106 $this->assertEquals($name, BuilderHelpers::normalizeNameOrExpr('test'));
110 BuilderHelpers::normalizeNameOrExpr('');
116 BuilderHelpers::normalizeNameOrExpr(1);
120 $this->assertEquals(new Node\Identifier('array'), BuilderHelpers::normalizeType('array'));
121 … $this->assertEquals(new Node\Identifier('callable'), BuilderHelpers::normalizeType('callable'));
122 $this->assertEquals(new Node\Identifier('string'), BuilderHelpers::normalizeType('string'));
123 $this->assertEquals(new Node\Identifier('int'), BuilderHelpers::normalizeType('int'));
124 $this->assertEquals(new Node\Identifier('float'), BuilderHelpers::normalizeType('float'));
125 $this->assertEquals(new Node\Identifier('bool'), BuilderHelpers::normalizeType('bool'));
126 … $this->assertEquals(new Node\Identifier('iterable'), BuilderHelpers::normalizeType('iterable'));
127 $this->assertEquals(new Node\Identifier('void'), BuilderHelpers::normalizeType('void'));
128 $this->assertEquals(new Node\Identifier('object'), BuilderHelpers::normalizeType('object'));
129 $this->assertEquals(new Node\Identifier('null'), BuilderHelpers::normalizeType('null'));
130 $this->assertEquals(new Node\Identifier('false'), BuilderHelpers::normalizeType('false'));
131 $this->assertEquals(new Node\Identifier('mixed'), BuilderHelpers::normalizeType('mixed'));
132 $this->assertEquals(new Node\Identifier('never'), BuilderHelpers::normalizeType('never'));
133 $this->assertEquals(new Node\Identifier('true'), BuilderHelpers::normalizeType('true'));
136 $this->assertSame($intIdentifier, BuilderHelpers::normalizeType($intIdentifier));
139 $this->assertSame($intName, BuilderHelpers::normalizeType($intName));
142 $this->assertSame($intNullable, BuilderHelpers::normalizeType($intNullable));
145 $this->assertSame($unionType, BuilderHelpers::normalizeType($unionType));
148 $this->assertSame($intersectionType, BuilderHelpers::normalizeType($intersectionType));
151 $nullable = BuilderHelpers::normalizeType('?int');
157 BuilderHelpers::normalizeType(1);
163 BuilderHelpers::normalizeType('?void');
169 BuilderHelpers::normalizeType('?mixed');
175 BuilderHelpers::normalizeType('?never');
180 $this->assertSame($expression, BuilderHelpers::normalizeValue($expression));
182 …$this->assertEquals(new Expr\ConstFetch(new Node\Name('null')), BuilderHelpers::normalizeValue(nul…
183 …$this->assertEquals(new Expr\ConstFetch(new Node\Name('true')), BuilderHelpers::normalizeValue(tru…
184 …$this->assertEquals(new Expr\ConstFetch(new Node\Name('false')), BuilderHelpers::normalizeValue(fa…
185 $this->assertEquals(new Scalar\Int_(2), BuilderHelpers::normalizeValue(2));
186 $this->assertEquals(new Scalar\Float_(2.5), BuilderHelpers::normalizeValue(2.5));
187 $this->assertEquals(new Scalar\String_('text'), BuilderHelpers::normalizeValue('text'));
193 BuilderHelpers::normalizeValue([
201 BuilderHelpers::normalizeValue(new \stdClass());
206 $this->assertSame($docComment, BuilderHelpers::normalizeDocComment($docComment));
208 $this->assertEquals($docComment, BuilderHelpers::normalizeDocComment('Some doc comment'));
212 BuilderHelpers::normalizeDocComment(1);
219 $this->assertEquals($attributeGroup, BuilderHelpers::normalizeAttribute($attribute));
220 $this->assertSame($attributeGroup, BuilderHelpers::normalizeAttribute($attributeGroup));
224 BuilderHelpers::normalizeAttribute('test');
234 …stFetch(new FullyQualified(\Suit::class), new Identifier('Hearts')), BuilderHelpers::normalizeValu…