-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathFailingEntityUseLogic.php
More file actions
57 lines (51 loc) · 1.72 KB
/
FailingEntityUseLogic.php
File metadata and controls
57 lines (51 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
declare(strict_types=1);
namespace CakeDC\PHPStan\Test\TestCase\Rule\Model\Fake;
use App\Model\Entity\Note;
use Cake\ORM\Locator\LocatorAwareTrait;
use SplFixedArray;
class FailingEntityUseLogic
{
use LocatorAwareTrait;
/**
* @return array
*/
public function execute(): array
{
/**
* @var \App\Model\Table\NotesTable $Table
*/
$Table = $this->fetchTable('Notes');
$entity = $Table->get(1);
$note = $entity['note'];
$notable = 'Notable ' . $entity['note'];
$noted = $entity->note;
$note2 = $entity[Note::FIELD_NOTE];
$matching = $entity['_matchingData'];//allowed access to _matchingData
$matchingUser = $entity['_matchingData']['Users'];//allowed access to _matchingData
$joinData = $entity['_joinData'];//allowed access to _matchingData
$joinDataPosts = $entity['_joinData']['Posts'];//allowed access to _matchingData
$ids = $entity['_ids'];//allowed access to _matchingData
//Unknown entity
$unknown = $this->fetchTable('UnknownRecords')->get(20);
$date = $unknown['create'];
$user = $this->fetchTable('Users')->get(10);
$user['role'] = 'Admin';
$array = new SplFixedArray(2);
$array[0] = 'a';
$array[1] = 'b';
return [
'userId' => $entity['user_id'],
'note' => $note,
'noted' => $noted,
'notable' => $notable,
'date' => $date,
'note2' => $note2,
'matchingData' => $matching,
'matchingUser' => $matchingUser,
'joinData' => $joinData,
'joinDataPosts' => $joinDataPosts,
'ids' => $ids,
];
}
}