mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 09:35:49 +02:00
Added an PHP CS fixer config file and applied it to files.
We now use the same the same style as the symfony project, and it allows us to simply fix the style by executing php_cs_fixer fix in the project root.
This commit is contained in:
parent
89258bc102
commit
e557bdedd5
210 changed files with 2099 additions and 2742 deletions
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/**
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony)
|
||||
* This file is part of Part-DB (https://github.com/Part-DB/Part-DB-symfony).
|
||||
*
|
||||
* Copyright (C) 2019 Jan Böhmer (https://github.com/jbtronics)
|
||||
*
|
||||
|
@ -17,7 +17,6 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*
|
||||
*/
|
||||
|
||||
namespace App\Controller;
|
||||
|
@ -35,8 +34,6 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
|
||||
/**
|
||||
* This controller has the purpose to provide the data for all treeviews.
|
||||
*
|
||||
* @package App\Controller
|
||||
*/
|
||||
class TreeController extends AbstractController
|
||||
{
|
||||
|
@ -57,13 +54,12 @@ class TreeController extends AbstractController
|
|||
*/
|
||||
public function categoryTree(TreeBuilder $builder, Category $category = null)
|
||||
{
|
||||
if ($category !== null) {
|
||||
if (null !== $category) {
|
||||
$tree[] = $builder->elementToTreeNode($category);
|
||||
} else {
|
||||
$tree = $builder->typeToTree(Category::class);
|
||||
}
|
||||
|
||||
|
||||
return $this->json($tree, 200, [], ['skip_null_values' => true]);
|
||||
}
|
||||
|
||||
|
@ -73,13 +69,12 @@ class TreeController extends AbstractController
|
|||
*/
|
||||
public function footprintTree(TreeBuilder $builder, Footprint $footprint = null)
|
||||
{
|
||||
if ($footprint !== null) {
|
||||
if (null !== $footprint) {
|
||||
$tree[] = $builder->elementToTreeNode($footprint);
|
||||
} else {
|
||||
$tree = $builder->typeToTree(Footprint::class);
|
||||
}
|
||||
|
||||
|
||||
return $this->json($tree, 200, [], ['skip_null_values' => true]);
|
||||
}
|
||||
|
||||
|
@ -89,13 +84,12 @@ class TreeController extends AbstractController
|
|||
*/
|
||||
public function locationTree(TreeBuilder $builder, Storelocation $location = null)
|
||||
{
|
||||
if ($location !== null) {
|
||||
if (null !== $location) {
|
||||
$tree[] = $builder->elementToTreeNode($location);
|
||||
} else {
|
||||
$tree = $builder->typeToTree(Storelocation::class);
|
||||
}
|
||||
|
||||
|
||||
return $this->json($tree, 200, [], ['skip_null_values' => true]);
|
||||
}
|
||||
|
||||
|
@ -105,13 +99,12 @@ class TreeController extends AbstractController
|
|||
*/
|
||||
public function manufacturerTree(TreeBuilder $builder, Manufacturer $manufacturer = null)
|
||||
{
|
||||
if ($manufacturer !== null) {
|
||||
if (null !== $manufacturer) {
|
||||
$tree[] = $builder->elementToTreeNode($manufacturer);
|
||||
} else {
|
||||
$tree = $builder->typeToTree(Manufacturer::class);
|
||||
}
|
||||
|
||||
|
||||
return $this->json($tree, 200, [], ['skip_null_values' => true]);
|
||||
}
|
||||
|
||||
|
@ -121,13 +114,12 @@ class TreeController extends AbstractController
|
|||
*/
|
||||
public function supplierTree(TreeBuilder $builder, Supplier $supplier = null)
|
||||
{
|
||||
if ($supplier !== null) {
|
||||
if (null !== $supplier) {
|
||||
$tree[] = $builder->elementToTreeNode($supplier);
|
||||
} else {
|
||||
$tree = $builder->typeToTree(Supplier::class);
|
||||
}
|
||||
|
||||
|
||||
return $this->json($tree, 200, [], ['skip_null_values' => true]);
|
||||
}
|
||||
|
||||
|
@ -137,15 +129,12 @@ class TreeController extends AbstractController
|
|||
*/
|
||||
public function deviceTree(TreeBuilder $builder, Device $device = null)
|
||||
{
|
||||
if ($device !== null) {
|
||||
if (null !== $device) {
|
||||
$tree[] = $builder->elementToTreeNode($device);
|
||||
} else {
|
||||
$tree = $builder->typeToTree(Device::class, null);
|
||||
}
|
||||
|
||||
|
||||
return $this->json($tree, 200, [], ['skip_null_values' => true]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue