Skip to content

Commit

Permalink
R1
Browse files Browse the repository at this point in the history
R1 Working
  • Loading branch information
Jaime Cruz committed Sep 28, 2018
1 parent 3e01f0a commit ce48c9e
Show file tree
Hide file tree
Showing 121 changed files with 10,659 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
composer.phar
/vendor/

# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
# composer.lock
/nbproject/private/
/vendor/
27 changes: 27 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "jdelta/F72X",
"type": "library",
"description": "Modulo de facturación electrónica SUNAT UBL 2.1",
"keywords": ["SUNAT", "UBL 2.1", "Integración", "Factura Elctrónica PHP", "Firma digital", "XML"],
"homepage": "https://jdelta.github.io/F72X",
"license": "MIT",
"support": {
"issues": "https://github.com/jDelta/F72X/issues",
"source": "https://github.com/jDelta/F72X"
},
"authors": [
{"name": "Jaime Cruz", "email": "jaime@spacejx.com"}
],
"require": {
"php": "^5.6",
"sabre/xml": "^1.5",
"greenter/xmldsig": "^5.0",
"jdelta/php-string-max": "^1.0"
},
"autoload": {
"psr-4": {
"F72X\\": "src",
"Tests\\": "tests"
}
}
}
219 changes: 219 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions nbproject/project.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_create_2e_tests=false
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_enabled=false
auxiliary.org-netbeans-modules-php-phpunit.bootstrap_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.configuration_2e_enabled=true
auxiliary.org-netbeans-modules-php-phpunit.configuration_2e_path=phpunit.xml
auxiliary.org-netbeans-modules-php-phpunit.customSuite_2e_enabled=false
auxiliary.org-netbeans-modules-php-phpunit.customSuite_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.phpUnit_2e_enabled=false
auxiliary.org-netbeans-modules-php-phpunit.phpUnit_2e_path=
auxiliary.org-netbeans-modules-php-phpunit.test_2e_groups_2e_ask=false
auxiliary.org-netbeans-modules-php-phpunit.test_2e_run_2e_all=false
auxiliary.org-netbeans-modules-php-phpunit.test_2e_run_2e_phpunit_2e_only=false
file.reference.F72X-tests=tests
include.path=${php.global.include.path}
php.version=PHP_56
source.encoding=UTF-8
src.dir=.
tags.asp=false
tags.short=false
test.src.dir=${file.reference.F72X-tests}
testing.providers=PhpUnit
web.root=.
9 changes: 9 additions & 0 deletions nbproject/project.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.php.project</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/php-project/1">
<name>F72X</name>
</data>
</configuration>
</project>
15 changes: 15 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/5.6/phpunit.xsd"
backupGlobals="true"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php">
<testsuites>
<testsuite name="My Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<log type="testdox-text" target="tests/testdox.txt"/>
</logging>
</phpunit>
69 changes: 69 additions & 0 deletions src/Company.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?php

namespace F72X;

use F72X\Exception\ConfigException;

class Company {

/** @var array cache */
private static $_CONFIG;

/**
*
* Get Configuration Value
*
* @param string $key
* @return mixed
*/
private static function get($key) {
$value = null;
if (!self::$_CONFIG) {
throw new ConfigException();
}
if (isset(self::$_CONFIG[$key])) {
$value = self::$_CONFIG[$key];
}
if (is_null($value)) {
throw new ConfigException(sprintf('La propiedad %s no puede ser null, por favor revise su cofiguración', $key));
}
return $value;
}

public static function setConfig($config) {
self::$_CONFIG = $config;
}

public static function getRUC() {
return self::get('RUC');
}

public static function getCompanyName() {
return self::get('RAZON_SOCIAL');
}

public static function getBusinessName() {
return self::get('NOMBRE_COMERCIAL');
}

public static function getRegAddressCode() {
return self::get('CODIGO_DOMICILIO_FISCAL');
}

public static function getSolUser() {
return self::get('USUARIO_SOL');
}

public static function getSolKey() {
return self::get('CLAVE_SOL');
}

public static function getCertPath() {
return self::get('RUTA_CERTIFICADO');
}

public static function getRepositoryPath() {
return self::get('RUTA_REPOSITORIO');
}

}

0 comments on commit ce48c9e

Please sign in to comment.