Skip to content

Commit 98c92f2

Browse files
authored
Do not prefixes names in the same namespace (#460)
1 parent 1952bfc commit 98c92f2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+239
-217
lines changed

specs/class-const/global-scope-single-level.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class Command {}
4040
class Command
4141
{
4242
}
43-
\Humbug\Command::MAIN_CONST;
43+
Command::MAIN_CONST;
4444

4545
PHP
4646
],

specs/class-const/global-scope-two-level.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Command
4646
}
4747
namespace Humbug;
4848
49-
\Humbug\PHPUnit\Command::MAIN_CONST;
49+
PHPUnit\Command::MAIN_CONST;
5050

5151
PHP
5252
],

specs/class-const/namespace-scope-single-level.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Command {}
4242
class Command
4343
{
4444
}
45-
\Humbug\X\Command::MAIN_CONST;
45+
Command::MAIN_CONST;
4646

4747
PHP
4848
],

specs/class-const/namespace-scope-two-level.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class Command
4646
}
4747
namespace Humbug\X;
4848
49-
\Humbug\X\PHPUnit\Command::MAIN_CONST;
49+
PHPUnit\Command::MAIN_CONST;
5050

5151
PHP
5252
],
@@ -103,7 +103,7 @@ class Command
103103
\class_alias('Humbug\\X\\PHPUnit\\Command', 'X\\PHPUnit\\Command', \false);
104104
namespace Humbug\X;
105105
106-
\Humbug\X\PHPUnit\Command::MAIN_CONST;
106+
PHPUnit\Command::MAIN_CONST;
107107

108108
PHP
109109
],

specs/class-static-prop/global-scope-single-level.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class Command {}
3939
class Command
4040
{
4141
}
42-
\Humbug\Command::$mainStaticProp;
42+
Command::$mainStaticProp;
4343

4444
PHP
4545
,

specs/class-static-prop/global-scope-two-level.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Command
4545
}
4646
namespace Humbug;
4747
48-
\Humbug\PHPUnit\Command::$mainStaticProp;
48+
PHPUnit\Command::$mainStaticProp;
4949

5050
PHP
5151
,

specs/class-static-prop/namespace-scope-single-level.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Command {}
4141
class Command
4242
{
4343
}
44-
\Humbug\X\Command::$mainStaticProp;
44+
Command::$mainStaticProp;
4545

4646
PHP
4747
,

specs/class-static-prop/namespace-scope-two-level.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class Command
4545
}
4646
namespace Humbug\X;
4747
48-
\Humbug\X\PHPUnit\Command::$mainStaticProp;
48+
PHPUnit\Command::$mainStaticProp;
4949

5050
PHP
5151
,
@@ -101,7 +101,7 @@ class Command
101101
\class_alias('Humbug\\X\\PHPUnit\\Command', 'X\\PHPUnit\\Command', \false);
102102
namespace Humbug\X;
103103
104-
\Humbug\X\PHPUnit\Command::$mainStaticProp;
104+
PHPUnit\Command::$mainStaticProp;
105105

106106
PHP
107107
],

specs/class/anonymous.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,22 @@ public function test()
6666
{
6767
}
6868
};
69-
new class extends \Humbug\A implements \Humbug\B, \Humbug\C, \Iterator
69+
new class extends A implements B, C, \Iterator
7070
{
7171
};
7272
new class
7373
{
7474
public $foo;
7575
};
76-
new class($a, $b) extends \Humbug\A
76+
new class($a, $b) extends A
7777
{
7878
use T;
7979
};
8080
class A
8181
{
8282
public function test()
8383
{
84-
return new class($this) extends \Humbug\A
84+
return new class($this) extends A
8585
{
8686
const A = 'B';
8787
};
@@ -141,22 +141,22 @@ public function test()
141141
{
142142
}
143143
};
144-
new class extends \Humbug\A implements \Humbug\B, \Humbug\C, \Iterator
144+
new class extends A implements B, C, \Iterator
145145
{
146146
};
147147
new class
148148
{
149149
public $foo;
150150
};
151-
new class($a, $b) extends \Humbug\A
151+
new class($a, $b) extends A
152152
{
153153
use T;
154154
};
155155
class A
156156
{
157157
public function test()
158158
{
159-
return new class($this) extends \Humbug\A
159+
return new class($this) extends A
160160
{
161161
const A = 'B';
162162
};
@@ -284,7 +284,7 @@ public function test()
284284
{
285285
}
286286
};
287-
new class extends \Humbug\A implements \Humbug\B, \Humbug\C, \Iterator
287+
new class extends \Humbug\A implements B, \Humbug\C, \Iterator
288288
{
289289
};
290290
new class
@@ -356,22 +356,22 @@ public function test()
356356
{
357357
}
358358
};
359-
new class extends \Humbug\Foo\A implements \Humbug\Foo\B, \Humbug\Foo\C, \Iterator
359+
new class extends A implements B, C, \Iterator
360360
{
361361
};
362362
new class
363363
{
364364
public $foo;
365365
};
366-
new class($a, $b) extends \Humbug\Foo\A
366+
new class($a, $b) extends A
367367
{
368368
use T;
369369
};
370370
class A
371371
{
372372
public function test()
373373
{
374-
return new class($this) extends \Humbug\Foo\A
374+
return new class($this) extends A
375375
{
376376
const A = 'B';
377377
};
@@ -428,7 +428,7 @@ class A
428428
{
429429
public function test()
430430
{
431-
return new class($this) extends \Humbug\A
431+
return new class($this) extends A
432432
{
433433
const A = 'B';
434434
};
@@ -449,7 +449,7 @@ public function test()
449449
{
450450
}
451451
};
452-
new class extends A implements \Humbug\Foo\B, \Humbug\Foo\C, \Iterator
452+
new class extends A implements B, C, \Iterator
453453
{
454454
};
455455
namespace Humbug\Bar;

specs/class/interface.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class C
4545
class D
4646
{
4747
}
48-
interface A extends \Humbug\C, \Humbug\D, \Iterator
48+
interface A extends C, D, \Iterator
4949
{
5050
public function a();
5151
}
@@ -82,7 +82,7 @@ class D
8282
{
8383
}
8484
\class_alias('Humbug\\D', 'D', \false);
85-
interface A extends \Humbug\C, \Humbug\D, \Iterator
85+
interface A extends C, D, \Iterator
8686
{
8787
public function a();
8888
}
@@ -117,7 +117,7 @@ class C
117117
class D
118118
{
119119
}
120-
interface A extends \Humbug\Foo\C, \Humbug\Foo\D, Iterator
120+
interface A extends C, D, Iterator
121121
{
122122
public function a();
123123
}
@@ -153,7 +153,7 @@ class C
153153
class D
154154
{
155155
}
156-
interface A extends \Humbug\Foo\C, \Humbug\Foo\D, Iterator
156+
interface A extends C, D, Iterator
157157
{
158158
public function a();
159159
}
@@ -192,7 +192,7 @@ class C
192192
class D
193193
{
194194
}
195-
interface A extends \Humbug\Foo\C, \Humbug\Foo\D, Iterator
195+
interface A extends C, D, Iterator
196196
{
197197
public function a();
198198
}
@@ -297,7 +297,7 @@ class D
297297
class E
298298
{
299299
}
300-
interface A extends \Humbug\X\D, \Humbug\X\E
300+
interface A extends D, E
301301
{
302302
public function a();
303303
}
@@ -309,7 +309,7 @@ class D
309309
class E
310310
{
311311
}
312-
interface B extends \Humbug\Y\D, \Humbug\Y\E
312+
interface B extends D, E
313313
{
314314
public function a();
315315
}
@@ -321,7 +321,7 @@ class D
321321
class E
322322
{
323323
}
324-
interface C extends \Humbug\Z\D, \Humbug\Z\E
324+
interface C extends D, E
325325
{
326326
public function a();
327327
}

specs/class/regular-extend.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function a()
4545
{
4646
}
4747
}
48-
class B extends \Humbug\A implements \Iterator
48+
class B extends A implements \Iterator
4949
{
5050
}
5151

@@ -77,7 +77,7 @@ public function a()
7777
{
7878
}
7979
}
80-
class B extends \Humbug\Foo\A implements Iterator
80+
class B extends A implements Iterator
8181
{
8282
}
8383

@@ -111,7 +111,7 @@ public function a()
111111
{
112112
}
113113
}
114-
class B extends \Humbug\Foo\A
114+
class B extends A
115115
{
116116
}
117117
\class_alias('Humbug\\Foo\\B', 'Foo\\B', \false);

specs/class/typed-properties.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function a() {}
4343
class A
4444
{
4545
public string $name;
46-
public ?\Humbug\B $foo;
46+
public ?B $foo;
4747
public function a()
4848
{
4949
}
@@ -75,7 +75,7 @@ public function a() {}
7575
class A
7676
{
7777
public string $name;
78-
public ?\Humbug\B $foo;
78+
public ?B $foo;
7979
public function a()
8080
{
8181
}
@@ -106,7 +106,7 @@ public function a()
106106
class A
107107
{
108108
public string $name;
109-
public ?\Humbug\Foo\B $foo;
109+
public ?B $foo;
110110
public function a()
111111
{
112112
}
@@ -135,7 +135,7 @@ public function a() {}
135135
class A
136136
{
137137
public string $name;
138-
public ?\Humbug\Foo\B $foo;
138+
public ?B $foo;
139139
public function a()
140140
{
141141
}
@@ -170,7 +170,7 @@ public function a() {}
170170
class A
171171
{
172172
public string $name;
173-
public ?\Humbug\Foo\B $foo;
173+
public ?B $foo;
174174
public function a()
175175
{
176176
}
@@ -209,10 +209,10 @@ public function a()
209209
class A
210210
{
211211
public string $name;
212-
public ?\Humbug\Foo\B $foo;
212+
public ?B $foo;
213213
public ?C $foo;
214214
public ?DateTimeImmutable $bar;
215-
public ?\Humbug\Foo\Closure $baz;
215+
public ?Closure $baz;
216216
public function a()
217217
{
218218
}

specs/const/const-declaration-with-global-whitelisting.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@
4040
4141
namespace Humbug;
4242
43-
const FOO_CONST = \Humbug\foo();
44-
\define('BAR_CONST', \Humbug\foo());
45-
\define('Humbug\\Acme\\BAR_CONST', \Humbug\foo());
46-
\define(\FOO_CONST, \Humbug\foo());
47-
\define(\FOO_CONST, \Humbug\foo());
48-
\define(\Humbug\Acme\BAR_CONST, \Humbug\foo());
43+
const FOO_CONST = foo();
44+
\define('BAR_CONST', foo());
45+
\define('Humbug\\Acme\\BAR_CONST', foo());
46+
\define(\FOO_CONST, foo());
47+
\define(\FOO_CONST, foo());
48+
\define(\Humbug\Acme\BAR_CONST, foo());
4949

5050
PHP
5151
],
@@ -92,12 +92,12 @@
9292
9393
namespace Humbug;
9494
95-
\define('FOO_CONST', \Humbug\foo());
96-
\define('BAR_CONST', \Humbug\foo());
97-
\define('Acme\\BAR_CONST', \Humbug\foo());
98-
\define(\FOO_CONST, \Humbug\foo());
99-
\define(\FOO_CONST, \Humbug\foo());
100-
\define(\Acme\BAR_CONST, \Humbug\foo());
95+
\define('FOO_CONST', foo());
96+
\define('BAR_CONST', foo());
97+
\define('Acme\\BAR_CONST', foo());
98+
\define(\FOO_CONST, foo());
99+
\define(\FOO_CONST, foo());
100+
\define(\Acme\BAR_CONST, foo());
101101

102102
PHP
103103
],

0 commit comments

Comments
 (0)