Skip to content

Commit

Permalink
Merge branch 'release/1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelcom committed Feb 24, 2016
2 parents 95e90b1 + d449f34 commit 9f5823e
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 56 deletions.
2 changes: 1 addition & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

return Symfony\CS\Config\Config::create()
Expand Down
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ php:
- 5.4
- 5.5
- 5.6
- 7

before_install:
- composer self-update
Expand All @@ -19,4 +20,4 @@ script:

after_script:
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
60 changes: 22 additions & 38 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,79 +1,63 @@
CHANGELOG
=========
# CHANGELOG

1.0.0
---------
## 1.0.1
- issue #4 - Cyrillic alphabet is not handled well

## 1.0.0
- First major release

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

0.0.16
-----
## 0.0.16
- Minor: correct annotation

0.0.15
-----
## 0.0.15
- Issue #3: fix constant declaration for specific value containing (

0.0.14
-----
## 0.0.14
- Improvement: make annotation splitting more clever using word wrap in order to keep

0.0.13
-----
## 0.0.13
- Issue #2 : allow backslash for function/method parameter type

0.0.12
-----
## 0.0.12
- 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.

0.0.11
-----
## 0.0.11
- Issue : allow backslash within class name for namespace

0.0.10
-----
## 0.0.10
- Allow to provide annotation max length to use

0.0.9
-----
## 0.0.9
- Fix issue : within a class, the additonal multi lines are not indented correcly

0.0.8
-----
## 0.0.8
- Fix issue: workaround for known var_export issue with float value

0.0.7
-----
## 0.0.7
- Fix issue: if variable has 'news' as value, the variable is generated with news instead of 'news'

0.0.6
-----
## 0.0.6
- Improvement: improve lisiblity and extensibility for PhpVariable and PhpFunctionParameter

0.0.5
-----
## 0.0.5
- Fix issue: function parameter type is not tooken into account

0.0.4
-----
## 0.0.4
- Fix issue regarding property/variable that has no value but always has a null value assigned with an assignment sign

0.0.3
-----
## 0.0.3
- Apply PSR-2 rule: All PHP files MUST end with a single blank line.

0.0.2
-----
## 0.0.2
- Code coverage improved
- Several methods have been refactored to minimize them and consolidate them
- Component/PhpInterface has been added
- Component/PhpFile has been cleaned and enhanced
- Component/PhpClass has been cleaned
- Component/AbstractComponent has been enhanced

0.0.1
-----
## 0.0.1
- Initial version
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# WsdlToPhp Php Generator, a Real PHP source code generator
[![Latest Stable Version](https://poser.pugx.org/wsdltophp/phpgenerator/version.png)](https://packagist.org/packages/wsdltophp/phpgenerator)
[![Build Status](https://api.travis-ci.org/WsdlToPhp/PhpGenerator.svg)](https://travis-ci.org/WsdlToPhp/PhpGenerator)
[![PHP 7 ready](http://php7ready.timesplinter.ch/WsdlToPhp/PhpGenerator/badge.svg)](https://travis-ci.org/WsdlToPhp/PhpGenerator)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/badges/quality-score.png)](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/)
[![Code Coverage](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/badges/coverage.png)](https://scrutinizer-ci.com/g/WsdlToPhp/PhpGenerator/)
[![Dependency Status](https://www.versioneye.com/user/projects/5571b32b6634650018000011/badge.svg)](https://www.versioneye.com/user/projects/5571b32b6634650018000011)
Expand All @@ -21,4 +22,4 @@ You can run the unit tests with the following command:
$ cd /path/to/src/WsdlToPhp/PhpGenerator/
$ composer install
$ phpunit
```
```
6 changes: 3 additions & 3 deletions src/Element/AbstractElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ public function getName()
*/
public static function nameIsValid($name, $allowBackslash = false)
{
$pattern = '/^[a-zA-Z_][a-zA-Z0-9_]*$/D';
$pattern = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/';
if ($allowBackslash === true) {
$pattern = '/^[a-zA-Z_\\\][a-zA-Z0-9_\\\]*$/D';
$pattern = '/[a-zA-Z_\x7f-\xff\\\][a-zA-Z0-9_\x7f-\xff\\\]*/';
}
return preg_match($pattern, $name) === 1;
return preg_match($pattern, $name);
}
/**
* @param mixed $string
Expand Down
2 changes: 1 addition & 1 deletion tests/Element/PhpAnnotationBlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ public function testAddChildContentOk()
*/
public function testGetConstructWithException()
{
$annotationBlock = new PhpAnnotationBlock(array(
new PhpAnnotationBlock(array(
new PhpFunction('Bar'),
));
}
Expand Down
6 changes: 0 additions & 6 deletions tests/Element/PhpClassTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,19 +137,13 @@ public function testSetAbstract()
$class->setAbstract(1);
}

/**
* @expectedException InvalidArgumentException
*/
public function testSetExtends()
{
$class = new PhpClass('Foo');

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

/**
* @expectedException InvalidArgumentException
*/
public function testSetInterfaces()
{
$class = new PhpClass('Foo');
Expand Down
4 changes: 2 additions & 2 deletions tests/Element/PhpFunctionParameterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public function testTypeIsValid()
$this->assertTrue(PhpFunctionParameter::typeIsValid('string'));
}

public function testTypeIsValidFalse()
public function testTypeIsValidAccentuated()
{
$this->assertFalse(PhpFunctionParameter::typeIsValid('Partagé'));
$this->assertTrue(PhpFunctionParameter::typeIsValid('Partagé'));
}

public function testSetTypeForDeclaration()
Expand Down
3 changes: 0 additions & 3 deletions tests/Element/PhpFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ public function testSetParameters()
));
}

/**
* @expectedException InvalidArgumentException
*/
public function testSetName()
{
$function = new PhpFunction('foo', array());
Expand Down
13 changes: 13 additions & 0 deletions tests/Element/PhpVariableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,17 @@ public function testToStringFloatValue()

$this->assertSame('$foo = 0.4;', $variable->toString());
}

public function testCyrillic()
{
$variable = new PhpVariable('КонтактнаяИнформация', 0.4);

$this->assertSame('$КонтактнаяИнформация = 0.4;', $variable->toString());
}

public function testé()
{
$é = 4;
$this->assertEquals(4, $é);
}
}

0 comments on commit 9f5823e

Please sign in to comment.