Skip to content

Commit ebda141

Browse files
committed
Add stubs for reflog internal functions
1 parent 200d107 commit ebda141

File tree

5 files changed

+123
-62
lines changed

5 files changed

+123
-62
lines changed

docs/DOCS.txt

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,6 +1496,32 @@ resource git_refdb_open(resource $repo)
14961496

14971497
void git_refdb_set_backend(resource $refdb,GitRefDBBackend $backend)
14981498

1499+
----------------------------------------
1500+
[git_reflog]
1501+
----------------------------------------
1502+
1503+
void git_reflog_append(resource $reflog,string $id,resource $committer,?string $msg)
1504+
1505+
void git_reflog_delete(resource $repo,string $name)
1506+
1507+
bool git_reflog_drop(resource $reflog,int $idx,bool $rewrite_previous_entry)
1508+
1509+
array git_reflog_entry_byindex(resource $reflog,int $idx)
1510+
1511+
Returns a git_reflog_entry array
1512+
1513+
int git_reflog_entrycount(resource $reflog)
1514+
1515+
void git_reflog_free(resource $reflog)
1516+
1517+
resource git_reflog_read(resource $repo,string $name)
1518+
1519+
Returns git_reflog resource
1520+
1521+
void git_reflog_rename(resource $repo,string $old_name,string $name)
1522+
1523+
void git_reflog_write(resource $reflog)
1524+
14991525
----------------------------------------
15001526
[git_reference]
15011527
----------------------------------------
@@ -2158,41 +2184,6 @@ git_status_should_ignore(resource,string)
21582184

21592185
Returns bool
21602186

2161-
----------------------------------------
2162-
[git_reflog]
2163-
----------------------------------------
2164-
2165-
git_reflog_append(resource,string,resource,string|null)
2166-
2167-
git_reflog_delete(resource,string)
2168-
2169-
git_reflog_drop(resource,int,bool)
2170-
2171-
Returns bool
2172-
2173-
git_reflog_entry_byindex(resource,int)
2174-
2175-
Return structure:
2176-
2177-
- committer
2178-
- id_new
2179-
- id_old
2180-
- message
2181-
2182-
Returns array
2183-
2184-
git_reflog_entrycount(resource)
2185-
2186-
git_reflog_free(resource)
2187-
2188-
git_reflog_read(resource,string)
2189-
2190-
Returns git_reflog resource
2191-
2192-
git_reflog_rename(resource,string,string)
2193-
2194-
git_reflog_write(resource)
2195-
21962187
----------------------------------------
21972188
[git_reset]
21982189
----------------------------------------

reflog.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#ifndef PHPGIT2_REFLOG_H
88
#define PHPGIT2_REFLOG_H
99

10+
#include "stubs/reflog_arginfo.h"
11+
1012
namespace php_git2
1113
{
1214
// Explicitly specialize git2_resource destructor for git_reference.

stubs/reflog.stub.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
3+
/**
4+
* @param resource $reflog
5+
* @param resource $committer
6+
*/
7+
function git_reflog_append($reflog,string $id,$committer,?string $msg) : void {}
8+
9+
/**
10+
* @param resource $repo
11+
*/
12+
function git_reflog_delete($repo,string $name) : void {}
13+
14+
/**
15+
* @param resource $reflog
16+
*/
17+
function git_reflog_drop($reflog,int $idx,bool $rewrite_previous_entry) : bool {}
18+
19+
/**
20+
* @param resource $reflog
21+
*/
22+
function git_reflog_entry_byindex($reflog,int $idx) : array {}
23+
24+
/**
25+
* @param resource $reflog
26+
*/
27+
function git_reflog_entrycount($reflog) : int {}
28+
29+
/**
30+
* @param resource $reflog
31+
*/
32+
function git_reflog_free($reflog) : void {}
33+
34+
/**
35+
* @param resource $repo
36+
*
37+
* @return resource
38+
*/
39+
function git_reflog_read($repo,string $name) {}
40+
41+
/**
42+
* @param resource $repo
43+
*/
44+
function git_reflog_rename($repo,string $old_name,string $name) : void {}
45+
46+
/**
47+
* @param resource $reflog
48+
*/
49+
function git_reflog_write($reflog) : void {}

stubs/reflog_arginfo.h

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/* This is a generated file, edit the .stub.php file instead.
2+
* Stub hash: 593254ed31bf53128c5470f060e614b308949946 */
3+
4+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_reflog_append, 0, 4, IS_VOID, 0)
5+
ZEND_ARG_INFO(0, reflog)
6+
ZEND_ARG_TYPE_INFO(0, id, IS_STRING, 0)
7+
ZEND_ARG_INFO(0, committer)
8+
ZEND_ARG_TYPE_INFO(0, msg, IS_STRING, 1)
9+
ZEND_END_ARG_INFO()
10+
11+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_reflog_delete, 0, 2, IS_VOID, 0)
12+
ZEND_ARG_INFO(0, repo)
13+
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
14+
ZEND_END_ARG_INFO()
15+
16+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_reflog_drop, 0, 3, _IS_BOOL, 0)
17+
ZEND_ARG_INFO(0, reflog)
18+
ZEND_ARG_TYPE_INFO(0, idx, IS_LONG, 0)
19+
ZEND_ARG_TYPE_INFO(0, rewrite_previous_entry, _IS_BOOL, 0)
20+
ZEND_END_ARG_INFO()
21+
22+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_reflog_entry_byindex, 0, 2, IS_ARRAY, 0)
23+
ZEND_ARG_INFO(0, reflog)
24+
ZEND_ARG_TYPE_INFO(0, idx, IS_LONG, 0)
25+
ZEND_END_ARG_INFO()
26+
27+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_reflog_entrycount, 0, 1, IS_LONG, 0)
28+
ZEND_ARG_INFO(0, reflog)
29+
ZEND_END_ARG_INFO()
30+
31+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_reflog_free, 0, 1, IS_VOID, 0)
32+
ZEND_ARG_INFO(0, reflog)
33+
ZEND_END_ARG_INFO()
34+
35+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_reflog_read, 0, 0, 2)
36+
ZEND_ARG_INFO(0, repo)
37+
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
38+
ZEND_END_ARG_INFO()
39+
40+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_reflog_rename, 0, 3, IS_VOID, 0)
41+
ZEND_ARG_INFO(0, repo)
42+
ZEND_ARG_TYPE_INFO(0, old_name, IS_STRING, 0)
43+
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
44+
ZEND_END_ARG_INFO()
45+
46+
#define arginfo_git_reflog_write arginfo_git_reflog_free

stubs/tmp.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -271,33 +271,6 @@ ZEND_END_ARG_INFO()
271271
ZEND_BEGIN_ARG_INFO(arginfo_git_status_should_ignore,{})
272272
ZEND_END_ARG_INFO()
273273

274-
ZEND_BEGIN_ARG_INFO(arginfo_git_reflog_append,{})
275-
ZEND_END_ARG_INFO()
276-
277-
ZEND_BEGIN_ARG_INFO(arginfo_git_reflog_delete,{})
278-
ZEND_END_ARG_INFO()
279-
280-
ZEND_BEGIN_ARG_INFO(arginfo_git_reflog_drop,{})
281-
ZEND_END_ARG_INFO()
282-
283-
ZEND_BEGIN_ARG_INFO(arginfo_git_reflog_entry_byindex,{})
284-
ZEND_END_ARG_INFO()
285-
286-
ZEND_BEGIN_ARG_INFO(arginfo_git_reflog_entrycount,{})
287-
ZEND_END_ARG_INFO()
288-
289-
ZEND_BEGIN_ARG_INFO(arginfo_git_reflog_free,{})
290-
ZEND_END_ARG_INFO()
291-
292-
ZEND_BEGIN_ARG_INFO(arginfo_git_reflog_read,{})
293-
ZEND_END_ARG_INFO()
294-
295-
ZEND_BEGIN_ARG_INFO(arginfo_git_reflog_rename,{})
296-
ZEND_END_ARG_INFO()
297-
298-
ZEND_BEGIN_ARG_INFO(arginfo_git_reflog_write,{})
299-
ZEND_END_ARG_INFO()
300-
301274
ZEND_BEGIN_ARG_INFO(arginfo_git_reset,{})
302275
ZEND_END_ARG_INFO()
303276

0 commit comments

Comments
 (0)