File tree Expand file tree Collapse file tree 4 files changed +15
-26
lines changed Expand file tree Collapse file tree 4 files changed +15
-26
lines changed Original file line number Diff line number Diff line change 6
6
- $HOME/.composer/cache
7
7
- $HOME/.local
8
8
- $HOME/ocular.phar
9
- - $HOME/phpDocumentor.phar
10
9
11
10
env :
12
11
global :
13
12
- CODE_COVERAGE="0"
14
- - PHPDOC="0"
15
13
16
14
matrix :
17
15
fast_finish : true
@@ -22,7 +20,6 @@ matrix:
22
20
- php : 7.0
23
21
env :
24
22
- CODE_COVERAGE="1"
25
- - PHPDOC="1"
26
23
- php : 7.1
27
24
env :
28
25
- CODE_COVERAGE="1"
@@ -32,6 +29,15 @@ matrix:
32
29
- php : 7.3
33
30
env :
34
31
- CODE_COVERAGE="1"
32
+ - php : 7.4
33
+ env :
34
+ - CODE_COVERAGE="1"
35
+ - php : 8.0
36
+ env :
37
+ - CODE_COVERAGE="1"
38
+ - php : 8.1
39
+ env :
40
+ - CODE_COVERAGE="1"
35
41
- php : nightly
36
42
37
43
# HHVM is no longer supported on Ubuntu Precise. Please consider using Trusty with `dist: trusty`.
@@ -49,10 +55,6 @@ install:
49
55
- if [ "${CODE_COVERAGE}" == "1" ]; then
50
56
wget -q -N -t 3 --retry-connrefused 'https://scrutinizer-ci.com/ocular.phar' || return 0;
51
57
fi
52
- - if [ "${PHPDOC}" == "1" ]; then
53
- wget -q -N -t 3 --retry-connrefused 'https://github.com/phpDocumentor/phpDocumentor2/releases/download/v2.9.0/phpDocumentor.phar' || return 0;
54
- composer require --no-update --dev "evert/phpdoc-md:~0.2.0" || return 0;
55
- fi
56
58
- composer install -n
57
59
58
60
script :
@@ -66,16 +68,6 @@ after_script:
66
68
- if [ "${CODE_COVERAGE}" == "1" ]; then
67
69
php ocular.phar code-coverage:upload --format=php-clover coverage.clover;
68
70
fi
69
- - if [ "${PHPDOC}" == "1" ]; then
70
- git clone "https://${CI_USER_TOKEN}@github.com/marc-mabe/php-enum.wiki.git" &&
71
- php phpDocumentor.phar -d src -t docs/ --template="xml" &&
72
- php vendor/bin/phpdocmd --lt '%c' --index 'Home.md' docs/structure.xml php-enum.wiki/ &&
73
- cp php-enum.wiki/Home.md php-enum.wiki/_Sidebar.md &&
74
- cd php-enum.wiki/ &&
75
- git add . &&
76
- git commit -m "auto generated PHP doc" &&
77
- git push origin master:master;
78
- fi
79
71
80
72
notifications :
81
73
email : false
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public function __toString()
77
77
* @throws LogicException Enums are not cloneable
78
78
* because instances are implemented as singletons
79
79
*/
80
- final private function __clone ()
80
+ final public function __clone ()
81
81
{
82
82
throw new LogicException ('Enums are not cloneable ' );
83
83
}
@@ -299,7 +299,7 @@ final public static function getNames()
299
299
}
300
300
return self ::$ names [static ::class];
301
301
}
302
-
302
+
303
303
/**
304
304
* Get a list of enumerator ordinal numbers
305
305
*
@@ -324,7 +324,7 @@ final public static function getConstants()
324
324
325
325
/**
326
326
* Test if the given enumerator is part of this enumeration
327
- *
327
+ *
328
328
* @param static|null|bool|int|float|string|array $enumerator
329
329
* @return bool
330
330
*/
Original file line number Diff line number Diff line change @@ -233,7 +233,7 @@ public function testGetNamesConstantsNotDetected()
233
233
$ this ->assertSame ($ expectedNames [$ i ], $ names [$ i ]);
234
234
}
235
235
}
236
-
236
+
237
237
public function testGetOrdinals ()
238
238
{
239
239
$ constants = EnumInheritance::getConstants ();
@@ -364,12 +364,10 @@ public function testCloneNotCallableAndThrowsLogicException()
364
364
365
365
$ reflectionClass = new ReflectionClass ($ enum );
366
366
$ reflectionMethod = $ reflectionClass ->getMethod ('__clone ' );
367
- $ this ->assertTrue ($ reflectionMethod ->isPrivate (), 'The method __clone must be private ' );
368
367
$ this ->assertTrue ($ reflectionMethod ->isFinal (), 'The method __clone must be final ' );
369
368
370
- $ reflectionMethod ->setAccessible (true );
371
369
$ this ->expectException (LogicException::class);
372
- $ reflectionMethod -> invoke ( $ enum) ;
370
+ clone $ enum ;
373
371
}
374
372
375
373
public function testNotSerializable ()
@@ -430,7 +428,7 @@ public function testConstVisibility()
430
428
'PUB ' => ConstVisibilityEnum::PUB ,
431
429
), $ constants );
432
430
}
433
-
431
+
434
432
public function testConstVisibilityExtended ()
435
433
{
436
434
if (PHP_VERSION_ID < 70100 ) {
Original file line number Diff line number Diff line change 15
15
assert_options (ASSERT_ACTIVE , 1 );
16
16
assert_options (ASSERT_WARNING , 0 );
17
17
assert_options (ASSERT_BAIL , 0 );
18
- assert_options (ASSERT_QUIET_EVAL , 0 );
19
18
if (!class_exists ('AssertionError ' )) {
20
19
// AssertionError has been added in PHP-7.0
21
20
class AssertionError extends Exception {};
You can’t perform that action at this time.
0 commit comments