Skip to content

Commit

Permalink
fixes phpro#76
Browse files Browse the repository at this point in the history
  • Loading branch information
janvernieuwe committed Sep 29, 2017
1 parent 5908481 commit a34d97a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion spec/Phpro/SoapClient/CodeGenerator/Model/TypeSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function it_has_a_path_name()
function it_should_replace_underscores_in_paths()
{
$this->beConstructedWith('MyNamespace', 'myType_3_2', ['prop1' => 'string']);
$this->getFileInfo('my/dir')->getPathname()->shouldReturn('my/dir/MyType/3/2.php');
$this->getFileInfo('my/some_dir')->getPathname()->shouldReturn('my/some_dir/MyType/3/2.php');
}

function it_has_properties()
Expand Down
4 changes: 2 additions & 2 deletions src/Phpro/SoapClient/CodeGenerator/Model/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public function getXsdName()

public function getFileInfo(string $destination) : SplFileInfo
{
$path = rtrim($destination, '/\\').DIRECTORY_SEPARATOR.$this->getName().'.php';
$path = str_replace('_', DIRECTORY_SEPARATOR, $path);
$name = str_replace('_', DIRECTORY_SEPARATOR, $this->getName());
$path = rtrim($destination, '/\\').DIRECTORY_SEPARATOR.$name.'.php';

return new SplFileInfo($path);
}
Expand Down

0 comments on commit a34d97a

Please sign in to comment.