0
I’m having trouble declaring a interface
to a classe
in the PHP
where I’m encapsulating the entire program with namespace
. I created a interface
calling for Yargle in the directory Cnab\Remessa
and set the functions for that interface. Then I created a class called Filing cabinet in the directory Cnab\Remessa\Cnab240
where when trying to declare the interface to class, there is an interface error not found.
INTERFACE
namespace Cnab\Remessa;
interface IArquivo {
public function obter_cabecalho(array $parametros);
public function obter_detalhes(array $parametros);
public function grava_texto($nome_do_arquivo);
}
CLASS
namespace Cnab\Remessa\Cnab240;
class Arquivo implements \Cnab\Remessa\IArquivo {
public function obter_cabecalho(array $parametros){}
public function obter_detalhes(array $parametros){}
public function grava_texto($nome_do_arquivo){}
}
If you are doing PDO? and follow a tutorial http://php.net/manual/en/class.pdo.php and do not use Pdo.
– KingRider
Using autoload? Your question needs more details. Are you using Poser? Are you using any custom autoload? Are the files included? How are you doing?
– Wallace Maxters
@Wallacemaxters, I am not using autoload, nor Composer. In this case it would be necessary to use these guys?
– Bruno Duarte
@Brunoduarte If you don’t want, you can use "include", but the project will be disorganized!
– Wallace Maxters
@Wallacemaxters yes true, recommend
include
orrequire
is depends statement.– KingRider