Completed
Push — master ( 635a5e...84f4be )
by Julien
33:33
created

UserController   A

Complexity

Total Complexity 21

Size/Duplication

Total Lines 202
Duplicated Lines 0 %

Coupling/Cohesion

Components 3
Dependencies 15

Test Coverage

Coverage 42.31%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 202
ccs 33
cts 78
cp 0.4231
rs 9.1666
c 1
b 0
f 0
wmc 21
lcom 3
cbo 15

4 Methods

Rating   Name   Duplication   Size   Complexity  
A index() 0 9 1
A edit() 0 14 2
A update() 0 14 3
B export() 0 25 2
1
<?php
2
3
namespace App\Http\Controllers;
4
5
6
use App\Association;
7
use App\Club;
8
use App\Country;
9
use App\Federation;
10
use App\Grade;
11
use App\Http\Requests\UserRequest;
12
use App\Notifications\AccountCreated;
13
use App\Role;
14
use App\User;
15
use Illuminate\Auth\Access\AuthorizationException;
16
use Illuminate\Database\QueryException;
17
use Illuminate\Http\Request;
18
use Illuminate\Support\Facades\Auth;
19
use Illuminate\Support\Facades\Lang;
20
use Illuminate\Support\Facades\Response;
21
use Illuminate\Support\Facades\View;
22
use Maatwebsite\Excel\Facades\Excel;
23
use URL;
24
25
class UserController extends Controller
26
{
27
    /**
28
     * Display a listing of the resource.
29
     *
30
     * @return View
31
     */
32
    public function index()
33
    {
34
        $users = User::with('country', 'role', 'association', 'federation')
35
            ->forUser(Auth::user())
36
            ->where('id', '>', 1)
37
            ->paginate(config('constants.PAGINATION'));
38
39
        return view('users.index', compact('users'));
40
    }
41
42
    /**
43
     * Show the form for creating a new resource.
44
     * @return View
45
     * @throws AuthorizationException
46
     */
47
    public function create()
48
    {
49
50
        $user = new User();
51
        if (Auth::user()->cannot('create', $user)) {
0 ignored issues
show
Bug introduced by
It seems like you code against a concrete implementation and not the interface Illuminate\Contracts\Auth\Authenticatable as the method cannot() does only exist in the following implementations of said interface: App\Profile, App\User, Illuminate\Foundation\Auth\User, Lab404\Tests\Stubs\Models\User.

Let’s take a look at an example:

interface User
{
    /** @return string */
    public function getPassword();
}

class MyUser implements User
{
    public function getPassword()
    {
        // return something
    }

    public function getDisplayName()
    {
        // return some name.
    }
}

class AuthSystem
{
    public function authenticate(User $user)
    {
        $this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
        // do something.
    }
}

In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break.

Available Fixes

  1. Change the type-hint for the parameter:

    class AuthSystem
    {
        public function authenticate(MyUser $user) { /* ... */ }
    }
    
  2. Add an additional type-check:

    class AuthSystem
    {
        public function authenticate(User $user)
        {
            if ($user instanceof MyUser) {
                $this->logger->info(/** ... */);
            }
    
            // or alternatively
            if ( ! $user instanceof MyUser) {
                throw new \LogicException(
                    '$user must be an instance of MyUser, '
                   .'other instances are not supported.'
                );
            }
    
        }
    }
    
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types inside the if block in such a case.
  1. Add the method to the interface:

    interface User
    {
        /** @return string */
        public function getPassword();
    
        /** @return string */
        public function getDisplayName();
    }
    
Loading history...
52
            throw new AuthorizationException();
53
        }
54
55
        $roles = Role::grantedRoles(Auth::user()->role_id)->pluck('name', 'id');
0 ignored issues
show
Bug introduced by
Accessing role_id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
56
        $grades = Grade::getAllPlucked();
57
        $countries = Country::getAllPlucked();
58
        $federations = Federation::fillSelect();
59
        $associations = Association::forUser(auth()->user());
0 ignored issues
show
Bug introduced by
The method user does only exist in Illuminate\Contracts\Auth\Guard, but not in Illuminate\Contracts\Auth\Factory.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
60
        $clubs = Club::fillSelect(Auth::user()->federation_id, Auth::user()->association_id);
0 ignored issues
show
Bug introduced by
Accessing federation_id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
Bug introduced by
Accessing association_id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
61
        return view('users.form', compact('user', 'grades', 'countries', 'roles', 'federations', 'associations', 'clubs')); //
62
    }
63
64
    /**
65
     * Store a newly created resource in storage.
66
     *
67
     * @param UserRequest $userForm
68
     * @return \Illuminate\Http\RedirectResponse|Response
69
     */
70 1
    public function store(UserRequest $userForm)
71
    {
72
        try {
73 1
            $userForm->store();
74 1
            $user = User::where('email', $userForm->email)->first();
0 ignored issues
show
Documentation introduced by
The property email does not exist on object<App\Http\Requests\UserRequest>. Since you implemented __get, maybe consider adding a @property annotation.

Since your code implements the magic getter _get, this function will be called for any read access on an undefined variable. You can add the @property annotation to your class or interface to document the existence of this variable.

<?php

/**
 * @property int $x
 * @property int $y
 * @property string $text
 */
class MyLabel
{
    private $properties;

    private $allowedProperties = array('x', 'y', 'text');

    public function __get($name)
    {
        if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
            return $properties[$name];
        } else {
            return null;
        }
    }

    public function __set($name, $value)
    {
        if (in_array($name, $this->allowedProperties)) {
            $properties[$name] = $value;
        } else {
            throw new \LogicException("Property $name is not defined.");
        }
    }

}

If the property has read access only, you can use the @property-read annotation instead.

Of course, you may also just have mistyped another name, in which case you should fix the error.

See also the PhpDoc documentation for @property.

Loading history...
75 1
            $user->notify(new AccountCreated($user));
76 1
            flash()->success(trans('msg.user_create_successful'));
0 ignored issues
show
Bug introduced by
The method success cannot be called on flash() (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
77
        } catch (QueryException $e) {
78
            flash()->error(trans('msg.user_already_exists'));
0 ignored issues
show
Bug introduced by
The method error cannot be called on flash() (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
79
            return redirect()->back()->withInput();
80
        }
81 1
        return redirect(route('users.index'));
82
    }
83
84
    /**
85
     * Display the specified resource.
86
     *
87
     * @param User $user
88
     * @return View
89
     */
90 1
    public function show(User $user)
91
    {
92
93
94 1
        return view('users.show', compact('user'));
95
    }
96
97
    /**
98
     * Show the form for editing the specified resource.
99
     *
100
     * @param User $user
101
     * @return View
102
     * @throws AuthorizationException
103
     */
104 2
    public function edit(User $user)
105
    {
106 2
        if (Auth::user()->cannot('edit', $user)) {
0 ignored issues
show
Bug introduced by
It seems like you code against a concrete implementation and not the interface Illuminate\Contracts\Auth\Authenticatable as the method cannot() does only exist in the following implementations of said interface: App\Profile, App\User, Illuminate\Foundation\Auth\User, Lab404\Tests\Stubs\Models\User.

Let’s take a look at an example:

interface User
{
    /** @return string */
    public function getPassword();
}

class MyUser implements User
{
    public function getPassword()
    {
        // return something
    }

    public function getDisplayName()
    {
        // return some name.
    }
}

class AuthSystem
{
    public function authenticate(User $user)
    {
        $this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
        // do something.
    }
}

In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break.

Available Fixes

  1. Change the type-hint for the parameter:

    class AuthSystem
    {
        public function authenticate(MyUser $user) { /* ... */ }
    }
    
  2. Add an additional type-check:

    class AuthSystem
    {
        public function authenticate(User $user)
        {
            if ($user instanceof MyUser) {
                $this->logger->info(/** ... */);
            }
    
            // or alternatively
            if ( ! $user instanceof MyUser) {
                throw new \LogicException(
                    '$user must be an instance of MyUser, '
                   .'other instances are not supported.'
                );
            }
    
        }
    }
    
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types inside the if block in such a case.
  1. Add the method to the interface:

    interface User
    {
        /** @return string */
        public function getPassword();
    
        /** @return string */
        public function getDisplayName();
    }
    
Loading history...
107 2
            throw new AuthorizationException();
108
        }
109 1
        $roles = Role::grantedRoles(Auth::user()->role_id)->pluck('name', 'id');
0 ignored issues
show
Bug introduced by
Accessing role_id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
110 1
        $grades = Grade::orderBy('order')->pluck('name', 'id');
111 1
        $countries = Country::pluck('name', 'id');
112 1
        $federations = Federation::fillSelect();
113 1
        $associations = Association::forUser(auth()->user());
0 ignored issues
show
Bug introduced by
The method user does only exist in Illuminate\Contracts\Auth\Guard, but not in Illuminate\Contracts\Auth\Factory.

It seems like the method you are trying to call exists only in some of the possible types.

Let’s take a look at an example:

class A
{
    public function foo() { }
}

class B extends A
{
    public function bar() { }
}

/**
 * @param A|B $x
 */
function someFunction($x)
{
    $x->foo(); // This call is fine as the method exists in A and B.
    $x->bar(); // This method only exists in B and might cause an error.
}

Available Fixes

  1. Add an additional type-check:

    /**
     * @param A|B $x
     */
    function someFunction($x)
    {
        $x->foo();
    
        if ($x instanceof B) {
            $x->bar();
        }
    }
    
  2. Only allow a single type to be passed if the variable comes from a parameter:

    function someFunction(B $x) { /** ... */ }
    
Loading history...
114 1
        $clubs = Club::fillSelect(Auth::user()->federation_id, Auth::user()->association_id);
0 ignored issues
show
Bug introduced by
Accessing federation_id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
Bug introduced by
Accessing association_id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
115
116 1
        return view('users.form', compact('user', 'grades', 'countries', 'roles', 'federations', 'associations', 'clubs')); //
117
    }
118
119
    /**
120
     * Update the specified resource in storage.
121
     *
122
     * @param  UserRequest $userForm
123
     * @param User $user
124
     * @return Response
125
     */
126 4
    public function update(UserRequest $userForm, User $user)
127
    {
128 4
        if ($userForm->update($user)) {
129 4
            flash()->success(trans('msg.user_update_successful'));
0 ignored issues
show
Bug introduced by
The method success cannot be called on flash() (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
130
        } else
131
            flash()->error(Lang::get('msg.user_update_error'));
0 ignored issues
show
Bug introduced by
The method error cannot be called on flash() (of type null).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
132
133 4
        if ($user->id == Auth::user()->id) {
0 ignored issues
show
Bug introduced by
Accessing id on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
134 3
            return redirect(URL::action('UserController@edit', Auth::user()->slug));
0 ignored issues
show
Bug introduced by
Accessing slug on the interface Illuminate\Contracts\Auth\Authenticatable suggest that you code against a concrete implementation. How about adding an instanceof check?

If you access a property on an interface, you most likely code against a concrete implementation of the interface.

Available Fixes

  1. Adding an additional type check:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeInterface $object) {
        if ($object instanceof SomeClass) {
            $a = $object->a;
        }
    }
    
  2. Changing the type hint:

    interface SomeInterface { }
    class SomeClass implements SomeInterface {
        public $a;
    }
    
    function someFunction(SomeClass $object) {
        $a = $object->a;
    }
    
Loading history...
135
        }
136
137 1
        return redirect(route('users.index'));
138
139
    }
140
141
142
    public function export()
143
    {
144
145
        Excel::create(trans_choice('core.user', 2), function ($excel) {
0 ignored issues
show
Bug introduced by
The method create() does not exist on Maatwebsite\Excel\Facades\Excel. Did you maybe mean createFreshMockInstance()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
146
            $appName = (app()->environment() == 'local' ? getenv('APP_NAME') : config('app.name'));
147
148
            // Set the title
149
            $excel->setTitle(trans_choice('core.user', 2));
150
151
            // Chain the setters
152
            $excel->setCreator($appName)
153
                ->setCompany($appName);
154
155
            // Call them separately
156
            $excel->setDescription('A list of users');
157
            $excel->sheet(trans_choice('core.user', 2), function ($sheet) {
158
                //TODO Here we should join grade, role, country to print name not FK
159
                $users = User::all();
160
//                $users = User::with(['grade', 'role'])->get();
161
                $sheet->fromArray($users);
162
            });
163
164
165
        })->export('xls');
166
    }
167
168 1
    public function getMyTournaments(Request $request)
0 ignored issues
show
Unused Code introduced by
The parameter $request is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
169
    {
170 1
        $tournaments = Auth::user()->myTournaments()->with('owner')
0 ignored issues
show
Bug introduced by
It seems like you code against a concrete implementation and not the interface Illuminate\Contracts\Auth\Authenticatable as the method myTournaments() does only exist in the following implementations of said interface: App\Profile, App\User.

Let’s take a look at an example:

interface User
{
    /** @return string */
    public function getPassword();
}

class MyUser implements User
{
    public function getPassword()
    {
        // return something
    }

    public function getDisplayName()
    {
        // return some name.
    }
}

class AuthSystem
{
    public function authenticate(User $user)
    {
        $this->logger->info(sprintf('Authenticating %s.', $user->getDisplayName()));
        // do something.
    }
}

In the above example, the authenticate() method works fine as long as you just pass instances of MyUser. However, if you now also want to pass a different implementation of User which does not have a getDisplayName() method, the code will break.

Available Fixes

  1. Change the type-hint for the parameter:

    class AuthSystem
    {
        public function authenticate(MyUser $user) { /* ... */ }
    }
    
  2. Add an additional type-check:

    class AuthSystem
    {
        public function authenticate(User $user)
        {
            if ($user instanceof MyUser) {
                $this->logger->info(/** ... */);
            }
    
            // or alternatively
            if ( ! $user instanceof MyUser) {
                throw new \LogicException(
                    '$user must be an instance of MyUser, '
                   .'other instances are not supported.'
                );
            }
    
        }
    }
    
Note: PHP Analyzer uses reverse abstract interpretation to narrow down the types inside the if block in such a case.
  1. Add the method to the interface:

    interface User
    {
        /** @return string */
        public function getPassword();
    
        /** @return string */
        public function getDisplayName();
    }
    
Loading history...
171 1
            ->orderBy('created_at', 'desc')
172 1
            ->paginate(config('constants.PAGINATION'));;
173
174 1
        $title = trans('core.tournaments_registered');
175
176 1
        return view('users.tournaments', compact('tournaments', 'title'));
177
    }
178
179
    /**
180
     * Remove the specified resource from storage.
181
     *
182
     * @param User $user
183
     * @return \Illuminate\Http\JsonResponse
184
     * @throws \Exception
185
     */
186 1
    public function destroy(User $user)
187
    {
188
189 1
        if ($user->delete()) {
190 1
            return Response::json(['msg' => trans('msg.user_delete_successful'), 'status' => 'success']);
0 ignored issues
show
Documentation introduced by
array('msg' => trans('ms... 'status' => 'success') is of type array<string,object<Illu...ll","status":"string"}>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
191
        }
192
        return Response::json(['msg' => trans('msg.user_delete_error'), 'status' => 'error']);
0 ignored issues
show
Documentation introduced by
array('msg' => trans('ms...), 'status' => 'error') is of type array<string,object<Illu...ll","status":"string"}>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
193
194
    }
195
196
    /**
197
     * @param $userSlug
198
     * @return \Illuminate\Http\JsonResponse
199
     */
200
    public function restore($userSlug)
201
202
    {
203
        $user = User::withTrashed()->whereSlug($userSlug)->first();
204
        if ($user->restore()) {
205
            return Response::json(['msg' => trans('msg.user_restore_successful'), 'status' => 'success']);
0 ignored issues
show
Documentation introduced by
array('msg' => trans('ms... 'status' => 'success') is of type array<string,object<Illu...ll","status":"string"}>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
206
        }
207
        return Response::json(['msg' => trans('msg.user_restore_successful'), 'status' => 'error']);
0 ignored issues
show
Documentation introduced by
array('msg' => trans('ms...), 'status' => 'error') is of type array<string,object<Illu...ll","status":"string"}>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
208
209
    }
210
211
    public function myFederations(User $user)
212
    {
213
        return Federation::fillSelectForVueJs($user);
214
    }
215
216
    public function myAssociations(User $user, $federationId)
217
    {
218
        return Association::fillSelectForVuejs($user, $federationId);
219
    }
220
221
    public function myClubs(User $user, $federationId, $associationId)
222
    {
223
        return Club::fillSelectForVueJs($user, $federationId, $associationId);
224
    }
225
226
}
227