Skip to content

Commit e4c54a3

Browse files
committed
Merge pull request #25 from delatbabel/master
Adding documentation, adding documentation generation script
2 parents 64ed5a3 + 1661d84 commit e4c54a3

14 files changed

+185
-1
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22
composer.lock
33
composer.phar
44
phpunit.xml
5+
.directory
6+
reports/
7+
documents/

makedoc.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/sh
2+
3+
mkdir -p ./reports
4+
mkdir -p ./documents/apigen
5+
6+
if [ -z "$1" ]; then
7+
apigen \
8+
--title 'Onmipay Common API documentation' \
9+
--source ./src \
10+
--destination ./documents/apigen \
11+
--report ./reports/apigen.xml
12+
13+
#
14+
# Left here for further expansion, ignore this for the time being.
15+
#
16+
elif [ "$1" = "common" ]; then
17+
apigen \
18+
--title 'Omnipay Common API documentation' \
19+
--source ./src/Omnipay/Common \
20+
--destination ./documents/apigen \
21+
--report ./reports/apigen.xml
22+
23+
fi

src/Omnipay/Common/AbstractGateway.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
/**
3+
* Base payment gateway class
4+
*/
25

36
namespace Omnipay\Common;
47

@@ -9,6 +12,11 @@
912

1013
/**
1114
* Base payment gateway class
15+
*
16+
* This abstract class should be extended by all payment gateways
17+
* throughout the Omnipay system. It enforces implementation of
18+
* the GatewayInterface interface and defines various common attibutes
19+
* and methods that all gateways should have.
1220
*/
1321
abstract class AbstractGateway implements GatewayInterface
1422
{

src/Omnipay/Common/CreditCard.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
/**
3+
* Credit Card class
4+
*/
25

36
namespace Omnipay\Common;
47

@@ -9,6 +12,9 @@
912

1013
/**
1114
* Credit Card class
15+
*
16+
* This class defines and abstracts all of the credit card types used
17+
* throughout the Omnipay system.
1218
*/
1319
class CreditCard
1420
{

src/Omnipay/Common/Currency.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
<?php
2+
/**
3+
* Currency class
4+
*/
25

36
namespace Omnipay\Common;
47

58
/**
69
* Currency class
10+
*
11+
* This class abstracts certain functionality around currency objects,
12+
* currency codes and currency numbers relating to global currencies used
13+
* in the Omnipay system.
714
*/
815
class Currency
916
{

src/Omnipay/Common/GatewayFactory.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,27 @@
11
<?php
2+
/**
3+
* Omnipay Gateway Factory class
4+
*/
25

36
namespace Omnipay\Common;
47

58
use Guzzle\Http\ClientInterface;
69
use Omnipay\Common\Exception\RuntimeException;
710
use Symfony\Component\HttpFoundation\Request as HttpRequest;
811

12+
/**
13+
* Omnipay Gateway Factory class
14+
*
15+
* This class abstracts a set of gateways that can be independently
16+
* registered, accessed, and used.
17+
*/
918
class GatewayFactory
1019
{
20+
/**
21+
* Internal storage for all available gateways
22+
*
23+
* @var array
24+
*/
1125
private $gateways = array();
1226

1327
/**

src/Omnipay/Common/GatewayInterface.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
<?php
2+
/**
3+
* Payment gateway interface
4+
*/
25

36
namespace Omnipay\Common;
47

58
/**
69
* Payment gateway interface
10+
*
11+
* This interface class defines the standard functions that any
12+
* Omnipay gateway needs to define.
713
*/
814
interface GatewayInterface
915
{

src/Omnipay/Common/Helper.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
<?php
2+
/**
3+
* Helper class
4+
*/
25

36
namespace Omnipay\Common;
47

58
/**
69
* Helper class
10+
*
11+
* This class defines various static utility functions that are in use
12+
* throughout the Omnipay system.
713
*/
814
class Helper
915
{
1016
/**
1117
* Convert a string to camelCase. Strings already in camelCase will not be harmed.
18+
*
19+
* @param string $str The input string
20+
* @return string camelCased output string
1221
*/
1322
public static function camelCase($str)
1423
{
@@ -88,6 +97,9 @@ public static function getGatewayShortName($className)
8897
* Stripe => \Omnipay\Stripe\Gateway
8998
* PayPal\Express => \Omnipay\PayPal\ExpressGateway
9099
* PayPal_Express => \Omnipay\PayPal\ExpressGateway
100+
*
101+
* @param string $shortName The short gateway name
102+
* @return string The fully namespaced gateway class name
91103
*/
92104
public static function getGatewayClassName($shortName)
93105
{

src/Omnipay/Common/Issuer.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,46 @@
11
<?php
2+
/**
3+
* Issuer
4+
*/
25

36
namespace Omnipay\Common;
47

58
/**
69
* Issuer
10+
*
11+
* This class abstracts some functionality around card issuers used in the
12+
* Omnipay system.
713
*/
814
class Issuer
915
{
16+
/**
17+
* The identifier of the issuer.
18+
*
19+
* @var string
20+
*/
1021
protected $id;
22+
23+
/**
24+
* The full name of the issuer.
25+
*
26+
* @var string
27+
*/
1128
protected $name;
29+
30+
/**
31+
* The ID of a payment method that the issuer belongs to.
32+
*
33+
* @see PaymentMethod
34+
*
35+
* @var string
36+
*/
1237
protected $paymentMethod;
1338

1439
/**
1540
* Create a new Issuer
1641
*
42+
* @see PaymentMethod
43+
*
1744
* @param string $id The identifier of this issuer
1845
* @param string $name The name of this issuer
1946
* @param string|null $paymentMethod The ID of a payment method this issuer belongs to
@@ -48,6 +75,8 @@ public function getName()
4875
/**
4976
* The ID of a payment method this issuer belongs to
5077
*
78+
* @see PaymentMethod
79+
*
5180
* @return string
5281
*/
5382
public function getPaymentMethod()

src/Omnipay/Common/Item.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
<?php
2+
/**
3+
* Cart Item
4+
*/
25

36
namespace Omnipay\Common;
47

58
use Symfony\Component\HttpFoundation\ParameterBag;
69

710
/**
811
* Cart Item
12+
*
13+
* This class defines a single cart item in the Omnipay system.
14+
*
15+
* @see ItemInterface
916
*/
1017
class Item implements ItemInterface
1118
{

0 commit comments

Comments
 (0)