Skip to content

Commit 91fa025

Browse files
committed
Add stubs for refspec internal functions
1 parent ebda141 commit 91fa025

File tree

5 files changed

+128
-93
lines changed

5 files changed

+128
-93
lines changed

docs/DOCS.txt

Lines changed: 48 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,32 +1496,6 @@ 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-
15251499
----------------------------------------
15261500
[git_reference]
15271501
----------------------------------------
@@ -1656,6 +1630,54 @@ resource git_reference_symbolic_set_target(resource $ref,string $target,string $
16561630

16571631
int git_reference_type(resource $ref)
16581632

1633+
----------------------------------------
1634+
[git_reflog]
1635+
----------------------------------------
1636+
1637+
void git_reflog_append(resource $reflog,string $id,resource $committer,?string $msg)
1638+
1639+
void git_reflog_delete(resource $repo,string $name)
1640+
1641+
bool git_reflog_drop(resource $reflog,int $idx,bool $rewrite_previous_entry)
1642+
1643+
array git_reflog_entry_byindex(resource $reflog,int $idx)
1644+
1645+
Returns a git_reflog_entry array
1646+
1647+
int git_reflog_entrycount(resource $reflog)
1648+
1649+
void git_reflog_free(resource $reflog)
1650+
1651+
resource git_reflog_read(resource $repo,string $name)
1652+
1653+
Returns git_reflog resource
1654+
1655+
void git_reflog_rename(resource $repo,string $old_name,string $name)
1656+
1657+
void git_reflog_write(resource $reflog)
1658+
1659+
----------------------------------------
1660+
[git_refspec]
1661+
----------------------------------------
1662+
1663+
int git_refspec_direction(resource $refspec)
1664+
1665+
string git_refspec_dst(resource $refspec)
1666+
1667+
bool git_refspec_dst_matches(resource $refspec,string $refname)
1668+
1669+
bool git_refspec_force(resource $refspec)
1670+
1671+
string git_refspec_rtransform(resource $refspec,string $name)
1672+
1673+
string git_refspec_src(resource $refspec)
1674+
1675+
bool git_refspec_src_matches(resource $refspec,string $refname)
1676+
1677+
string git_refspec_string(resource $refspec)
1678+
1679+
string git_refspec_transform(resource $refspec,string $name)
1680+
16591681
----------------------------------------
16601682
[git_repository]
16611683
----------------------------------------
@@ -2411,46 +2433,6 @@ git_remote_url(resource)
24112433

24122434
Returns string
24132435

2414-
----------------------------------------
2415-
[git_refspec]
2416-
----------------------------------------
2417-
2418-
git_refspec_direction(resource)
2419-
2420-
Returns int
2421-
2422-
git_refspec_dst(resource)
2423-
2424-
Returns string
2425-
2426-
git_refspec_dst_matches(resource,string)
2427-
2428-
Returns bool
2429-
2430-
git_refspec_force(resource)
2431-
2432-
Returns bool
2433-
2434-
git_refspec_rtransform(resource,string)
2435-
2436-
Returns string
2437-
2438-
git_refspec_src(resource)
2439-
2440-
Returns string
2441-
2442-
git_refspec_src_matches(resource,string)
2443-
2444-
Returns bool
2445-
2446-
git_refspec_string(resource)
2447-
2448-
Returns string
2449-
2450-
git_refspec_transform(resource,string)
2451-
2452-
Returns string
2453-
24542436
----------------------------------------
24552437
[git_submodule]
24562438
----------------------------------------

refspec.h

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

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

stubs/refspec.stub.php

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?php
2+
3+
/**
4+
* @param resource $refspec
5+
*/
6+
function git_refspec_direction($refspec) : int {}
7+
8+
/**
9+
* @param resource $refspec
10+
*/
11+
function git_refspec_dst($refspec) : string {}
12+
13+
/**
14+
* @param resource $refspec
15+
*/
16+
function git_refspec_dst_matches($refspec,string $refname) : bool {}
17+
18+
/**
19+
* @param resource $refspec
20+
*/
21+
function git_refspec_force($refspec) : bool {}
22+
23+
/**
24+
* @param resource $refspec
25+
*/
26+
function git_refspec_rtransform($refspec,string $name) : string {}
27+
28+
/**
29+
* @param resource $refspec
30+
*/
31+
function git_refspec_src($refspec) : string {}
32+
33+
/**
34+
* @param resource $refspec
35+
*/
36+
function git_refspec_src_matches($refspec,string $refname) : bool {}
37+
38+
/**
39+
* @param resource $refspec
40+
*/
41+
function git_refspec_string($refspec) : string {}
42+
43+
/**
44+
* @param resource $refspec
45+
*/
46+
function git_refspec_transform($refspec,string $name) : string {}

stubs/refspec_arginfo.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/* This is a generated file, edit the .stub.php file instead.
2+
* Stub hash: 743a993cbd15cba0797561a05ab3421fbc14c476 */
3+
4+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_refspec_direction, 0, 1, IS_LONG, 0)
5+
ZEND_ARG_INFO(0, refspec)
6+
ZEND_END_ARG_INFO()
7+
8+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_refspec_dst, 0, 1, IS_STRING, 0)
9+
ZEND_ARG_INFO(0, refspec)
10+
ZEND_END_ARG_INFO()
11+
12+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_refspec_dst_matches, 0, 2, _IS_BOOL, 0)
13+
ZEND_ARG_INFO(0, refspec)
14+
ZEND_ARG_TYPE_INFO(0, refname, IS_STRING, 0)
15+
ZEND_END_ARG_INFO()
16+
17+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_refspec_force, 0, 1, _IS_BOOL, 0)
18+
ZEND_ARG_INFO(0, refspec)
19+
ZEND_END_ARG_INFO()
20+
21+
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_git_refspec_rtransform, 0, 2, IS_STRING, 0)
22+
ZEND_ARG_INFO(0, refspec)
23+
ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0)
24+
ZEND_END_ARG_INFO()
25+
26+
#define arginfo_git_refspec_src arginfo_git_refspec_dst
27+
28+
#define arginfo_git_refspec_src_matches arginfo_git_refspec_dst_matches
29+
30+
#define arginfo_git_refspec_string arginfo_git_refspec_dst
31+
32+
#define arginfo_git_refspec_transform arginfo_git_refspec_rtransform

stubs/tmp.h

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -415,33 +415,6 @@ ZEND_END_ARG_INFO()
415415
ZEND_BEGIN_ARG_INFO(arginfo_git_remote_url,{})
416416
ZEND_END_ARG_INFO()
417417

418-
ZEND_BEGIN_ARG_INFO(arginfo_git_refspec_direction,{})
419-
ZEND_END_ARG_INFO()
420-
421-
ZEND_BEGIN_ARG_INFO(arginfo_git_refspec_dst,{})
422-
ZEND_END_ARG_INFO()
423-
424-
ZEND_BEGIN_ARG_INFO(arginfo_git_refspec_dst_matches,{})
425-
ZEND_END_ARG_INFO()
426-
427-
ZEND_BEGIN_ARG_INFO(arginfo_git_refspec_force,{})
428-
ZEND_END_ARG_INFO()
429-
430-
ZEND_BEGIN_ARG_INFO(arginfo_git_refspec_rtransform,{})
431-
ZEND_END_ARG_INFO()
432-
433-
ZEND_BEGIN_ARG_INFO(arginfo_git_refspec_src,{})
434-
ZEND_END_ARG_INFO()
435-
436-
ZEND_BEGIN_ARG_INFO(arginfo_git_refspec_src_matches,{})
437-
ZEND_END_ARG_INFO()
438-
439-
ZEND_BEGIN_ARG_INFO(arginfo_git_refspec_string,{})
440-
ZEND_END_ARG_INFO()
441-
442-
ZEND_BEGIN_ARG_INFO(arginfo_git_refspec_transform,{})
443-
ZEND_END_ARG_INFO()
444-
445418
ZEND_BEGIN_ARG_INFO(arginfo_git_submodule_add_finalize,{})
446419
ZEND_END_ARG_INFO()
447420

0 commit comments

Comments
 (0)