-
-
Notifications
You must be signed in to change notification settings - Fork 138
Expand file tree
/
Copy pathmember_chain.php
More file actions
100 lines (81 loc) · 3.72 KB
/
member_chain.php
File metadata and controls
100 lines (81 loc) · 3.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
one()->two();
one()
->two()
->three();
one()
->two->three()
->four->five();
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
return tap($this->forceFill([
'approver_id' => $user instanceof User ? $user->id : $user,
'approved_at' => $this->freshTimestamp(),
]))->save();
return collect(parent::jsonSerialize())->mapWithKeys(function ($value, $key) {
return [camel_case($key) => $value];
})->toArray();
method()->then(function ($x) { return $x; })
["abc"](function ($x) { return $x; })
[$abc](function ($x) { return $x; });
($a->a()->b());
($a)->a()->b();
$a->a()->b;
$a->b->a();
$a->b()->c()->d();
$a->b->c->d;
// should inline
$t->shouldReceive( 'signUp' )->with( anInstanceOf( 'Foo\\Bar\\Baz' ), $this->app['foo.bar.baz']->getEmail())->once();
$te->shouldReceive( 'signUp' )->with( anInstanceOf( 'Foo\\Bar\\Baz' ), $this->app['foo.bar.baz']->getEmail())->once();
$tes->shouldReceive( 'signUp' )->with( anInstanceOf( 'Foo\\Bar\\Baz' ), $this->app['foo.bar.baz']->getEmail())->once();
// should break
$test->shouldReceive( 'signUp' )->with( anInstanceOf( 'Foo\\Bar\\Baz' ), $this->app['foo.bar.baz']->getEmail())->once();
$a = $t->shouldReceive( 'signUp' )->with( anInstanceOf( 'Foo\\Bar\\Baz' ), $this->app['foo.bar.baz']->getEmail())->once();
$this->loooooooooooong->lookup = (int) $this->getRequest()->getParam(
'some-param'
);
$this->loooooooooooong->lookup = (int) $variable->getRequest()->getParam(
'some-param'
);
$aVariable = $theThing
->aLongFunction(1, 2, 3)
->anotherReallyLongFunciton('a', 'b', 'c');
$anotherVariables = $theOtherThing
->aLongFunction(1, 2, 3, 4, 5, 6, 7)
->anotherReallyLongFunciton('a', 'b', 'c');
$aVariable = $theThing->veryVeryVeryVeryVeryVeryVeryVeryLongCall()->veryVeryVeryVeryVeryVeryVeryVery;
$aVariable = $theThing->veryVeryVeryVeryVeryVeryVeryVeryLongCall()->veryVeryVeryVeryVeryVeryVeryVery();
bar()();
bar('veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong')();
bar()('veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong');
bar('veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong')()()()()();
$foo->bar()();
$foo->bar('veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong')();
$foo->bar()('veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong');
$foo->bar('veryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong')()()()()();
$brian->hotel->orders()->ordered()->with('smith')->get();
$brian::$hotel->orders()->ordered()->with('smith')->get();
$brian['hotel']->orders()->ordered()->with('smith')->get();
Foo::$hotel->orders()->ordered()->with('smith')->get();
(new Foo())->hotel->orders()->ordered()->with('smith')->get();
(clone $a)->hotel->orders()->ordered()->with('smith')->get();
$var = $brian->hotel->orders()->ordered()->with('smith')->get();
$var = $brian::$hotel->orders()->ordered()->with('smith')->get();
$var = $brian['hotel']->orders()->ordered()->with('smith')->get();
$var = Foo::$hotel->orders()->ordered()->with('smith')->get();
$var = (new Foo())->hotel->orders()->ordered()->with('smith')->get();
$var = (clone $a)->hotel->orders()->ordered()->with('smith')->get();
$var = Foo::keys($items)->filter(function ($x) { return $x > 2; })->map(function ($x) { return $x * 2; });
(new static(func_get_args()))->push($this)->each(function ($item) {
VarDumper::dump($item);
});
(new static(func_get_args()))->offset(10)->push($this)->each(function ($item) {
VarDumper::dump($item);
});
$a->foo(get())->bar()->baz();
$a->foo($b->method())->bar()->baz();
$a->foo(fn() => 1)->bar()->baz();
$a->foo(fn($x) => $x * 2)->bar()->baz();
$a->foo(get(inner(deepest())))->bar()->baz();