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
32ba6c2c
Commit
32ba6c2c
authored
Jul 05, 2019
by
Guillaume Perréal
Browse files
CS.
parent
9561b621
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/Command/ListCommand.php
View file @
32ba6c2c
<?php
declare
(
strict_types
=
1
);
/**
* Copyright (C) 2019 IRSTEA
* All rights reserved.
/*
* This file is part of "irstea/plantuml-bundle".
*
* Copyright (C) 2016-2019 IRSTEA
*
* This program is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* @copyright 2019 IRSTEA
* @author guillaume.perreal
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License and the GNU
* Lesser General Public License along with this program. If not, see
* <https://www.gnu.org/licenses/>.
*/
namespace
Irstea\PlantUmlBundle\Command
;
use
Symfony\Component\Console\Command\Command
;
use
Symfony\Component\Console\Input\InputInterface
;
use
Symfony\Component\Console\Output\OutputInterface
;
/**
* Class ListCommand
* Class ListCommand
.
*/
class
ListCommand
extends
Command
{
...
...
@@ -32,6 +41,7 @@ class ListCommand extends Command
/**
* ListCommand constructor.
*
* @param string[] $graphNames
*/
public
function
__construct
(
array
$graphNames
)
...
...
@@ -41,7 +51,7 @@ class ListCommand extends Command
}
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
configure
()
{
...
...
@@ -51,7 +61,7 @@ class ListCommand extends Command
}
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
{
...
...
src/Command/RenderCommand.php
View file @
32ba6c2c
...
...
@@ -78,13 +78,14 @@ class RenderCommand extends Command
/**
* RenderCommand constructor.
*
* @param ContainerInterface $container
* @param array $graphNames
* @param string $defaultFormat
* @param string $defaultOutput
* @param string $javaBinary
* @param string $plantUmlJar
* @param string $dotBinary
* @param array
$graphNames
* @param string
$defaultFormat
* @param string
$defaultOutput
* @param string
$javaBinary
* @param string
$plantUmlJar
* @param string
$dotBinary
*/
public
function
__construct
(
ContainerInterface
$container
,
array
$graphNames
,
string
$defaultFormat
,
string
$defaultOutput
,
string
$javaBinary
,
string
$plantUmlJar
,
string
$dotBinary
)
{
...
...
@@ -99,7 +100,7 @@ class RenderCommand extends Command
}
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
configure
():
void
{
...
...
@@ -112,7 +113,7 @@ class RenderCommand extends Command
}
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
{
...
...
@@ -176,11 +177,13 @@ class RenderCommand extends Command
/**
* @param $target
* @param $format
*
* @return array
*/
private
function
startProcess
(
$target
,
$format
):
array
{
$cmd
=
sprintf
(
'%s -jar %s -graphvizdot %s -pipe -t%s'
,
$cmd
=
sprintf
(
'%s -jar %s -graphvizdot %s -pipe -t%s'
,
$this
->
findExecutable
(
$this
->
javaBinary
),
$this
->
plantUmlJar
,
$this
->
findExecutable
(
$this
->
dotBinary
),
...
...
@@ -207,6 +210,7 @@ class RenderCommand extends Command
/**
* @param string $nameOrPath
*
* @return string
*/
private
function
findExecutable
(
string
$nameOrPath
):
string
...
...
@@ -219,6 +223,7 @@ class RenderCommand extends Command
if
(
$path
===
null
)
{
throw
new
\
RuntimeException
(
"cannot find executable:
$nameOrPath
"
);
}
return
$path
;
}
}
src/Finder/ClassFinder.php
View file @
32ba6c2c
...
...
@@ -44,6 +44,7 @@ class ClassFinder implements FinderInterface
/**
* ClassFinder constructor.
*
* @param string[] $directories
*/
public
function
__construct
(
array
$directories
)
...
...
src/Model/Filter/AbstractListFilter.php
View file @
32ba6c2c
...
...
@@ -40,8 +40,9 @@ abstract class AbstractListFilter implements ClassFilterInterface
/**
* AbstractListFilter constructor.
*
* @param array $allowed
* @param bool $notFound
* @param bool
$notFound
*/
public
function
__construct
(
array
$allowed
,
$notFound
=
false
)
{
...
...
@@ -51,6 +52,7 @@ abstract class AbstractListFilter implements ClassFilterInterface
/**
* @param ReflectionClass $class
*
* @return bool
*/
public
function
accept
(
ReflectionClass
$class
)
...
...
src/Model/Filter/ClassFilter.php
View file @
32ba6c2c
...
...
@@ -33,7 +33,7 @@ class ClassFilter extends AbstractListFilter
public
const
CONF_TYPE
=
'classes'
;
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
extract
(
ReflectionClass
$class
):
string
{
...
...
@@ -41,7 +41,7 @@ class ClassFilter extends AbstractListFilter
}
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
matches
(
$tested
,
$reference
):
bool
{
...
...
@@ -49,7 +49,7 @@ class ClassFilter extends AbstractListFilter
}
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
normalize
(
$className
):
string
{
...
...
src/Model/Filter/DirectoryFilter.php
View file @
32ba6c2c
...
...
@@ -34,7 +34,7 @@ class DirectoryFilter extends AbstractListFilter
public
const
CONF_TYPE
=
'directories'
;
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
extract
(
ReflectionClass
$class
):
string
{
...
...
@@ -42,12 +42,14 @@ class DirectoryFilter extends AbstractListFilter
if
(
$filename
===
false
)
{
return
''
;
}
return
Path
::
getDirectory
(
$filename
);
}
/**
* @param mixed $tested
* @param mixed $reference
*
* @return bool
*/
protected
function
matches
(
$tested
,
$reference
):
bool
...
...
@@ -57,6 +59,7 @@ class DirectoryFilter extends AbstractListFilter
/**
* @param string $path
*
* @return string
*/
protected
function
normalize
(
$path
):
string
...
...
src/Model/Filter/NamespaceFilter.php
View file @
32ba6c2c
...
...
@@ -30,7 +30,7 @@ class NamespaceFilter extends AbstractListFilter
public
const
CONF_TYPE
=
'namespaces'
;
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
extract
(
ReflectionClass
$class
):
string
{
...
...
@@ -38,7 +38,7 @@ class NamespaceFilter extends AbstractListFilter
}
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
matches
(
$tested
,
$reference
):
bool
{
...
...
@@ -46,7 +46,7 @@ class NamespaceFilter extends AbstractListFilter
}
/**
* {@inherit
D
oc}
* {@inherit
d
oc}
*/
protected
function
normalize
(
$namespace
):
string
{
...
...
src/Model/Graph.php
View file @
32ba6c2c
...
...
@@ -40,8 +40,9 @@ class Graph implements GraphInterface
/**
* Graph constructor.
*
* @param ClassVisitorInterface $visitor
* @param FinderInterface $finder
* @param FinderInterface
$finder
*/
public
function
__construct
(
ClassVisitorInterface
$visitor
,
FinderInterface
$finder
)
{
...
...
@@ -49,9 +50,6 @@ class Graph implements GraphInterface
$this
->
finder
=
$finder
;
}
/**
*
*/
public
function
visitAll
():
void
{
foreach
(
$this
->
finder
->
getIterator
()
as
$class
)
{
...
...
@@ -61,6 +59,7 @@ class Graph implements GraphInterface
/**
* @param WriterInterface $writer
*
* @return $this
*/
public
function
writeTo
(
WriterInterface
$writer
):
self
...
...
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