Commit 4476805d authored by Guillaume Perréal's avatar Guillaume Perréal
Browse files

PHP CS.

parent 615bb318
......@@ -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();
}
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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;
}
}
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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);
}
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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');
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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);
}
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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(
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
<?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-2020 IRSTEA
* Copyright (C) 2018-2021 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment