Fixed code style.

This commit is contained in:
Jan Böhmer 2020-01-04 20:24:09 +01:00
parent 1aed1d1d26
commit 9a7223a301
142 changed files with 534 additions and 716 deletions

View file

@ -21,20 +21,19 @@
namespace App\Repository;
use App\Entity\Base\NamedDBElement;
use App\Helpers\Trees\TreeViewNode;
use Doctrine\ORM\EntityRepository;
class NamedDBElementRepository extends EntityRepository
{
/**
* Gets a tree of TreeViewNode elements. The root elements has $parent as parent.
* The treeview is generic, that means the href are null and ID values are set.
*
* @return TreeViewNode[]
*/
public function getGenericNodeTree() : array
public function getGenericNodeTree(): array
{
$result = [];
@ -48,4 +47,4 @@ class NamedDBElementRepository extends EntityRepository
return $result;
}
}
}

View file

@ -37,14 +37,15 @@ class StructuralDBElementRepository extends NamedDBElementRepository
return $this->findBy(['parent' => null], ['name' => 'ASC']);
}
/**
* Gets a tree of TreeViewNode elements. The root elements has $parent as parent.
* The treeview is generic, that means the href are null and ID values are set.
* @param StructuralDBElement|null $parent The parent the root elements should have.
*
* @param StructuralDBElement|null $parent The parent the root elements should have.
*
* @return TreeViewNode[]
*/
public function getGenericNodeTree(?StructuralDBElement $parent = null) : array
public function getGenericNodeTree(?StructuralDBElement $parent = null): array
{
$result = [];
@ -80,7 +81,7 @@ class StructuralDBElementRepository extends NamedDBElementRepository
//$result = iterator_to_array($recursiveIterator);
//We can not use iterator_to_array here or we get only the parent elements
foreach($recursiveIterator as $item) {
foreach ($recursiveIterator as $item) {
$result[] = $item;
}

View file

@ -42,9 +42,9 @@ class UserRepository extends NamedDBElementRepository implements PasswordUpgrade
*
* @return User|null
*/
public function getAnonymousUser() : ?User
public function getAnonymousUser(): ?User
{
if ($this->anonymous_user === null) {
if (null === $this->anonymous_user) {
$this->anonymous_user = $this->findOneBy([
'id' => User::ID_ANONYMOUS,
]);
@ -55,10 +55,12 @@ class UserRepository extends NamedDBElementRepository implements PasswordUpgrade
/**
* Find a user by its name or its email. Useful for login or password reset purposes.
*
* @param string $name_or_password The username or the email of the user that should be found
*
* @return User|null The user if it is existing, null if no one matched the criteria
*/
public function findByEmailOrName(string $name_or_password) : ?User
public function findByEmailOrName(string $name_or_password): ?User
{
if (empty($name_or_password)) {
return null;
@ -79,7 +81,7 @@ class UserRepository extends NamedDBElementRepository implements PasswordUpgrade
}
/**
* @inheritDoc
* {@inheritdoc}
*/
public function upgradePassword(UserInterface $user, string $newEncodedPassword): void
{