poo

parents
<?php
namespace Sisoft\Contabilidad;
use Sisoft\Contabilidad\Inter\TipoContabilidad;
class Contabilidad implements TipoContabilidad
{
public function titulo()
{
return "Titulo de reporte";
}
public function datos()
{
return "2021-01-01";
}
public function informacion()
{
return array('datos' => $this->datos(), 'titulo' => $this->titulo());
}
}
\ No newline at end of file
<?php
namespace Sisoft\Contabilidad;
use Sisoft\Contabilidad\Inter\TipoContabilidad;
class ContabilidadOther implements TipoContabilidad
{
public function informacion()
{
return array('name' => 'yusleidy');
}
}
\ No newline at end of file
<?php
namespace Sisoft\Contabilidad\Inter;
interface TipoContabilidad
{
public function informacion();
}
<?php
namespace Sisoft\Reporte;
use Sisoft\Contabilidad\Inter\TipoContabilidad;
class ReporteExcel implements TipoReporte
{
public function formato(TipoContabilidad $reporte)
{
return 'ReporteExcel';
}
}
<?php
namespace Sisoft\Reporte;
use Sisoft\Contabilidad\Inter\TipoContabilidad;
class ReporteJson implements TipoReporte
{
public function formato(TipoContabilidad $reporte)
{
return json_encode($reporte->informacion());
}
}
\ No newline at end of file
<?php
namespace Sisoft\Reporte;
use Sisoft\Contabilidad\Inter\TipoContabilidad;
interface TipoReporte
{
public function formato(TipoContabilidad $reporte);
}
{
"name": "sisoft/x",
"authors": [
{
"name": "yusleidy",
"email": "yusleidybaquero@gmail.com"
}
],
"require": {},
"autoload": {
"psr-4": {
"Sisoft\\": "app"
}
}
}
<?php
use Sisoft\Reporte\ReporteJson;
use Sisoft\Contabilidad\Contabilidad;
require_once 'vendor/autoload.php';
/*$contabilidad = new Contabilidad;
$reporte = new ReporteExcel();
echo $reporte->formato($contabilidad);*/
$other = new Contabilidad();
$reporte = new ReporteJson();
echo $reporte->formato($other);
poo @ 97ba3342
Subproject commit 97ba334287b3b69f18635d82ee4da68701aee4c0
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit0ed22e6bff13d8c57af3a0574561cb6e::getLoader();
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
);
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname($vendorDir);
return array(
'Sisoft\\' => array($baseDir . '/app'),
);
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit0ed22e6bff13d8c57af3a0574561cb6e
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInit0ed22e6bff13d8c57af3a0574561cb6e', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInit0ed22e6bff13d8c57af3a0574561cb6e', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit0ed22e6bff13d8c57af3a0574561cb6e::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
return $loader;
}
}
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInit0ed22e6bff13d8c57af3a0574561cb6e
{
public static $prefixLengthsPsr4 = array (
'S' =>
array (
'Sisoft\\' => 7,
),
);
public static $prefixDirsPsr4 = array (
'Sisoft\\' =>
array (
0 => __DIR__ . '/../..' . '/app',
),
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit0ed22e6bff13d8c57af3a0574561cb6e::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit0ed22e6bff13d8c57af3a0574561cb6e::$prefixDirsPsr4;
}, null, ClassLoader::class);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment