Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pôle IS
Bundles Symfony 2
plantuml-bundle
Commits
4644e09c
Commit
4644e09c
authored
Mar 10, 2016
by
Guillaume Perréal
Browse files
Correction des Namespaces Php.
parent
1d5a1de6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Command/
EntitySchema
Command.php
→
Command/
Generate
Command.php
View file @
4644e09c
File moved
Model/Namespace_/Php/AbstractNamespace.php
View file @
4644e09c
...
...
@@ -8,9 +8,8 @@
namespace
Irstea\PlantUmlBundle\Model\Namespace_\Php
;
use
Irstea\PlantUmlBundle\Model\Namespace_\AbstractNamespace
as
Base
;
use
Irstea\PlantUmlBundle\Model\NamespaceInterface
;
use
Irstea\PlantUmlBundle\Model\NodeInterface
;
use
Irstea\PlantUmlBundle\Writer\WritableInterface
;
use
Irstea\PlantUmlBundle\Writer\WriterInterface
;
/**
...
...
@@ -18,7 +17,7 @@ use Irstea\PlantUmlBundle\Writer\WriterInterface;
*
* @author Guillaume Perréal <guillaume.perreal@irstea.fr>
*/
abstract
class
AbstractNamespace
extends
AbstractNamespac
e
abstract
class
AbstractNamespace
extends
Bas
e
{
/**
* @var NamespaceInterface
...
...
@@ -50,15 +49,6 @@ abstract class AbstractNamespace extends AbstractNamespace
*/
abstract
protected
function
getNamespacePrefix
();
public
function
getNodeLabel
(
$name
)
{
$prefix
=
$this
->
getNamespacePrefix
();
if
(
0
===
strpos
(
$name
,
$prefix
))
{
return
substr
(
$name
,
strlen
(
$prefix
));
}
return
$name
;
}
public
function
getNodeId
(
$name
)
{
return
str_replace
(
'\\'
,
'.'
,
$name
)
.
'_node'
;
...
...
Model/Namespace_/Php/Namespace_.php
View file @
4644e09c
...
...
@@ -9,7 +9,6 @@
namespace
Irstea\PlantUmlBundle\Model\Namespace_\Php
;
use
Irstea\PlantUmlBundle\Model\ArrowInterface
;
use
Irstea\PlantUmlBundle\Model\NamespaceInterface
;
use
Irstea\PlantUmlBundle\Writer\WriterInterface
;
/**
...
...
@@ -17,7 +16,7 @@ use Irstea\PlantUmlBundle\Writer\WriterInterface;
*
* @author Guillaume Perréal <guillaume.perreal@irstea.fr>
*/
class
Namespace_
extends
Abstract
Hierachical
Namespace
class
Namespace_
extends
AbstractNamespace
{
/**
* @var AbstractNamespace
...
...
@@ -29,7 +28,7 @@ class Namespace_ extends AbstractHierachicalNamespace
*/
private
$name
;
public
function
__construct
(
Abstract
Hierachical
Namespace
$parent
,
$name
)
public
function
__construct
(
AbstractNamespace
$parent
,
$name
)
{
$this
->
parent
=
$parent
;
$this
->
name
=
$name
;
...
...
@@ -53,6 +52,15 @@ class Namespace_ extends AbstractHierachicalNamespace
return
$this
->
parent
->
getNamespacePrefix
()
.
$this
->
name
.
'\\'
;
}
public
function
getNodeLabel
(
$name
)
{
$prefix
=
$this
->
getNamespacePrefix
();
if
(
0
===
strpos
(
$name
,
$prefix
))
{
return
substr
(
$name
,
strlen
(
$prefix
));
}
return
$name
;
}
/**
* @param resource WriterInterface $writer
* @return self
...
...
Model/Namespace_/Php/RootNamespace.php
View file @
4644e09c
...
...
@@ -51,4 +51,9 @@ class RootNamespace extends AbstractNamespace
{
return
""
;
}
public
function
getNodeLabel
(
$className
)
{
return
$className
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment