1 | <?php |
||
10 | class WordPress_GitHub_Sync_Fetch_Client extends WordPress_GitHub_Sync_Base_Client { |
||
11 | |||
12 | /** |
||
13 | * Retrieve the last commit in the repository |
||
14 | * |
||
15 | * @return WordPress_GitHub_Sync_Commit|WP_Error |
||
16 | */ |
||
17 | 11 | public function master() { |
|
26 | |||
27 | /** |
||
28 | * Retrieves a commit by sha from the GitHub API |
||
29 | * |
||
30 | * @param string $sha Sha for commit to retrieve. |
||
31 | * |
||
32 | * @return WordPress_GitHub_Sync_Commit|WP_Error |
||
33 | */ |
||
34 | 7 | public function commit( $sha ) { |
|
56 | |||
57 | /** |
||
58 | * Calls the content API to get the post's contents and metadata |
||
59 | * |
||
60 | * Returns Object the response from the API |
||
61 | * |
||
62 | * @param WordPress_GitHub_Sync_Post $post Post to retrieve remote contents for. |
||
63 | * |
||
64 | * @return mixed |
||
65 | */ |
||
66 | public function remote_contents( $post ) { |
||
69 | |||
70 | /** |
||
71 | * Retrieves a tree by sha recursively from the GitHub API |
||
72 | * |
||
73 | * @param string $sha Commit sha to retrieve tree from. |
||
74 | * |
||
75 | * @return WordPress_GitHub_Sync_Tree|WP_Error |
||
76 | */ |
||
77 | 5 | protected function tree_recursive( $sha ) { |
|
102 | |||
103 | /** |
||
104 | * Generates blobs for recursive tree blob data. |
||
105 | * |
||
106 | * @param stdClass[] $blobs Array of tree blob data. |
||
107 | * |
||
108 | * @return WordPress_GitHub_Sync_Blob[] |
||
109 | */ |
||
110 | 3 | protected function blobs( array $blobs ) { |
|
123 | |||
124 | /** |
||
125 | * Retrieves the blob data for a given sha |
||
126 | * |
||
127 | * @param stdClass $blob Tree blob data. |
||
128 | * |
||
129 | * @return WordPress_GitHub_Sync_Blob|WP_Error |
||
130 | */ |
||
131 | 3 | protected function blob( $blob ) { |
|
147 | } |
||
148 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.