1 | <?php |
||
2 | |||
3 | use Ffcms\Core\Helper\Date; |
||
4 | use Ffcms\Templex\Url\Url; |
||
0 ignored issues
–
show
|
|||
5 | |||
6 | /** @var \Apps\ActiveRecord\Invite[]|\Illuminate\Support\Collection $records */ |
||
7 | /** @var array $pagination */ |
||
8 | /** @var array $configs */ |
||
9 | /** @var \Ffcms\Templex\Template\Template $this */ |
||
10 | |||
11 | $this->layout('_layouts/default', [ |
||
12 | 'title' => __('Invitation list'), |
||
13 | 'breadcrumbs' => [ |
||
14 | Url::to('main/index') => __('Main'), |
||
15 | Url::to('application/index') => __('Applications'), |
||
16 | __('Invitation list') |
||
17 | ] |
||
18 | ]); |
||
19 | ?> |
||
20 | |||
21 | <?php $this->start('body') ?> |
||
22 | |||
23 | <?= $this->insert('user/_tabs') ?> |
||
0 ignored issues
–
show
Are you sure the usage of
$this->insert('user/_tabs') targeting League\Plates\Template\Template::insert() seems to always return null.
This check looks for function or method calls that always return null and whose return value is used. class A
{
function getObject()
{
return null;
}
}
$a = new A();
if ($a->getObject()) {
The method The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
Loading history...
|
|||
24 | <h1><?= __('Invitation list') ?></h1> |
||
25 | <?php if ($configs['registrationType'] !== 0) { |
||
26 | echo $this->bootstrap()->alert('danger', __('Invite system is disabled. Registration is public')); |
||
27 | } ?> |
||
28 | <div> |
||
29 | <?= Url::a(['user/invite'], __('Send invite'), ['class' => 'btn btn-info']) ?> |
||
30 | </div> |
||
31 | |||
32 | <?php if ($records->count() < 1) { |
||
33 | echo $this->bootstrap()->alert('warning', __('No invites recently send')); |
||
34 | $this->stop(); |
||
35 | return; |
||
36 | } ?> |
||
37 | |||
38 | <?php |
||
39 | $table = $this->table(['class' => 'table table-striped']) |
||
40 | ->head([ |
||
41 | ['text' => '#'], |
||
42 | ['text' => __('Email')], |
||
43 | ['text' => __('Valid')], |
||
44 | ['text' => __('Send date')], |
||
45 | ['text' => __('Actions'), 'properties' => ['class' => 'text-center']] |
||
46 | ]); |
||
47 | |||
48 | |||
49 | foreach ($records as $invite) { |
||
50 | $time = Date::convertToTimestamp($invite->created_at); |
||
51 | $table->row([ |
||
52 | ['text' => $invite->id], |
||
53 | ['text' => $invite->email], |
||
54 | ['text' => (time() - $time < \Apps\ActiveRecord\Invite::TOKEN_VALID_TIME ? '<i class="fa fa-check text-success"></i>' : '<i class="fa fa-minus text-danger"></i>'), 'html' => true], |
||
55 | ['text' => Date::convertToDatetime($invite->created_at, Date::FORMAT_TO_DAY)], |
||
56 | ['text' => Url::a(['user/invitedelete', [$invite->id]], ' <i class="fa fa-trash-o fa-lg"></i>', ['html' => true]), |
||
57 | 'properties' => ['class' => 'text-center'], 'html' => true] |
||
58 | ]); |
||
59 | } |
||
60 | ?> |
||
61 | |||
62 | <div class="table-responsive"> |
||
63 | <?= $table->display() ?> |
||
64 | </div> |
||
65 | |||
66 | <?= $this->bootstrap()->pagination($pagination['url'], ['class' => 'pagination justify-content-center']) |
||
67 | ->size($pagination['total'], $pagination['page'], $pagination['step']) |
||
68 | ->display(); ?> |
||
69 | |||
70 | <?php $this->stop() ?> |
Let?s assume that you have a directory layout like this:
and let?s assume the following content of
Bar.php
:If both files
OtherDir/Foo.php
andSomeDir/Foo.php
are loaded in the same runtime, you will see a PHP error such as the following:PHP Fatal error: Cannot use SomeDir\Foo as Foo because the name is already in use in OtherDir/Foo.php
However, as
OtherDir/Foo.php
does not necessarily have to be loaded and the error is only triggered if it is loaded beforeOtherDir/Bar.php
, this problem might go unnoticed for a while. In order to prevent this error from surfacing, you must import the namespace with a different alias: