Skip to content

Commit d78d990

Browse files
committed
Renamed to Mabe_Enum to have it within an own namespace and added composer.json
1 parent 3ab6a4f commit d78d990

File tree

3 files changed

+29
-9
lines changed

3 files changed

+29
-9
lines changed

composer.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "marc-mabe/php-enum",
3+
"description": "Enumerations for PHP 5 (without SplEnum)",
4+
"type": "library",
5+
"keywords": [
6+
"enum"
7+
],
8+
"homepage": "http://www.marc-bennewitz.de/",
9+
"license": "BSD-3-Clause",
10+
"require": {
11+
"php": ">=5.0.0",
12+
"ext-reflection": "*"
13+
},
14+
"autoload": {
15+
"psr-0": {
16+
"Mabe_": "src/",
17+
"MabeTest_": "tests/"
18+
}
19+
}
20+
}

src/Enum.php renamed to src/Mabe/Enum.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<?php
22
/**
3-
* TODO: description
3+
* Class to implement enumerations for PHP 5 (without SplEnum)
44
*
55
* @link http://github.com/marc-mabe/php-enum for the canonical source repository
66
* @copyright Copyright (c) 2012 Marc Bennewitz
77
* @license http://github.com/marc-mabe/php-enum/blob/master/LICENSE.txt New BSD License
88
*/
99

10-
abstract class Enum
10+
abstract class Mabe_Enum
1111
{
1212
/**
1313
* The current selected value

tests/EnumTest.php renamed to tests/MabeTest/EnumTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/**
3-
* TODO: description
3+
* Unit tests for the class Mabe_Enum
44
*
55
* @link http://github.com/marc-mabe/php-enum for the canonical source repository
66
* @copyright Copyright (c) 2012 Marc Bennewitz
@@ -16,9 +16,9 @@
1616
exit(1);
1717
}
1818

19-
require_once dirname(__FILE__) . '/../src/Enum.php';
19+
require_once dirname(__FILE__) . '/../../src/Mabe/Enum.php';
2020

21-
class EnumTest extends PHPUnit_Framework_TestCase
21+
class MabeTest_EnumTest extends PHPUnit_Framework_TestCase
2222
{
2323

2424
public function testEnumWithDefaultValue()
@@ -98,26 +98,26 @@ public function testSetValueThrowsInvalidArgumentExceptionOnStrictComparison()
9898

9999
}
100100

101-
class EnumWithDefaultValue extends Enum
101+
class EnumWithDefaultValue extends Mabe_Enum
102102
{
103103
const ONE = 1;
104104
const TWO = 2;
105105
protected $value = 1;
106106
}
107107

108-
class EnumWithNullAsDefaultValue extends Enum
108+
class EnumWithNullAsDefaultValue extends Mabe_Enum
109109
{
110110
const NONE = null;
111111
const ONE = 1;
112112
const TWO = 2;
113113
}
114114

115115

116-
class EnumWithoutDefaultValue extends Enum
116+
class EnumWithoutDefaultValue extends Mabe_Enum
117117
{
118118
const ONE = 1;
119119
const TWO = 2;
120120
}
121121

122-
class EmptyEnum extends Enum
122+
class EmptyEnum extends Mabe_Enum
123123
{}

0 commit comments

Comments
 (0)