• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

AJenbo / agcms / 21420560247

28 Jan 2026 12:59AM UTC coverage: 52.306% (-1.4%) from 53.72%
21420560247

push

github

AJenbo
Bump phpunit/phpunit from 9.6.11 to 9.6.33 in /application

Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.6.11 to 9.6.33.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/9.6.33/ChangeLog-9.6.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.6.11...9.6.33)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-version: 9.6.33
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

3039 of 5810 relevant lines covered (52.31%)

12.21 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/application/inc/Http/Controllers/Admin/TableController.php
1
<?php
2

3
namespace App\Http\Controllers\Admin;
4

5
use App\Exceptions\InvalidInput;
6
use App\Http\Request;
7
use App\Models\CustomSorting;
8
use App\Models\Page;
9
use App\Models\Table;
10
use App\Services\OrmService;
11
use Symfony\Component\HttpFoundation\JsonResponse;
12
use Symfony\Component\HttpFoundation\Response;
13

14
class TableController extends AbstractAdminController
15
{
16
    /**
17
     * Add table to page.
18
     */
19
    public function create(Request $request): JsonResponse
20
    {
21
        $table = new Table([
×
22
            'page_id'     => $request->request->getInt('page_id'),
×
23
            'title'       => $request->getRequestString('title'),
×
24
            'column_data' => json_encode($request->request->all('columns'), JSON_THROW_ON_ERROR),
×
25
            'order_by'    => $request->request->getInt('order_by'),
×
26
            'has_links'   => $request->request->getBoolean('has_links'),
×
27
        ]);
×
28
        $table->save();
×
29

30
        return new JsonResponse([]);
×
31
    }
32

33
    /**
34
     * Add table to page.
35
     */
36
    public function createDialog(Request $request, int $pageId): Response
37
    {
38
        return $this->render(
×
39
            'admin/addlist',
×
40
            [
×
41
                'customSortings' => app(OrmService::class)->getByQuery(CustomSorting::class, 'SELECT * FROM `tablesort`'),
×
42
                'page_id'        => $pageId,
×
43
            ]
×
44
        );
×
45
    }
46

47
    /**
48
     * Add row to a table.
49
     */
50
    public function addRow(Request $request, int $tableId): JsonResponse
51
    {
52
        $cells = [];
×
53
        foreach ($request->request->all('cells') as $cell) {
×
54
            $cells[] = valstring($cell);
×
55
        }
56

57
        $link = $request->getRequestInt('link');
×
58
        if ($link) {
×
59
            $page = app(OrmService::class)->getOne(Page::class, $link);
×
60
            if (!$page) {
×
61
                throw new InvalidInput(_('Linked page not found.'), Response::HTTP_NOT_FOUND);
×
62
            }
63
        }
64

65
        $table = app(OrmService::class)->getOne(Table::class, $tableId);
×
66
        if (!$table) {
×
67
            throw new InvalidInput(_('Table not found.'), Response::HTTP_NOT_FOUND);
×
68
        }
69

70
        $rowId = $table->addRow($cells, $link);
×
71

72
        return new JsonResponse(['listid' => $tableId, 'rowid' => $rowId]);
×
73
    }
74

75
    public function updateRow(Request $request, int $tableId, int $rowId): JsonResponse
76
    {
77
        $cells = [];
×
78
        foreach ($request->request->all('cells') as $cell) {
×
79
            $cells[] = valstring($cell);
×
80
        }
81

82
        $link = $request->getRequestInt('link');
×
83
        if ($link) {
×
84
            $page = app(OrmService::class)->getOne(Page::class, $link);
×
85
            if (!$page) {
×
86
                throw new InvalidInput(_('Linked page not found.'), Response::HTTP_NOT_FOUND);
×
87
            }
88
        }
89

90
        $table = app(OrmService::class)->getOne(Table::class, $tableId);
×
91
        if (!$table) {
×
92
            throw new InvalidInput(_('Table not found.'), Response::HTTP_NOT_FOUND);
×
93
        }
94

95
        $table->updateRow($rowId, $cells, $link);
×
96

97
        return new JsonResponse(['listid' => $tableId, 'rowid' => $rowId]);
×
98
    }
99

100
    public function removeRow(Request $request, int $tableId, int $rowId): JsonResponse
101
    {
102
        $table = app(OrmService::class)->getOne(Table::class, $tableId);
×
103
        if (!$table) {
×
104
            throw new InvalidInput(_('Table not found.'), Response::HTTP_NOT_FOUND);
×
105
        }
106

107
        $table->removeRow($rowId);
×
108

109
        return new JsonResponse(['listid' => $tableId, 'rowid' => $rowId]);
×
110
    }
111
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc