Completed
Push — develop ( 0bfa91...da5abe )
by
unknown
17:13 queued 09:01
created

ApplyController::oneClickApplyAction()   B

Complexity

Conditions 6
Paths 5

Size

Total Lines 77
Code Lines 49

Duplication

Lines 0
Ratio 0 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
c 5
b 0
f 0
dl 0
loc 77
rs 8.4456
cc 6
eloc 49
nc 5
nop 0

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
/**
3
 * YAWIK
4
 *
5
 * @filesource
6
 * @copyright (c) 2013 - 2016 Cross Solution (http://cross-solution.de)
7
 * @license   MIT
8
 */
9
10
/** Applications controllers */
11
namespace Applications\Controller;
12
13
use Applications\Entity\Contact;
14
use Applications\Listener\Events\ApplicationEvent;
15
use Zend\Mvc\Controller\AbstractActionController;
16
use Zend\Mvc\MvcEvent;
17
use Applications\Entity\Application;
18
use Zend\View\Model\ViewModel;
19
use Zend\View\Model\JsonModel;
20
use Core\Form\Container;
21
use Core\Form\SummaryForm;
22
use Core\Entity\PermissionsInterface;
23
use Applications\Entity\Status;
24
25
/**
26
 * there are basically two ways to use this controller,
27
 * (1) either you have a form, and want to accumulate inputs, or you want to create a form on an existing or new application
28
 * (2) or want to do some action on a concrete form.
29
 *
30
 * for both you need the applyId, which is NOT the application-id, the applyId is an alias for the Job, it can be some human-readable text or an external ID.
31
 * the application to an applyId is found by the combination of the user and the job, that is represented by the applyId.
32
 * this approach ensures, that applications stick to the related job.
33
 *
34
 * nonetheless, there is an exception, for the posts for updating the application, the application-id is needed.
35
 *
36
 * if you use the do as query-parameter, you have to customize the do-Action for the special purpose that is assigned to the do parameter in the query
37
 *
38
 * @method \Acl\Controller\Plugin\Acl acl()
39
 * @method \Core\Controller\Plugin\Notification notification()
40
 * @method \Core\Controller\Plugin\Mailer mailer()
41
 * @method \Auth\Controller\Plugin\Auth auth()
42
 * @author Mathias Gelhausen <[email protected]>
43
 */
44
class ApplyController extends AbstractActionController
45
{
46
    
47
    protected $container;
48
    
49 View Code Duplication
    public function attachDefaultListeners()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
50
    {
51
        parent::attachDefaultListeners();
52
        $events = $this->getEventManager();
53
        $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'preDispatch'), 10);
54
        $serviceLocator  = $this->getServiceLocator();
55
        $defaultServices = $serviceLocator->get('DefaultListeners');
56
        $events->attach($defaultServices);
0 ignored issues
show
Documentation introduced by
$defaultServices is of type object|array, 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...
57
        return $this;
58
    }
59
    
60
    public function preDispatch(MvcEvent $e)
61
    {
62
        /* @var $application \Applications\Entity\Application */
63
        if ($this->params()->fromQuery('do')) {
64
            $e->getRouteMatch()->setParam('action', 'do');
65
            return;
66
        }
67
68
        /* @var $request    \Zend\Http\Request */
69
        /* @var $repository \Applications\Repository\Application */
70
        /* @var $container  \Applications\Form\Apply */
71
        $request      = $this->getRequest();
72
        $services     = $this->getServiceLocator();
73
        $repositories = $services->get('repositories');
74
        $repository   = $repositories->get('Applications/Application');
75
        $container    = $services->get('forms')->get('Applications/Apply');
76
        
77
        if ($request->isPost()) {
78
            $appId = $this->params()->fromPost('applicationId');
79
            if (!$appId) {
80
                throw new \RuntimeException('Missing application id.');
81
            }
82
            $routeMatch = $e->getRouteMatch();
83
84
            if ('recruiter-preview' == $appId) {
85
                $routeMatch->setParam('action', 'process-preview');
86
                return;
87
            }
88
89
            $application = $repository->find($appId);
90
            if (!$application) {
91
                throw new \RuntimeException('Invalid application id.');
92
            }
93
94
            $action     = 'process';
95
96
            $routeMatch->setParam('action', $action);
97
        } else {
98
            $user  = $this->auth()->getUser();
99
            $appId = $this->params('applyId');
100
            if (!$appId) {
101
                throw new \RuntimeException('Missing apply id');
102
            }
103
104
            /* @var \Jobs\Entity\Job $job */
105
            $job = $repositories->get('Jobs/Job')->findOneByApplyId($appId);
106
107
            if (!$job) {
108
                $e->getRouteMatch()->setParam('action', 'job-not-found');
109
                return;
110
            }
111
112
            switch ($job->getStatus()) {
113
                case \Jobs\Entity\Status::ACTIVE:
114
                    break;
115
                default:
116
                    $e->getRouteMatch()->setParam('action', 'job-not-found');
117
                    return;
118
                    break;
0 ignored issues
show
Unused Code introduced by
break is not strictly necessary here and could be removed.

The break statement is not necessary if it is preceded for example by a return statement:

switch ($x) {
    case 1:
        return 'foo';
        break; // This break is not necessary and can be left off.
}

If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.

Loading history...
119
            }
120
121
            if ($user === $job->getUser()) {
122
                $application = new \Applications\Entity\Application();
123
                $application->setContact(new Contact());
124
                $application->setJob($job);
125
                $application->setId('recruiter-preview');
126
            } else {
127
                $subscriberUri = $this->params()->fromQuery('subscriber');
128
                $application   = $repository->findDraft($user, $appId);
129
130
                if ($application) {
131
                    /* @var $form \Auth\Form\UserInfo */
132
                    $form = $container->getForm('contact.contact');
133
                    $form->setDisplayMode('summary');
134
135
                    if ($subscriberUri) {
136
                        $subscriber = $application->getSubscriber();
137
                        if (!$subscriber || $subscriber->uri != $subscriberUri) {
138
                            $subscriber = $repositories->get('Applications/Subscriber')->findbyUri($subscriberUri, /*create*/ true);
139
                            $application->setSubscriber($subscriber);
140
                            $subscriber->getname();
141
                        }
142
                    }
143
                } else {
144
                    if (!$job) {
145
                        $e->getRouteMatch()->setParam('action', 'job-not-found');
146
                        return;
147
                    }
148
                    if ($job->getUriApply()) {
149
                        return $this->redirect($job->getUriApply());
0 ignored issues
show
Unused Code introduced by
The call to ApplyController::redirect() has too many arguments starting with $job->getUriApply().

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
150
                    }
151
152
                    /* @var $application \Applications\Entity\Application */
153
                    $application = $repository->create();
154
                    $application->setIsDraft(true)
155
                                ->setContact($user->getInfo())
156
                                ->setUser($user)
157
                                ->setJob($job);
158
159
                    if ($subscriberUri) {
160
                        $subscriber = $repositories->get('Applications/Subscriber')->findbyUri($subscriberUri, /*create*/ true);
161
                        $application->setSubscriber($subscriber);
162
                    }
163
164
                    $repositories->store($application);
165
                    /*
166
                     * If we had copy an user image, we need to refresh its data
167
                     * to populate the length property.
168
                     */
169
                    if ($image = $application->getContact()->getImage()) {
170
                        $repositories->refresh($image);
171
                    }
172
                }
173
            }
174
        }
175
        
176
        $container->setEntity($application);
177
        $this->configureContainer($container);
178
        $this->container = $container;
179
    }
180
    
181
    public function jobNotFoundAction()
182
    {
183
        $this->response->setStatusCode(410);
0 ignored issues
show
Bug introduced by
It seems like you code against a concrete implementation and not the interface Zend\Stdlib\ResponseInterface as the method setStatusCode() does only exist in the following implementations of said interface: Zend\Http\PhpEnvironment\Response, Zend\Http\Response, Zend\Http\Response\Stream.

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...
184
        $model = new ViewModel(
185
            [ 'content' => /*@translate*/ 'Invalid apply id']
186
        );
187
        $model->setTemplate('applications/error/not-found');
188
        return $model;
189
    }
190
    
191
    public function indexAction()
192
    {
193
        /* @var \Applications\Form\Apply $form */
194
        $form        = $this->container;
195
        $serviceLocator = $this->getServiceLocator();
196
        $translator = $serviceLocator->get('Translator');
197
        /* @var \Auth\Form\SocialProfiles $profiles */
198
199
        $profiles=$form->get('profiles');
200
        /*
201
         * can we add the description to Applications\Form\Apply ?
202
         */
203
        $profiles->getBaseFieldset()->setOption('description', $translator->translate("you can add your social profile to your application. You can preview and remove the attached profile before submitting the application."));
204
205
        $application = $form->getEntity();
206
        
207
        $form->setParam('applicationId', $application->id);
0 ignored issues
show
Bug introduced by
Accessing id on the interface Core\Entity\EntityInterface 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...
208
209
        $model = new ViewModel(
210
            array(
211
            'form' => $form,
212
            'isApplicationValid' => $this->checkApplication($application),
213
            'application' => $application,
214
            )
215
        );
216
        $model->setTemplate('applications/apply/index');
217
        return $model;
218
    }
219
    
220
    public function oneClickApplyAction()
221
    {
222
        /* @var \Applications\Entity\Application $application */
223
        $application = $this->container->getEntity();
224
        $job = $application->getJob();
225
        $atsMode = $job->getAtsMode();
226
        
227
        // check for one click apply
228
        if (!($atsMode->isIntern() && $atsMode->getOneClickApply()))
229
        {
230
            // redirect to regular application
231
            return $this->redirect()
232
                ->toRoute('lang/apply', ['applyId' => $job->getApplyId()]);
233
        }
234
        
235
        $network = $this->params('network');
236
237
        $hybridAuth = $this->getServiceLocator()
238
            ->get('HybridAuthAdapter')
239
            ->getHybridAuth();
240
        /* @var $authProfile \Hybrid_User_Profile */
241
        $authProfile = $hybridAuth->authenticate($network)
242
           ->getUserProfile();
243
244
        /* @var \Auth\Entity\SocialProfiles\AbstractProfile $profile */
245
        $profile = $this->plugin('Auth/SocialProfiles')->fetch($network);
246
247
        $contact = $application->getContact();
248
        $contact->setEmail($authProfile->emailVerified ?: $authProfile->email);
249
        $contact->setFirstName($authProfile->firstName);
250
        $contact->setLastName($authProfile->lastName);
251
        $contact->setBirthDay($authProfile->birthDay);
252
        $contact->setBirthMonth($authProfile->birthMonth);
253
        $contact->setBirthYear($authProfile->birthYear);
254
        $contact->setPostalCode($authProfile->zip);
255
        $contact->setCity($authProfile->city);
256
        $contact->setStreet($authProfile->address);
257
        $contact->setPhone($authProfile->phone);
258
        $contact->setGender($authProfile->gender);
259
260
        $profiles = $application->getProfiles();
261
        $profiles->add($profile);
262
263
        $cv = $application->getCv();
264
        $cv->setEmployments($profile->getEmployments());
265
        $cv->setEducations($profile->getEducations());
266
267
        if ($authProfile->photoURL)
268
        {
269
            $response = (new \Zend\Http\Client($authProfile->photoURL, ['sslverifypeer' => false]))->send();
270
            $file = new \Doctrine\MongoDB\GridFSFile();
271
            $file->setBytes($response->getBody());
272
            
273
            $image = new \Applications\Entity\Attachment();
274
            $image->setName($contact->getLastName().$contact->getFirstName());
275
            $image->setType($response->getHeaders()->get('Content-Type')->getFieldValue());
0 ignored issues
show
Bug introduced by
The method getFieldValue does only exist in Zend\Http\Header\HeaderInterface, but not in ArrayIterator.

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...
276
            $image->setFile($file);
277
            $image->setPermissions($application->getPermissions());
278
            
279
            $contact->setImage($image);
280
        }
281
        
282
        $urlOptions = [];
283
        
284
        if ($this->params('immediately'))
285
        {
286
            $application->getAttributes()->setAcceptedPrivacyPolicy(true);
287
            $urlOptions = [
288
                'query' => [
289
                    'do' => 'send'
290
                ]
291
            ];
292
        }
293
        
294
        return $this->redirect()
295
           ->toRoute('lang/apply', ['applyId' => $job->getApplyId()], $urlOptions);
296
    }
297
298
    public function processPreviewAction()
299
    {
300
        return new JsonModel(array('valid' => false, 'errors' => array()));
301
    }
302
    
303
    public function processAction()
0 ignored issues
show
Coding Style introduced by
processAction uses the super-global variable $_POST which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
Coding Style introduced by
processAction uses the super-global variable $_FILES which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
304
    {
305
        $formName  = $this->params()->fromQuery('form');
306
        $form      = $this->container->getForm($formName);
307
        $postData  = $form->getOption('use_post_array') ? $_POST : array();
308
        $filesData = $form->getOption('use_files_array') ? $_FILES : array();
309
        $data      = array_merge($postData, $filesData);
310
311
        $form->setData($data);
312
        
313 View Code Duplication
        if (!$form->isValid()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
314
            return new JsonModel(
315
                array(
316
                'valid' => false,
317
                'errors' => $form->getMessages(),
318
                )
319
            );
320
        }
321
        $application = $this->container->getEntity();
322
        $this->getServiceLocator()->get('repositories')->store($application);
323
        
324
        if ('file-uri' === $this->params()->fromPost('return')) {
325
            $basepath = $this->getServiceLocator()->get('ViewHelperManager')->get('basepath');
326
            $content = $basepath($form->getHydrator()->getLastUploadedFile()->getUri());
327 View Code Duplication
        } else {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
328
            if ($form instanceof SummaryForm) {
329
                $form->setRenderMode(SummaryForm::RENDER_SUMMARY);
330
                $viewHelper = 'summaryform';
331
            } else {
332
                $viewHelper = 'form';
333
            }
334
            $content = $this->getServiceLocator()->get('ViewHelperManager')->get($viewHelper)->__invoke($form);
335
        }
336
        
337
        return new JsonModel(
338
            array(
339
            'valid' => $form->isValid(),
340
            'content' => $content,
341
            'isApplicationValid' => $this->checkApplication($application)
342
            )
343
        );
344
    }
345
    
346
    public function doAction()
347
    {
348
        $services     = $this->getServiceLocator();
349
        $config       = $services->get('Config');
350
        $repositories = $services->get('repositories');
351
        $repository   = $repositories->get('Applications/Application');
352
        /* @var Application $application*/
353
        $application  = $repository->findDraft(
354
            $this->auth()->getUser(),
355
            $this->params('applyId')
356
        );
357
        
358
        if (!$application) {
359
            throw new \Exception('No application draft found.');
360
        }
361
        
362
        if ('abort' == $this->params()->fromQuery('do')) {
363
            $repositories->remove($application);
364
            return $this->redirect()->toRoute('lang/apply', array('applyId' => $this->params('applyId')));
365
        }
366
        
367
        if (!$this->checkApplication($application)) {
368
            $this->notification()->error(/*@translate*/ 'There are missing required informations. Your application cannot be send.');
369
            return $this->redirect()->toRoute('lang/apply', array('applyId' => $this->params('applyId')));
370
        }
371
372
        if ('sendmail' == $this->params()->fromQuery('do')) {
373
            $jobEntity         = $application->getJob();
374
375
            $mailData = array(
376
                'application' => $application,
377
                'to'          => $jobEntity->getContactEmail()
378
            );
379
            if (array_key_exists('mails', $config) && array_key_exists('from', $config['mails']) && array_key_exists('email', $config['mails']['from'])) {
380
                $mailData['from'] = $config['mails']['from']['email'];
381
            }
382
            $this->mailer('Applications/CarbonCopy', $mailData, true);
0 ignored issues
show
Unused Code introduced by
The call to ApplyController::mailer() has too many arguments starting with 'Applications/CarbonCopy'.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
383
            $repositories->remove($application);
384
            //$this->notification()->success(/*@translate*/ 'Application has been send.');
0 ignored issues
show
Unused Code Comprehensibility introduced by
53% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
385
            $model = new ViewModel(
386
                array(
387
                'success' => true,
388
                'job' => $jobEntity,
389
                )
390
            );
391
            $model->setTemplate('applications/apply/success');
392
            return $model;
393
        }
394
395
        $application->setIsDraft(false)
396
            ->setStatus(new Status())
397
            ->getPermissions()
398
            ->revoke($this->auth()->getUser(), PermissionsInterface::PERMISSION_CHANGE)
399
            ->inherit($application->getJob()->getPermissions());
400
401
        $events   = $services->get('Applications/Events');
402
        $events->trigger(ApplicationEvent::EVENT_APPLICATION_POST_CREATE, $this, [ 'application' => $application ]);
403
404
        $model = new ViewModel(
405
            array(
406
            'success' => true,
407
            'application' => $application,
408
            )
409
        );
410
        $model->setTemplate('applications/apply/index');
411
412
        return $model;
413
    }
414
415
    protected function checkApplication($application)
416
    {
417
        return $this->getServiceLocator()->get('validatormanager')->get('Applications/Application')
418
                    ->isValid($application);
419
    }
420
421
    /**
422
     * Configures the apply form container.
423
     *
424
     * Currently only disables elements.
425
     *
426
     * @param Container $container
427
     */
428
    protected function configureContainer(Container $container)
429
    {
430
        /* @var $application Application */
431
        $application = $container->getEntity();
432
        $job         = $application->getJob();
433
434
        /** @var $settings \Applications\Entity\Settings */
435
        $settings = $job->getUser()->getSettings('Applications');
436
        $formSettings = $settings->getApplyFormSettings();
437
438
        if ($formSettings && $formSettings->isActive()) {
439
            $container->disableElements($formSettings->getDisableElements());
440
            return;
441
        }
442
443
        $config = $this->getServiceLocator()->get('Config');
444
        $config = isset($config['form_elements_config']['Applications/Apply']['disable_elements'])
445
                ? $config['form_elements_config']['Applications/Apply']['disable_elements']
446
                : null;
447
        if ($config) {
448
            $container->disableElements($config);
449
        }
450
    }
451
}
452