File tree 10 files changed +186
-0
lines changed
10 files changed +186
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace ApiClients \Client \Twitter \Resource \Async ;
4
+
5
+ use ApiClients \Client \Twitter \Resource \EmptyWarning as BaseEmptyWarning ;
6
+
7
+ class EmptyWarning extends BaseEmptyWarning
8
+ {
9
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace ApiClients \Client \Twitter \Resource \Async ;
4
+
5
+ use ApiClients \Client \Twitter \Resource \Warning as BaseWarning ;
6
+
7
+ class Warning extends BaseWarning
8
+ {
9
+ public function refresh () : Warning
10
+ {
11
+ throw new \Exception ('TODO: create refresh method! ' );
12
+ }
13
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace ApiClients \Client \Twitter \Resource ;
4
+
5
+ use ApiClients \Foundation \Resource \EmptyResourceInterface ;
6
+
7
+ abstract class EmptyWarning implements WarningInterface, EmptyResourceInterface
8
+ {
9
+ /**
10
+ * @return array
11
+ */
12
+ public function status () : array
13
+ {
14
+ return null ;
15
+ }
16
+
17
+ /**
18
+ * @return string
19
+ */
20
+ public function timestampMs () : string
21
+ {
22
+ return null ;
23
+ }
24
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace ApiClients \Client \Twitter \Resource \Sync ;
4
+
5
+ use ApiClients \Client \Twitter \Resource \EmptyWarning as BaseEmptyWarning ;
6
+
7
+ class EmptyWarning extends BaseEmptyWarning
8
+ {
9
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace ApiClients \Client \Twitter \Resource \Sync ;
4
+
5
+ use ApiClients \Client \Twitter \Resource \Warning as BaseWarning ;
6
+ use ApiClients \Client \Twitter \Resource \WarningInterface ;
7
+ use ApiClients \Foundation \Hydrator \CommandBus \Command \BuildAsyncFromSyncCommand ;
8
+
9
+ class Warning extends BaseWarning
10
+ {
11
+ public function refresh () : Warning
12
+ {
13
+ return $ this ->wait (
14
+ $ this ->handleCommand (
15
+ new BuildAsyncFromSyncCommand (self ::HYDRATE_CLASS , $ this )
16
+ )->then (
17
+ function (WarningInterface $ warning ) {
18
+ return $ warning ->refresh ();
19
+ }
20
+ )
21
+ );
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace ApiClients \Client \Twitter \Resource ;
4
+
5
+ use ApiClients \Foundation \Hydrator \Annotations \EmptyResource ;
6
+ use ApiClients \Foundation \Resource \AbstractResource ;
7
+
8
+ /**
9
+ * @EmptyResource("EmptyWarning")
10
+ */
11
+ abstract class Warning extends AbstractResource implements WarningInterface
12
+ {
13
+ /**
14
+ * @var array
15
+ */
16
+ protected $ status ;
17
+
18
+ /**
19
+ * @var string
20
+ */
21
+ protected $ timestamp_ms ;
22
+
23
+ /**
24
+ * @return array
25
+ */
26
+ public function status () : array
27
+ {
28
+ return $ this ->status ;
29
+ }
30
+
31
+ /**
32
+ * @return string
33
+ */
34
+ public function timestampMs () : string
35
+ {
36
+ return $ this ->timestamp_ms ;
37
+ }
38
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace ApiClients \Client \Twitter \Resource ;
4
+
5
+ use ApiClients \Foundation \Resource \ResourceInterface ;
6
+
7
+ interface WarningInterface extends ResourceInterface
8
+ {
9
+ const HYDRATE_CLASS = 'Warning ' ;
10
+
11
+ /**
12
+ * @return array
13
+ */
14
+ public function status () : array ;
15
+
16
+ /**
17
+ * @return string
18
+ */
19
+ public function timestampMs () : string ;
20
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace ApiClients \Tests \Client \Twitter \Resource \Async ;
4
+
5
+ use ApiClients \Client \Twitter \ApiSettings ;
6
+ use ApiClients \Client \Twitter \Resource \Warning ;
7
+ use ApiClients \Tools \ResourceTestUtilities \AbstractResourceTest ;
8
+
9
+ class WarningTest extends AbstractResourceTest
10
+ {
11
+ public function getSyncAsync () : string
12
+ {
13
+ return 'Async ' ;
14
+ }
15
+ public function getClass () : string
16
+ {
17
+ return Warning::class;
18
+ }
19
+ public function getNamespace () : string
20
+ {
21
+ return Apisettings::NAMESPACE ;
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ <?php declare (strict_types=1 );
2
+
3
+ namespace ApiClients \Tests \Client \Twitter \Resource \Sync ;
4
+
5
+ use ApiClients \Client \Twitter \ApiSettings ;
6
+ use ApiClients \Client \Twitter \Resource \Warning ;
7
+ use ApiClients \Tools \ResourceTestUtilities \AbstractResourceTest ;
8
+
9
+ class WarningTest extends AbstractResourceTest
10
+ {
11
+ public function getSyncAsync () : string
12
+ {
13
+ return 'Sync ' ;
14
+ }
15
+ public function getClass () : string
16
+ {
17
+ return Warning::class;
18
+ }
19
+ public function getNamespace () : string
20
+ {
21
+ return Apisettings::NAMESPACE ;
22
+ }
23
+ }
Original file line number Diff line number Diff line change
1
+ class : Warning
2
+ properties :
3
+ status : array
4
+ timestamp_ms : string
You can’t perform that action at this time.
0 commit comments