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
ng-model-generator-bundle
Commits
4476805d
Commit
4476805d
authored
Feb 17, 2021
by
Guillaume Perréal
Browse files
PHP CS.
parent
615bb318
Changes
117
Hide whitespace changes
Inline
Side-by-side
.php_cs.dist
View file @
4476805d
...
...
@@ -10,9 +10,10 @@ $finder = PhpCsFixer\Finder::create()
$loader
=
require
__DIR__
.
'/vendor/autoload.php'
;
try
{
return
Irstea\CS\Config
::
create
()
->
setIndent
(
' '
)
->
setLineEnding
(
"
\n
"
)
->
setFinder
(
$finder
);
->
setIndent
(
' '
)
->
SetRiskyAllowed
(
true
)
->
setLineEnding
(
"
\n
"
)
->
setFinder
(
$finder
);
}
finally
{
$loader
->
unregister
();
}
...
...
src/php/Command/NgModelGenerateCommand.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
@@ -38,7 +39,7 @@ use Symfony\Component\Console\Output\OutputInterface;
/**
* Class NgModelGenerateCommand.
*/
/* final */
class
NgModelGenerateCommand
extends
Command
/* final */
class
NgModelGenerateCommand
extends
Command
{
/**
* @var ModelGenerator
...
...
@@ -66,7 +67,7 @@ use Symfony\Component\Console\Output\OutputInterface;
/**
* {@inheritdoc}
*/
protected
function
configure
()
protected
function
configure
()
:
void
{
$this
->
setName
(
'ng-model:generate'
)
...
...
@@ -80,7 +81,7 @@ use Symfony\Component\Console\Output\OutputInterface;
/**
* {@inheritdoc}
*/
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
:
void
{
$writer
=
new
PhonyFileWriter
(
$this
->
openWriter
(
$input
,
$output
),
...
...
@@ -94,7 +95,7 @@ use Symfony\Component\Console\Output\OutputInterface;
$writer
=
new
FilteringFileWriter
(
$writer
,
function
(
string
$path
)
use
(
$globs
):
bool
{
foreach
(
$globs
as
$glob
)
{
if
(
fnmatch
(
$glob
,
$path
,
FNM_PATHNAME
))
{
if
(
fnmatch
(
$glob
,
$path
,
\
FNM_PATHNAME
))
{
return
true
;
}
}
...
...
src/php/Command/NgModelMetadataCommand.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
@@ -61,7 +62,7 @@ use Symfony\Component\Console\Output\OutputInterface;
/**
* {@inheritdoc}
*/
protected
function
configure
()
protected
function
configure
()
:
void
{
$this
->
setName
(
'ng-model:metadata'
)
...
...
@@ -72,7 +73,7 @@ use Symfony\Component\Console\Output\OutputInterface;
/**
* {@inheritdoc}
*/
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
protected
function
execute
(
InputInterface
$input
,
OutputInterface
$output
)
:
void
{
$classes
=
$input
->
getArgument
(
'classes'
);
Assertion
::
isArray
(
$classes
);
...
...
@@ -87,7 +88,7 @@ use Symfony\Component\Console\Output\OutputInterface;
$metadata
[
$class
->
getBaseName
()]
=
$this
->
metadataFactory
->
getResourceMetadata
(
$class
);
}
$json
=
\
json_encode
(
$metadata
,
\
JSON_PRETTY_PRINT
|
\
JSON_UNESCAPED_SLASHES
|
\
JSON_UNESCAPED_UNICODE
);
$json
=
json_encode
(
$metadata
,
\
JSON_PRETTY_PRINT
|
\
JSON_UNESCAPED_SLASHES
|
\
JSON_UNESCAPED_UNICODE
);
Assertion
::
string
(
$json
);
$output
->
writeln
(
$json
);
}
...
...
src/php/DependencyInjection/NgModelGeneratorExtension.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
@@ -34,7 +35,7 @@ class NgModelGeneratorExtension extends Extension
/**
* {@inheritdoc}
*/
public
function
load
(
array
$configs
,
ContainerBuilder
$container
)
public
function
load
(
array
$configs
,
ContainerBuilder
$container
)
:
void
{
$loader
=
new
XmlFileLoader
(
$container
,
new
FileLocator
(
__DIR__
.
'/../Resources/config'
));
$loader
->
load
(
'config.xml'
);
...
...
src/php/Exceptions/BadMethodCallException.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Exceptions/DomainException.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Exceptions/Exception.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Exceptions/InvalidArgumentException.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Exceptions/TypeAlreadyExistsException.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Exceptions/TypeError.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Exceptions/TypeNotFoundException.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Iterators/CallbackFilterRecursorIterator.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
@@ -55,7 +56,7 @@ class CallbackFilterRecursorIterator extends RecursorIterator
/**
* @param \Iterator $iter
*/
protected
function
doGetChildren
(
\
Traversable
$iter
)
:
\
RecursiveIterator
protected
function
doGetChildren
(
Traversable
$iter
):
\
RecursiveIterator
{
return
new
self
(
$iter
,
$this
->
filter
);
}
...
...
src/php/Iterators/IteratorBuilder.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Iterators/RecursiveUniqueIterator.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Iterators/RecursorIterator.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Iterators/UniqueFilter.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
@@ -49,7 +50,7 @@ final class UniqueFilter
private
function
getKey
(
$value
):
string
{
if
(
\
is_object
(
$value
))
{
return
\
get_class
(
$value
)
.
'#'
.
\
spl_object_hash
(
$value
);
return
\
get_class
(
$value
)
.
'#'
.
spl_object_hash
(
$value
);
}
if
(
\
is_array
(
$value
))
{
return
'array#'
.
implode
(
', '
,
array_map
(
...
...
src/php/Iterators/UniqueIterator.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Iterators/UniqueIteratorTrait.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Metadata/CachingMetadataFactory.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
src/php/Metadata/ClassHierarchy.php
View file @
4476805d
<?php
declare
(
strict_types
=
1
);
<?php
declare
(
strict_types
=
1
);
/*
* This file is part of "irstea/ng-model-generator-bundle".
*
* "irstea/ng-model-generator-bundle" generates Typescript interfaces for Angular using api-platform metadata.
* Copyright (C) 2018-202
0
IRSTEA
* Copyright (C) 2018-202
1
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
...
...
Prev
1
2
3
4
5
6
Next
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