Skip to content

Commit 232b1dc

Browse files
committed
New -> php-facturae
1 parent d8ff568 commit 232b1dc

31 files changed

Lines changed: 188 additions & 81 deletions

composer.json

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
{
2-
"name": "mariodevv/rex",
3-
"description": "Spanish business integrations for PHP",
2+
"name": "php-facturae/php-facturae",
3+
"description": "Generate, validate and sign FacturaE (3.2.x) electronic invoices in PHP — the modern alternative for Spanish e-invoicing",
44
"type": "library",
55
"license": "MIT",
66
"keywords": [
77
"facturae",
88
"factura-electronica",
9+
"electronic-invoice",
10+
"e-invoice",
911
"spain",
1012
"fiscal",
1113
"xades",
1214
"xml",
13-
"aeat"
15+
"aeat",
16+
"tax",
17+
"invoice",
18+
"signing",
19+
"php-facturae",
20+
"facturae-php"
1421
],
15-
"homepage": "https://github.com/mariodevv/rex",
22+
"homepage": "https://github.com/php-facturae/php-facturae",
1623
"authors": [
1724
{
18-
"name": "MarioDevv",
19-
"email": "perezmario.info@gmail.com"
25+
"name": "Mario Pérez",
26+
"email": "perezmario.info@gmail.com",
27+
"role": "Lead Developer"
2028
}
2129
],
30+
"support": {
31+
"issues": "https://github.com/php-facturae/php-facturae/issues",
32+
"source": "https://github.com/php-facturae/php-facturae"
33+
},
2234
"require": {
2335
"php": "^8.2",
2436
"ext-openssl": "*",
@@ -30,12 +42,12 @@
3042
},
3143
"autoload": {
3244
"psr-4": {
33-
"MarioDevv\\Rex\\Facturae\\": "src/Facturae/"
45+
"PhpFacturae\\": "src/"
3446
}
3547
},
3648
"autoload-dev": {
3749
"psr-4": {
38-
"MarioDevv\\Rex\\Tests\\Facturae\\": "tests/Facturae/"
50+
"PhpFacturae\\Tests\\": "tests/"
3951
}
4052
},
4153
"scripts": {

migrate.sh

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "=== php-facturae migration ==="
5+
6+
# 1. Flatten src/Facturae/ → src/
7+
if [ -d "src/Facturae" ]; then
8+
echo "Moving src/Facturae/ contents to src/..."
9+
cp -r src/Facturae/. src/
10+
rm -rf src/Facturae
11+
else
12+
echo "src/Facturae not found — skipping"
13+
fi
14+
15+
# 2. Flatten tests/Facturae/ → tests/
16+
if [ -d "tests/Facturae" ]; then
17+
echo "Moving tests/Facturae/ contents to tests/..."
18+
cp -r tests/Facturae/. tests/
19+
rm -rf tests/Facturae
20+
else
21+
echo "tests/Facturae not found — skipping"
22+
fi
23+
24+
# 3. Replace namespaces in all PHP files
25+
echo "Updating namespaces..."
26+
27+
find src/ -name "*.php" -exec sed -i \
28+
-e 's/MarioDevv\\Rex\\Facturae\\/PhpFacturae\\/g' \
29+
-e 's/MarioDevv\\\\Rex\\\\Facturae\\\\/PhpFacturae\\\\/g' \
30+
{} +
31+
32+
find tests/ -name "*.php" -exec sed -i \
33+
-e 's/MarioDevv\\Rex\\Tests\\Facturae\\/PhpFacturae\\Tests\\/g' \
34+
-e 's/MarioDevv\\\\Rex\\\\Tests\\\\Facturae\\\\/PhpFacturae\\\\Tests\\\\/g' \
35+
-e 's/MarioDevv\\Rex\\Facturae\\/PhpFacturae\\/g' \
36+
-e 's/MarioDevv\\\\Rex\\\\Facturae\\\\/PhpFacturae\\\\/g' \
37+
{} +
38+
39+
# 4. Update phpunit configs
40+
for f in phpunit.xml phpunit.local.xml; do
41+
if [ -f "$f" ]; then
42+
echo "Updating $f..."
43+
sed -i \
44+
-e 's|tests/Facturae|tests|g' \
45+
-e 's|src/Facturae|src|g' \
46+
"$f"
47+
fi
48+
done
49+
50+
echo ""
51+
echo "Done! New structure:"
52+
tree -I 'vendor|dist' src/ tests/
53+
echo ""
54+
echo "Remember to:"
55+
echo " 1. Replace composer.json with the new one"
56+
echo " 2. Run: composer dump-autoload"
57+
echo " 3. Run: composer test"

phpunit.local.xml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
cacheDirectory=".phpunit.cache"
6+
executionOrder="depends,defects"
7+
shortenArraysForExportThreshold="10"
8+
beStrictAboutCoverageMetadata="true"
9+
beStrictAboutOutputDuringTests="true"
10+
displayDetailsOnPhpunitDeprecations="true"
11+
failOnPhpunitDeprecation="true"
12+
failOnRisky="true"
13+
failOnWarning="true">
14+
15+
<testsuites>
16+
<testsuite name="Facturae">
17+
<directory>tests</directory>
18+
</testsuite>
19+
20+
<testsuite name="Verifactu">
21+
<directory>tests/Verifactu</directory>
22+
</testsuite>
23+
</testsuites>
24+
25+
<source>
26+
<include>
27+
<directory>src</directory>
28+
</include>
29+
</source>
30+
31+
<php>
32+
<env name="VERIFACTU_CERT_PATH" value="/home/mario/certs/certificado.pfx"/>
33+
<env name="VERIFACTU_CERT_PASS" value="contraseña"/>
34+
<env name="VERIFACTU_NIF" value="B76123456"/>
35+
<env name="VERIFACTU_NOMBRE" value="Atlantic Systems S.L."/>
36+
</php>
37+
38+
</phpunit>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44

5-
namespace MarioDevv\Rex\Facturae\Entities;
5+
namespace PhpFacturae\Entities;
66

7-
use MarioDevv\Rex\Facturae\Exceptions\InvalidPostalCodeException;
7+
use PhpFacturae\Exceptions\InvalidPostalCodeException;
88

99
final readonly class Address
1010
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace MarioDevv\Rex\Facturae\Entities;
5+
namespace PhpFacturae\Entities;
66

77
use RuntimeException;
88

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
namespace MarioDevv\Rex\Facturae\Entities;
5+
namespace PhpFacturae\Entities;
66

7-
use MarioDevv\Rex\Facturae\Enums\SpecialTaxableEvent;
8-
use MarioDevv\Rex\Facturae\Enums\UnitOfMeasure;
7+
use PhpFacturae\Enums\SpecialTaxableEvent;
8+
use PhpFacturae\Enums\UnitOfMeasure;
99

1010
final class Line
1111
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
declare(strict_types=1);
44

5-
namespace MarioDevv\Rex\Facturae\Entities;
5+
namespace PhpFacturae\Entities;
66

77
use DateTimeImmutable;
8-
use MarioDevv\Rex\Facturae\Enums\PaymentMethod;
8+
use PhpFacturae\Enums\PaymentMethod;
99

1010
final class Payment
1111
{
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
declare(strict_types=1);
44

5-
namespace MarioDevv\Rex\Facturae\Entities;
5+
namespace PhpFacturae\Entities;
66

7-
use MarioDevv\Rex\Facturae\Enums\Tax;
7+
use PhpFacturae\Enums\Tax;
88

99
final class TaxBreakdown
1010
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace MarioDevv\Rex\Facturae\Enums;
5+
namespace PhpFacturae\Enums;
66

77
enum CorrectionMethod: string
88
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace MarioDevv\Rex\Facturae\Enums;
5+
namespace PhpFacturae\Enums;
66

77
/**
88
* Motivo de correccion — valores cerrados del XSD FacturaE 3.2.2.

0 commit comments

Comments
 (0)