Skip to content

Commit 9f5823e

Browse files
committed
Merge branch 'release/1.0.1'
2 parents 95e90b1 + d449f34 commit 9f5823e

File tree

10 files changed

+46
-56
lines changed

10 files changed

+46
-56
lines changed

.php_cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
$finder = Symfony\CS\Finder\DefaultFinder::create()
44
->exclude('vendor')
5-
->exclude('Tests/resources')
5+
->exclude('tests')
66
->in(__DIR__);
77

88
return Symfony\CS\Config\Config::create()

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ php:
77
- 5.4
88
- 5.5
99
- 5.6
10+
- 7
1011

1112
before_install:
1213
- composer self-update
@@ -19,4 +20,4 @@ script:
1920

2021
after_script:
2122
- wget https://scrutinizer-ci.com/ocular.phar
22-
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
23+
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover

CHANGELOG.md

Lines changed: 22 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,63 @@
1-
CHANGELOG
2-
=========
1+
# CHANGELOG
32

4-
1.0.0
5-
---------
3+
## 1.0.1
4+
- issue #4 - Cyrillic alphabet is not handled well
5+
6+
## 1.0.0
67
- First major release
78

8-
1.0.0RC01
9-
---------
9+
## 1.0.0RC01
1010
- Major: update source code structure, put Component and Element fodlers under ```src``` fodler, update composer and phpunit accordingly
1111

12-
0.0.16
13-
-----
12+
## 0.0.16
1413
- Minor: correct annotation
1514

16-
0.0.15
17-
-----
15+
## 0.0.15
1816
- Issue #3: fix constant declaration for specific value containing (
1917

20-
0.0.14
21-
-----
18+
## 0.0.14
2219
- Improvement: make annotation splitting more clever using word wrap in order to keep
2320

24-
0.0.13
25-
-----
21+
## 0.0.13
2622
- Issue #2 : allow backslash for function/method parameter type
2723

28-
0.0.12
29-
-----
24+
## 0.0.12
3025
- Refactoring : Use statements and Namespace are contained by a file not a class as each element should only knows what it contains not what that is around itself.
3126

32-
0.0.11
33-
-----
27+
## 0.0.11
3428
- Issue : allow backslash within class name for namespace
3529

36-
0.0.10
37-
-----
30+
## 0.0.10
3831
- Allow to provide annotation max length to use
3932

40-
0.0.9
41-
-----
33+
## 0.0.9
4234
- Fix issue : within a class, the additonal multi lines are not indented correcly
4335

44-
0.0.8
45-
-----
36+
## 0.0.8
4637
- Fix issue: workaround for known var_export issue with float value
4738

48-
0.0.7
49-
-----
39+
## 0.0.7
5040
- Fix issue: if variable has 'news' as value, the variable is generated with news instead of 'news'
5141

52-
0.0.6
53-
-----
42+
## 0.0.6
5443
- Improvement: improve lisiblity and extensibility for PhpVariable and PhpFunctionParameter
5544

56-
0.0.5
57-
-----
45+
## 0.0.5
5846
- Fix issue: function parameter type is not tooken into account
5947

60-
0.0.4
61-
-----
48+
## 0.0.4
6249
- Fix issue regarding property/variable that has no value but always has a null value assigned with an assignment sign
6350

64-
0.0.3
65-
-----
51+
## 0.0.3
6652
- Apply PSR-2 rule: All PHP files MUST end with a single blank line.
6753

68-
0.0.2
69-
-----
54+
## 0.0.2
7055
- Code coverage improved
7156
- Several methods have been refactored to minimize them and consolidate them
7257
- Component/PhpInterface has been added
7358
- Component/PhpFile has been cleaned and enhanced
7459
- Component/PhpClass has been cleaned
7560
- Component/AbstractComponent has been enhanced
7661

77-
0.0.1
78-
-----
62+
## 0.0.1
7963
- Initial version

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# WsdlToPhp Php Generator, a Real PHP source code generator
22
[![Latest Stable Version](https://poser.pugx.org/wsdltophp/phpgenerator/version.png)](https://packagist.org/packages/wsdltophp/phpgenerator)
33
[![Build Status](https://api.travis-ci.org/WsdlToPhp/PhpGenerator.svg)](https://travis-ci.org/WsdlToPhp/PhpGenerator)
4+
[![PHP 7 ready](http://php7ready.timesplinter.ch/WsdlToPhp/PhpGenerator/badge.svg)](https://travis-ci.org/WsdlToPhp/PhpGenerator)
45
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/badges/quality-score.png)](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/)
56
[![Code Coverage](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/badges/coverage.png)](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/)
67
[![Dependency Status](https://www.versioneye.com/user/projects/5571b32b6634650018000011/badge.svg)](https://www.versioneye.com/user/projects/5571b32b6634650018000011)
@@ -21,4 +22,4 @@ You can run the unit tests with the following command:
2122
$ cd /path/to/src/WsdlToPhp/PhpGenerator/
2223
$ composer install
2324
$ phpunit
24-
```
25+
```

src/Element/AbstractElement.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ public function getName()
5151
*/
5252
public static function nameIsValid($name, $allowBackslash = false)
5353
{
54-
$pattern = '/^[a-zA-Z_][a-zA-Z0-9_]*$/D';
54+
$pattern = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/';
5555
if ($allowBackslash === true) {
56-
$pattern = '/^[a-zA-Z_\\\][a-zA-Z0-9_\\\]*$/D';
56+
$pattern = '/[a-zA-Z_\x7f-\xff\\\][a-zA-Z0-9_\x7f-\xff\\\]*/';
5757
}
58-
return preg_match($pattern, $name) === 1;
58+
return preg_match($pattern, $name);
5959
}
6060
/**
6161
* @param mixed $string

tests/Element/PhpAnnotationBlockTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function testAddChildContentOk()
153153
*/
154154
public function testGetConstructWithException()
155155
{
156-
$annotationBlock = new PhpAnnotationBlock(array(
156+
new PhpAnnotationBlock(array(
157157
new PhpFunction('Bar'),
158158
));
159159
}

tests/Element/PhpClassTest.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,19 +137,13 @@ public function testSetAbstract()
137137
$class->setAbstract(1);
138138
}
139139

140-
/**
141-
* @expectedException InvalidArgumentException
142-
*/
143140
public function testSetExtends()
144141
{
145142
$class = new PhpClass('Foo');
146143

147144
$class->setExtends('Partagé');
148145
}
149146

150-
/**
151-
* @expectedException InvalidArgumentException
152-
*/
153147
public function testSetInterfaces()
154148
{
155149
$class = new PhpClass('Foo');

tests/Element/PhpFunctionParameterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ public function testTypeIsValid()
3030
$this->assertTrue(PhpFunctionParameter::typeIsValid('string'));
3131
}
3232

33-
public function testTypeIsValidFalse()
33+
public function testTypeIsValidAccentuated()
3434
{
35-
$this->assertFalse(PhpFunctionParameter::typeIsValid('Partagé'));
35+
$this->assertTrue(PhpFunctionParameter::typeIsValid('Partagé'));
3636
}
3737

3838
public function testSetTypeForDeclaration()

tests/Element/PhpFunctionTest.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ public function testSetParameters()
5050
));
5151
}
5252

53-
/**
54-
* @expectedException InvalidArgumentException
55-
*/
5653
public function testSetName()
5754
{
5855
$function = new PhpFunction('foo', array());

tests/Element/PhpVariableTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,17 @@ public function testToStringFloatValue()
110110

111111
$this->assertSame('$foo = 0.4;', $variable->toString());
112112
}
113+
114+
public function testCyrillic()
115+
{
116+
$variable = new PhpVariable('КонтактнаяИнформация', 0.4);
117+
118+
$this->assertSame('$КонтактнаяИнформация = 0.4;', $variable->toString());
119+
}
120+
121+
public function testé()
122+
{
123+
$é = 4;
124+
$this->assertEquals(4, $é);
125+
}
113126
}

0 commit comments

Comments
 (0)