Skip to content

Commit 654f8c8

Browse files
committed
converts to camelcase.
1 parent 1ec0242 commit 654f8c8

File tree

15 files changed

+219
-184
lines changed

15 files changed

+219
-184
lines changed

.github/workflows/ci.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build-test:
7+
runs-on: ubuntu-latest
8+
container:
9+
image: php:8.4 # This forces the job to run in a Docker container
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
15+
- name: Install System Dependencies (Git, Zip, Unzip)
16+
run: |
17+
apt-get update
18+
apt-get install -y unzip git zip
19+
20+
- name: Install and Enable extensions
21+
run: |
22+
docker-php-ext-install sockets calendar
23+
docker-php-ext-enable sockets calendar
24+
25+
- name: Install Composer
26+
run: |
27+
curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
28+
composer --version
29+
30+
- name: Install Dependencies
31+
run: composer install --prefer-dist --no-progress
32+
33+
- name: Run PHPUnit
34+
run: vendor/bin/phpunit tests

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"require": {
1313
"ext-curl": "*",
1414
"ext-json": "*",
15-
"neuron-php/core": "^0.7.0"
15+
"neuron-php/core": "0.8.*"
1616
},
1717
"require-dev": {
1818
"phpunit/phpunit": "9.*"

src/Formatters/Currency.php

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99

1010
class Currency implements IFormatter
1111
{
12-
private string $_Format;
13-
private int $_PadLength;
14-
private string $_PadCharacter;
15-
private string $_CurrencySymbol;
12+
private string $_format;
13+
private int $_padLength;
14+
private string $_padCharacter;
15+
private string $_currencySymbol;
1616

1717
public function __construct()
1818
{
@@ -28,17 +28,17 @@ public function __construct()
2828

2929
public function getPadCharacter(): string
3030
{
31-
return $this->_PadCharacter;
31+
return $this->_padCharacter;
3232
}
3333

3434
/**
35-
* @param string $PadCharacter
35+
* @param string $padCharacter
3636
* @return Currency
3737
*/
3838

39-
public function setPadCharacter( string $PadCharacter ): Currency
39+
public function setPadCharacter( string $padCharacter ): Currency
4040
{
41-
$this->_PadCharacter = $PadCharacter;
41+
$this->_padCharacter = $padCharacter;
4242
return $this;
4343
}
4444

@@ -48,17 +48,17 @@ public function setPadCharacter( string $PadCharacter ): Currency
4848

4949
public function getCurrencySymbol(): string
5050
{
51-
return $this->_CurrencySymbol;
51+
return $this->_currencySymbol;
5252
}
5353

5454
/**
55-
* @param string $CurrencySymbol
55+
* @param string $currencySymbol
5656
* @return Currency
5757
*/
5858

59-
public function setCurrencySymbol( string $CurrencySymbol ): Currency
59+
public function setCurrencySymbol( string $currencySymbol ): Currency
6060
{
61-
$this->_CurrencySymbol = $CurrencySymbol;
61+
$this->_currencySymbol = $currencySymbol;
6262
return $this;
6363
}
6464

@@ -68,17 +68,17 @@ public function setCurrencySymbol( string $CurrencySymbol ): Currency
6868

6969
public function getFormat() : string
7070
{
71-
return $this->_Format;
71+
return $this->_format;
7272
}
7373

7474
/**
75-
* @param string $Format
75+
* @param string $format
7676
* @return Currency
7777
*/
7878

79-
public function setFormat( string $Format ) : Currency
79+
public function setFormat( string $format ) : Currency
8080
{
81-
$this->_Format = $Format;
81+
$this->_format = $format;
8282
return $this;
8383
}
8484

@@ -88,32 +88,32 @@ public function setFormat( string $Format ) : Currency
8888

8989
public function getPadLength() : int
9090
{
91-
return $this->_PadLength;
91+
return $this->_padLength;
9292
}
9393

9494
/**
95-
* @param int $PadLength
95+
* @param int $padLength
9696
* @return Currency
9797
*/
9898

99-
public function setPadLength( int $PadLength ) : Currency
99+
public function setPadLength( int $padLength ) : Currency
100100
{
101-
$this->_PadLength = $PadLength;
101+
$this->_padLength = $padLength;
102102
return $this;
103103
}
104104

105105
/**
106-
* @param string $Data
106+
* @param string $data
107107
* @return string|null
108108
*/
109109

110-
public function format( string $Data ): ?string
110+
public function format( string $data ): ?string
111111
{
112112
return
113113
$this->getCurrencySymbol().str_pad(
114114
sprintf(
115115
$this->getFormat(),
116-
round( $Data, 2 )
116+
round( $data, 2 )
117117
),
118118
$this->getPadLength(),
119119
$this->getPadCharacter(),

src/Formatters/Date.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,18 @@ public function __construct()
1414
}
1515

1616
/**
17-
* @param string $Data
17+
* @param string $data
1818
* @return string|null
1919
*/
2020

21-
public function format( string $Data ): ?string
21+
public function format( string $data ): ?string
2222
{
23-
$Date = self::normalizeDate( $Data );
24-
if( $Date === null )
23+
$date = self::normalizeDate( $data );
24+
if( $date === null )
2525
{
2626
return null;
2727
}
2828

29-
return date( $this->getFormat(), strtotime( $Date ) );
29+
return date( $this->getFormat(), strtotime( $date ) );
3030
}
3131
}

0 commit comments

Comments
 (0)