@@ -1,5 +1,5 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -class Cliente extends AppModel{ |
|
| 3 | +class Cliente extends AppModel { |
|
| 4 | 4 | |
| 5 | 5 | } |
| 6 | 6 | \ No newline at end of file |
@@ -2,13 +2,13 @@ |
||
| 2 | 2 | |
| 3 | 3 | class ModuloRelacionaUsuario extends AppModel { |
| 4 | 4 | public $belongsTo = array ( |
| 5 | - 'Usuario' => array ( |
|
| 6 | - 'className' => 'Usuario' , |
|
| 7 | - 'foreignKey' => 'id_usuario' |
|
| 8 | - ), |
|
| 9 | - 'Modulo' => array( |
|
| 10 | - 'className' => 'Modulo', |
|
| 11 | - 'foreignKey' => 'id_modulo' |
|
| 12 | - ) |
|
| 13 | - ); |
|
| 5 | + 'Usuario' => array ( |
|
| 6 | + 'className' => 'Usuario' , |
|
| 7 | + 'foreignKey' => 'id_usuario' |
|
| 8 | + ), |
|
| 9 | + 'Modulo' => array( |
|
| 10 | + 'className' => 'Modulo', |
|
| 11 | + 'foreignKey' => 'id_modulo' |
|
| 12 | + ) |
|
| 13 | + ); |
|
| 14 | 14 | } |
| 15 | 15 | \ No newline at end of file |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | class ModuloRelacionaUsuario extends AppModel { |
| 4 | - public $belongsTo = array ( |
|
| 5 | - 'Usuario' => array ( |
|
| 6 | - 'className' => 'Usuario' , |
|
| 4 | + public $belongsTo = array( |
|
| 5 | + 'Usuario' => array( |
|
| 6 | + 'className' => 'Usuario', |
|
| 7 | 7 | 'foreignKey' => 'id_usuario' |
| 8 | 8 | ), |
| 9 | 9 | 'Modulo' => array( |
@@ -5,9 +5,9 @@ |
||
| 5 | 5 | */ |
| 6 | 6 | class Venda extends AppModel { |
| 7 | 7 | public $belongsTo = array ( |
| 8 | - 'VendaItensProduto' => array ( |
|
| 9 | - 'className' => 'VendaItensProduto', |
|
| 10 | - 'foreignKey' => 'venda_id' |
|
| 11 | - ) |
|
| 12 | - ); |
|
| 8 | + 'VendaItensProduto' => array ( |
|
| 9 | + 'className' => 'VendaItensProduto', |
|
| 10 | + 'foreignKey' => 'venda_id' |
|
| 11 | + ) |
|
| 12 | + ); |
|
| 13 | 13 | } |
| 14 | 14 | \ No newline at end of file |
@@ -4,8 +4,8 @@ |
||
| 4 | 4 | * Model de venda |
| 5 | 5 | */ |
| 6 | 6 | class Venda extends AppModel { |
| 7 | - public $belongsTo = array ( |
|
| 8 | - 'VendaItensProduto' => array ( |
|
| 7 | + public $belongsTo = array( |
|
| 8 | + 'VendaItensProduto' => array( |
|
| 9 | 9 | 'className' => 'VendaItensProduto', |
| 10 | 10 | 'foreignKey' => 'venda_id' |
| 11 | 11 | ) |
@@ -9,12 +9,12 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class ApiControllerTest extends PHPUnit_Framework_TestCase |
| 11 | 11 | { |
| 12 | - protected $api; |
|
| 12 | + protected $api; |
|
| 13 | 13 | |
| 14 | - public function setUp() |
|
| 15 | - { |
|
| 16 | - $this->api = new ApiController; |
|
| 17 | - } |
|
| 14 | + public function setUp() |
|
| 15 | + { |
|
| 16 | + $this->api = new ApiController; |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | 19 | public function testWishlist() |
| 20 | 20 | { |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -require(APP . 'Controller/AppController.php'); |
|
| 5 | -require(APP . 'Controller/ApiController.php'); |
|
| 4 | +require(APP.'Controller/AppController.php'); |
|
| 5 | +require(APP.'Controller/ApiController.php'); |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * ApiControllerTest |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | class AviseMeControllerTest extends ControllerTestCase |
| 9 | 9 | { |
| 10 | 10 | |
| 11 | - public $controllers = array('app.aviseme'); |
|
| 11 | + public $controllers = array('app.aviseme'); |
|
| 12 | 12 | |
| 13 | 13 | protected $AviseMe; |
| 14 | 14 | |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * @test view listar cadastros |
|
| 22 | - **/ |
|
| 21 | + * @test view listar cadastros |
|
| 22 | + **/ |
|
| 23 | 23 | public function testViewListarCadastros() |
| 24 | 24 | { |
| 25 | 25 | $result = $this->testAction('/aviseme/listar_cadastros'); |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
| 30 | - * @test post Test function to create list aviseme |
|
| 31 | - **/ |
|
| 30 | + * @test post Test function to create list aviseme |
|
| 31 | + **/ |
|
| 32 | 32 | public function testPostMailAndProductToCreateOfAviseMe() |
| 33 | 33 | { |
| 34 | 34 | $data = array( |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -require(APP . 'Controller/AviseMeController.php'); |
|
| 3 | +require(APP.'Controller/AviseMeController.php'); |
|
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | 6 | * |
@@ -9,130 +9,130 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class PagamentoControllerTest extends PHPUnit_Framework_TestCase |
| 11 | 11 | { |
| 12 | - protected $pagamento; |
|
| 13 | - |
|
| 14 | - public function testInstanciaClassePagamentoComPagSeguro() |
|
| 15 | - { |
|
| 16 | - $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 17 | - } |
|
| 18 | - |
|
| 19 | - public function testSetAndGetTokenPagSeguro() |
|
| 20 | - { |
|
| 21 | - $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 22 | - |
|
| 23 | - $this->pagamento->setToken('25AB84E7DE7647848D0819210140F79D'); |
|
| 24 | - |
|
| 25 | - $this->assertEquals('25AB84E7DE7647848D0819210140F79D', $this->pagamento->getToken()); |
|
| 26 | - } |
|
| 27 | - |
|
| 28 | - public function testSetAndGetEmailPagSeguro() |
|
| 29 | - { |
|
| 30 | - $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 31 | - |
|
| 32 | - $this->pagamento->setEmail('[email protected]'); |
|
| 33 | - |
|
| 34 | - $this->assertEquals('[email protected]', $this->pagamento->getEmail()); |
|
| 35 | - } |
|
| 36 | - |
|
| 37 | - public function testSetOneNewProductInListPagSeguro() |
|
| 38 | - { |
|
| 39 | - $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 40 | - |
|
| 41 | - $produto = array( |
|
| 42 | - 0 => array( |
|
| 43 | - 'Produto' => array( |
|
| 44 | - 'id' => 23, |
|
| 45 | - 'nome' => 'Produto Teste', |
|
| 46 | - 'variacao' => 'M', |
|
| 47 | - 'quantidade' => 2, |
|
| 48 | - 'preco' => 2.44 |
|
| 49 | - ) |
|
| 50 | - ) |
|
| 51 | - ); |
|
| 52 | - |
|
| 53 | - $this->pagamento->setProdutos($produto); |
|
| 54 | - $this->assertEquals($produto, $this->pagamento->adicionarProdutosGateway()); |
|
| 55 | - } |
|
| 56 | - |
|
| 57 | - public function testSetAndressFromClientPagseguro() |
|
| 58 | - { |
|
| 59 | - $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 60 | - |
|
| 61 | - $endereco = array( |
|
| 62 | - 'cep' => '07252-000', |
|
| 63 | - 'endereco' => 'Avenida do Contorno', |
|
| 64 | - 'numero' => 19, |
|
| 65 | - 'complemento' => 'Viela', |
|
| 66 | - 'bairro' => 'Nova cidade', |
|
| 67 | - 'cidade' => 'Guarulhos', |
|
| 68 | - 'estado' => 'SP' |
|
| 69 | - ); |
|
| 70 | - |
|
| 71 | - $this->pagamento->setEndereco($endereco); |
|
| 72 | - $this->assertEquals($endereco, $this->pagamento->getEndereco()); |
|
| 73 | - } |
|
| 74 | - |
|
| 75 | - public function testSetCliente() |
|
| 76 | - { |
|
| 77 | - $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 78 | - |
|
| 79 | - $cliente = array( |
|
| 80 | - 'nome' => 'Reginaldo Junior', |
|
| 81 | - 'email' => '[email protected]', |
|
| 82 | - 'ddd' => '11', |
|
| 83 | - 'telefone' => '946640932', |
|
| 84 | - 'cpf' => '43944409843' |
|
| 85 | - ); |
|
| 86 | - |
|
| 87 | - $this->pagamento->setCliente($cliente); |
|
| 88 | - $this->assertEquals($cliente, $this->pagamento->setClienteGateway()); |
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - public function testPedido() |
|
| 92 | - { |
|
| 93 | - $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 94 | - |
|
| 95 | - $this->pagamento->setToken('25AB84E7DE7647848D0819210140F79D'); |
|
| 96 | - $this->pagamento->setEmail('[email protected]'); |
|
| 12 | + protected $pagamento; |
|
| 13 | + |
|
| 14 | + public function testInstanciaClassePagamentoComPagSeguro() |
|
| 15 | + { |
|
| 16 | + $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 17 | + } |
|
| 18 | + |
|
| 19 | + public function testSetAndGetTokenPagSeguro() |
|
| 20 | + { |
|
| 21 | + $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 22 | + |
|
| 23 | + $this->pagamento->setToken('25AB84E7DE7647848D0819210140F79D'); |
|
| 24 | + |
|
| 25 | + $this->assertEquals('25AB84E7DE7647848D0819210140F79D', $this->pagamento->getToken()); |
|
| 26 | + } |
|
| 27 | + |
|
| 28 | + public function testSetAndGetEmailPagSeguro() |
|
| 29 | + { |
|
| 30 | + $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 31 | + |
|
| 32 | + $this->pagamento->setEmail('[email protected]'); |
|
| 33 | + |
|
| 34 | + $this->assertEquals('[email protected]', $this->pagamento->getEmail()); |
|
| 35 | + } |
|
| 36 | + |
|
| 37 | + public function testSetOneNewProductInListPagSeguro() |
|
| 38 | + { |
|
| 39 | + $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 40 | + |
|
| 41 | + $produto = array( |
|
| 42 | + 0 => array( |
|
| 43 | + 'Produto' => array( |
|
| 44 | + 'id' => 23, |
|
| 45 | + 'nome' => 'Produto Teste', |
|
| 46 | + 'variacao' => 'M', |
|
| 47 | + 'quantidade' => 2, |
|
| 48 | + 'preco' => 2.44 |
|
| 49 | + ) |
|
| 50 | + ) |
|
| 51 | + ); |
|
| 52 | + |
|
| 53 | + $this->pagamento->setProdutos($produto); |
|
| 54 | + $this->assertEquals($produto, $this->pagamento->adicionarProdutosGateway()); |
|
| 55 | + } |
|
| 56 | + |
|
| 57 | + public function testSetAndressFromClientPagseguro() |
|
| 58 | + { |
|
| 59 | + $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 60 | + |
|
| 61 | + $endereco = array( |
|
| 62 | + 'cep' => '07252-000', |
|
| 63 | + 'endereco' => 'Avenida do Contorno', |
|
| 64 | + 'numero' => 19, |
|
| 65 | + 'complemento' => 'Viela', |
|
| 66 | + 'bairro' => 'Nova cidade', |
|
| 67 | + 'cidade' => 'Guarulhos', |
|
| 68 | + 'estado' => 'SP' |
|
| 69 | + ); |
|
| 70 | + |
|
| 71 | + $this->pagamento->setEndereco($endereco); |
|
| 72 | + $this->assertEquals($endereco, $this->pagamento->getEndereco()); |
|
| 73 | + } |
|
| 74 | + |
|
| 75 | + public function testSetCliente() |
|
| 76 | + { |
|
| 77 | + $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 78 | + |
|
| 79 | + $cliente = array( |
|
| 80 | + 'nome' => 'Reginaldo Junior', |
|
| 81 | + 'email' => '[email protected]', |
|
| 82 | + 'ddd' => '11', |
|
| 83 | + 'telefone' => '946640932', |
|
| 84 | + 'cpf' => '43944409843' |
|
| 85 | + ); |
|
| 86 | + |
|
| 87 | + $this->pagamento->setCliente($cliente); |
|
| 88 | + $this->assertEquals($cliente, $this->pagamento->setClienteGateway()); |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + public function testPedido() |
|
| 92 | + { |
|
| 93 | + $this->pagamento = new PagamentoController('PagseguroController'); |
|
| 94 | + |
|
| 95 | + $this->pagamento->setToken('25AB84E7DE7647848D0819210140F79D'); |
|
| 96 | + $this->pagamento->setEmail('[email protected]'); |
|
| 97 | 97 | |
| 98 | - $produto = array( |
|
| 99 | - 0 => array( |
|
| 100 | - 'Produto' => array( |
|
| 101 | - 'id' => 23, |
|
| 102 | - 'nome' => 'Produto Teste', |
|
| 103 | - 'variacao' => 'M', |
|
| 104 | - 'quantidade' => 1.00, |
|
| 105 | - 'preco' => 2.44 |
|
| 106 | - ) |
|
| 107 | - ) |
|
| 108 | - ); |
|
| 109 | - $this->pagamento->setProdutos($produto); |
|
| 110 | - $this->pagamento->adicionarProdutosGateway(); |
|
| 111 | - |
|
| 112 | - $endereco = array( |
|
| 113 | - 'cep' => '07252-000', |
|
| 114 | - 'endereco' => 'Avenida do Contorno', |
|
| 115 | - 'numero' => 19, |
|
| 116 | - 'complemento' => 'Viela', |
|
| 117 | - 'bairro' => 'Nova cidade', |
|
| 118 | - 'cidade' => 'Guarulhos', |
|
| 119 | - 'estado' => 'SP' |
|
| 120 | - ); |
|
| 121 | - $this->pagamento->setEndereco($endereco); |
|
| 122 | - |
|
| 123 | - |
|
| 124 | - $cliente = array( |
|
| 125 | - 'nome' => 'Reginaldo Junior', |
|
| 126 | - 'email' => '[email protected]', |
|
| 127 | - 'ddd' => '11', |
|
| 128 | - 'telefone' => '946640932', |
|
| 129 | - 'cpf' => '43944409843' |
|
| 130 | - ); |
|
| 131 | - $this->pagamento->setCliente($cliente); |
|
| 132 | - |
|
| 133 | - $this->pagamento->setReference('#2324'); |
|
| 134 | - $this->pagamento->setValorFrete(23.44); |
|
| 135 | - |
|
| 136 | - // $this->pagamento->finalizarPedido(); |
|
| 137 | - } |
|
| 98 | + $produto = array( |
|
| 99 | + 0 => array( |
|
| 100 | + 'Produto' => array( |
|
| 101 | + 'id' => 23, |
|
| 102 | + 'nome' => 'Produto Teste', |
|
| 103 | + 'variacao' => 'M', |
|
| 104 | + 'quantidade' => 1.00, |
|
| 105 | + 'preco' => 2.44 |
|
| 106 | + ) |
|
| 107 | + ) |
|
| 108 | + ); |
|
| 109 | + $this->pagamento->setProdutos($produto); |
|
| 110 | + $this->pagamento->adicionarProdutosGateway(); |
|
| 111 | + |
|
| 112 | + $endereco = array( |
|
| 113 | + 'cep' => '07252-000', |
|
| 114 | + 'endereco' => 'Avenida do Contorno', |
|
| 115 | + 'numero' => 19, |
|
| 116 | + 'complemento' => 'Viela', |
|
| 117 | + 'bairro' => 'Nova cidade', |
|
| 118 | + 'cidade' => 'Guarulhos', |
|
| 119 | + 'estado' => 'SP' |
|
| 120 | + ); |
|
| 121 | + $this->pagamento->setEndereco($endereco); |
|
| 122 | + |
|
| 123 | + |
|
| 124 | + $cliente = array( |
|
| 125 | + 'nome' => 'Reginaldo Junior', |
|
| 126 | + 'email' => '[email protected]', |
|
| 127 | + 'ddd' => '11', |
|
| 128 | + 'telefone' => '946640932', |
|
| 129 | + 'cpf' => '43944409843' |
|
| 130 | + ); |
|
| 131 | + $this->pagamento->setCliente($cliente); |
|
| 132 | + |
|
| 133 | + $this->pagamento->setReference('#2324'); |
|
| 134 | + $this->pagamento->setValorFrete(23.44); |
|
| 135 | + |
|
| 136 | + // $this->pagamento->finalizarPedido(); |
|
| 137 | + } |
|
| 138 | 138 | } |
| 139 | 139 | \ No newline at end of file |
@@ -1,8 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | |
| 4 | -require(APP . 'Controller/AppController.php'); |
|
| 5 | -require(APP . 'Controller/PagamentoController.php'); |
|
| 4 | +require(APP.'Controller/AppController.php'); |
|
| 5 | +require(APP.'Controller/PagamentoController.php'); |
|
| 6 | 6 | |
| 7 | 7 | /** |
| 8 | 8 | * PagamentoControllerTest |
@@ -29,7 +29,7 @@ |
||
| 29 | 29 | PHPExcel_Shared_ZipStreamWrapper::register(); |
| 30 | 30 | // check mbstring.func_overload |
| 31 | 31 | if (ini_get('mbstring.func_overload') & 2) { |
| 32 | - throw new Exception('Multibyte function overloading in PHP must be disabled for string functions (2).'); |
|
| 32 | + throw new Exception('Multibyte function overloading in PHP must be disabled for string functions (2).'); |
|
| 33 | 33 | } |
| 34 | 34 | PHPExcel_Shared_String::buildCharacterSets(); |
| 35 | 35 | |
@@ -62,14 +62,14 @@ |
||
| 62 | 62 | * |
| 63 | 63 | * @param string $pClassName Name of the object to load |
| 64 | 64 | */ |
| 65 | - public static function Load($pClassName){ |
|
| 65 | + public static function Load($pClassName) { |
|
| 66 | 66 | if ((class_exists($pClassName)) || (strpos($pClassName, 'PHPExcel') !== 0)) { |
| 67 | 67 | // Either already loaded, or not a PHPExcel class request |
| 68 | 68 | return FALSE; |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | - $pObjectFilePath = PHPEXCEL_ROOT . |
|
| 72 | - str_replace('_',DIRECTORY_SEPARATOR,$pClassName) . |
|
| 71 | + $pObjectFilePath = PHPEXCEL_ROOT. |
|
| 72 | + str_replace('_', DIRECTORY_SEPARATOR, $pClassName). |
|
| 73 | 73 | '.php'; |
| 74 | 74 | |
| 75 | 75 | if ((file_exists($pObjectFilePath) === false) || (is_readable($pObjectFilePath) === false)) { |
@@ -52,14 +52,14 @@ discard block |
||
| 52 | 52 | private $_cacheTime = 600; |
| 53 | 53 | |
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * Store cell data in cache for the current cell object if it's "dirty", |
|
| 57 | - * and the 'nullify' the current cell object |
|
| 58 | - * |
|
| 55 | + /** |
|
| 56 | + * Store cell data in cache for the current cell object if it's "dirty", |
|
| 57 | + * and the 'nullify' the current cell object |
|
| 58 | + * |
|
| 59 | 59 | * @access private |
| 60 | 60 | * @return void |
| 61 | - * @throws Exception |
|
| 62 | - */ |
|
| 61 | + * @throws Exception |
|
| 62 | + */ |
|
| 63 | 63 | private function _storeData() { |
| 64 | 64 | if ($this->_currentCellIsDirty) { |
| 65 | 65 | $this->_currentObject->detach(); |
@@ -74,15 +74,15 @@ discard block |
||
| 74 | 74 | } // function _storeData() |
| 75 | 75 | |
| 76 | 76 | |
| 77 | - /** |
|
| 78 | - * Add or Update a cell in cache identified by coordinate address |
|
| 79 | - * |
|
| 77 | + /** |
|
| 78 | + * Add or Update a cell in cache identified by coordinate address |
|
| 79 | + * |
|
| 80 | 80 | * @access public |
| 81 | - * @param string $pCoord Coordinate address of the cell to update |
|
| 82 | - * @param PHPExcel_Cell $cell Cell to update |
|
| 81 | + * @param string $pCoord Coordinate address of the cell to update |
|
| 82 | + * @param PHPExcel_Cell $cell Cell to update |
|
| 83 | 83 | * @return void |
| 84 | - * @throws Exception |
|
| 85 | - */ |
|
| 84 | + * @throws Exception |
|
| 85 | + */ |
|
| 86 | 86 | public function addCacheData($pCoord, PHPExcel_Cell $cell) { |
| 87 | 87 | if (($pCoord !== $this->_currentObjectID) && ($this->_currentObjectID !== null)) { |
| 88 | 88 | $this->_storeData(); |
@@ -124,14 +124,14 @@ discard block |
||
| 124 | 124 | } // function isDataSet() |
| 125 | 125 | |
| 126 | 126 | |
| 127 | - /** |
|
| 128 | - * Get cell at a specific coordinate |
|
| 129 | - * |
|
| 127 | + /** |
|
| 128 | + * Get cell at a specific coordinate |
|
| 129 | + * |
|
| 130 | 130 | * @access public |
| 131 | - * @param string $pCoord Coordinate of the cell |
|
| 132 | - * @throws Exception |
|
| 133 | - * @return PHPExcel_Cell Cell that was found, or null if not found |
|
| 134 | - */ |
|
| 131 | + * @param string $pCoord Coordinate of the cell |
|
| 132 | + * @throws Exception |
|
| 133 | + * @return PHPExcel_Cell Cell that was found, or null if not found |
|
| 134 | + */ |
|
| 135 | 135 | public function getCacheData($pCoord) { |
| 136 | 136 | if ($pCoord === $this->_currentObjectID) { |
| 137 | 137 | return $this->_currentObject; |
@@ -162,13 +162,13 @@ discard block |
||
| 162 | 162 | } // function getCacheData() |
| 163 | 163 | |
| 164 | 164 | |
| 165 | - /** |
|
| 166 | - * Delete a cell in cache identified by coordinate address |
|
| 167 | - * |
|
| 165 | + /** |
|
| 166 | + * Delete a cell in cache identified by coordinate address |
|
| 167 | + * |
|
| 168 | 168 | * @access public |
| 169 | - * @param string $pCoord Coordinate address of the cell to delete |
|
| 170 | - * @throws Exception |
|
| 171 | - */ |
|
| 169 | + * @param string $pCoord Coordinate address of the cell to delete |
|
| 170 | + * @throws Exception |
|
| 171 | + */ |
|
| 172 | 172 | public function deleteCacheData($pCoord) { |
| 173 | 173 | // Delete the entry from APC |
| 174 | 174 | apc_delete($this->_cachePrefix.$pCoord.'.cache'); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | if ($this->_currentCellIsDirty) { |
| 65 | 65 | $this->_currentObject->detach(); |
| 66 | 66 | |
| 67 | - if (!apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache',serialize($this->_currentObject),$this->_cacheTime)) { |
|
| 67 | + if ( ! apc_store($this->_cachePrefix.$this->_currentObjectID.'.cache', serialize($this->_currentObject), $this->_cacheTime)) { |
|
| 68 | 68 | $this->__destruct(); |
| 69 | 69 | throw new Exception('Failed to store cell '.$this->_currentObjectID.' in APC'); |
| 70 | 70 | } |
@@ -189,9 +189,9 @@ discard block |
||
| 189 | 189 | parent::copyCellCollection($parent); |
| 190 | 190 | // Get a new id for the new file name |
| 191 | 191 | $baseUnique = $this->_getUniqueID(); |
| 192 | - $newCachePrefix = substr(md5($baseUnique),0,8).'.'; |
|
| 192 | + $newCachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
| 193 | 193 | $cacheList = $this->getCellList(); |
| 194 | - foreach($cacheList as $cellID) { |
|
| 194 | + foreach ($cacheList as $cellID) { |
|
| 195 | 195 | if ($cellID != $this->_currentObjectID) { |
| 196 | 196 | $obj = apc_fetch($this->_cachePrefix.$cellID.'.cache'); |
| 197 | 197 | if ($obj === false) { |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | parent::deleteCacheData($cellID); |
| 200 | 200 | throw new Exception('Cell entry '.$cellID.' no longer exists in APC'); |
| 201 | 201 | } |
| 202 | - if (!apc_store($newCachePrefix.$cellID.'.cache',$obj,$this->_cacheTime)) { |
|
| 202 | + if ( ! apc_store($newCachePrefix.$cellID.'.cache', $obj, $this->_cacheTime)) { |
|
| 203 | 203 | $this->__destruct(); |
| 204 | 204 | throw new Exception('Failed to store cell '.$cellID.' in APC'); |
| 205 | 205 | } |
@@ -239,11 +239,11 @@ discard block |
||
| 239 | 239 | * @param array of mixed $arguments Additional initialisation arguments |
| 240 | 240 | */ |
| 241 | 241 | public function __construct(PHPExcel_Worksheet $parent, $arguments) { |
| 242 | - $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; |
|
| 242 | + $cacheTime = (isset($arguments['cacheTime'])) ? $arguments['cacheTime'] : 600; |
|
| 243 | 243 | |
| 244 | 244 | if ($this->_cachePrefix === NULL) { |
| 245 | 245 | $baseUnique = $this->_getUniqueID(); |
| 246 | - $this->_cachePrefix = substr(md5($baseUnique),0,8).'.'; |
|
| 246 | + $this->_cachePrefix = substr(md5($baseUnique), 0, 8).'.'; |
|
| 247 | 247 | $this->_cacheTime = $cacheTime; |
| 248 | 248 | |
| 249 | 249 | parent::__construct($parent); |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | */ |
| 259 | 259 | public function __destruct() { |
| 260 | 260 | $cacheList = $this->getCellList(); |
| 261 | - foreach($cacheList as $cellID) { |
|
| 261 | + foreach ($cacheList as $cellID) { |
|
| 262 | 262 | apc_delete($this->_cachePrefix.$cellID.'.cache'); |
| 263 | 263 | } |
| 264 | 264 | } // function __destruct() |
@@ -272,7 +272,7 @@ discard block |
||
| 272 | 272 | * @return boolean |
| 273 | 273 | */ |
| 274 | 274 | public static function cacheMethodIsAvailable() { |
| 275 | - if (!function_exists('apc_store')) { |
|
| 275 | + if ( ! function_exists('apc_store')) { |
|
| 276 | 276 | return false; |
| 277 | 277 | } |
| 278 | 278 | if (apc_sma_info() === false) { |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | * |
| 87 | 87 | * @param string $pCoord Coordinate address of the cell to update |
| 88 | 88 | * @param PHPExcel_Cell $cell Cell to update |
| 89 | - * @return void |
|
| 89 | + * @return PHPExcel_Cell |
|
| 90 | 90 | * @throws Exception |
| 91 | 91 | */ |
| 92 | 92 | public function addCacheData($pCoord, PHPExcel_Cell $cell) { |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | * Is a value set in the current PHPExcel_CachedObjectStorage_ICache for an indexed cell? |
| 108 | 108 | * |
| 109 | 109 | * @param string $pCoord Coordinate address of the cell to check |
| 110 | - * @return void |
|
| 110 | + * @return boolean |
|
| 111 | 111 | * @return boolean |
| 112 | 112 | */ |
| 113 | 113 | public function isDataSet($pCoord) { |
@@ -101,24 +101,24 @@ |
||
| 101 | 101 | } // function isDataSet() |
| 102 | 102 | |
| 103 | 103 | |
| 104 | - /** |
|
| 105 | - * Add or Update a cell in cache |
|
| 106 | - * |
|
| 107 | - * @param PHPExcel_Cell $cell Cell to update |
|
| 104 | + /** |
|
| 105 | + * Add or Update a cell in cache |
|
| 106 | + * |
|
| 107 | + * @param PHPExcel_Cell $cell Cell to update |
|
| 108 | 108 | * @return void |
| 109 | - * @throws Exception |
|
| 110 | - */ |
|
| 109 | + * @throws Exception |
|
| 110 | + */ |
|
| 111 | 111 | public function updateCacheData(PHPExcel_Cell $cell) { |
| 112 | 112 | return $this->addCacheData($cell->getCoordinate(),$cell); |
| 113 | 113 | } // function updateCacheData() |
| 114 | 114 | |
| 115 | 115 | |
| 116 | - /** |
|
| 117 | - * Delete a cell in cache identified by coordinate address |
|
| 118 | - * |
|
| 119 | - * @param string $pCoord Coordinate address of the cell to delete |
|
| 120 | - * @throws Exception |
|
| 121 | - */ |
|
| 116 | + /** |
|
| 117 | + * Delete a cell in cache identified by coordinate address |
|
| 118 | + * |
|
| 119 | + * @param string $pCoord Coordinate address of the cell to delete |
|
| 120 | + * @throws Exception |
|
| 121 | + */ |
|
| 122 | 122 | public function deleteCacheData($pCoord) { |
| 123 | 123 | if ($pCoord === $this->_currentObjectID) { |
| 124 | 124 | $this->_currentObject->detach(); |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | * @throws Exception |
| 110 | 110 | */ |
| 111 | 111 | public function updateCacheData(PHPExcel_Cell $cell) { |
| 112 | - return $this->addCacheData($cell->getCoordinate(),$cell); |
|
| 112 | + return $this->addCacheData($cell->getCoordinate(), $cell); |
|
| 113 | 113 | } // function updateCacheData() |
| 114 | 114 | |
| 115 | 115 | |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | public function getSortedCellList() { |
| 152 | 152 | $sortKeys = array(); |
| 153 | 153 | foreach ($this->getCellList() as $coord) { |
| 154 | - list($column,$row) = sscanf($coord,'%[A-Z]%d'); |
|
| 155 | - $sortKeys[sprintf('%09d%3s',$row,$column)] = $coord; |
|
| 154 | + list($column, $row) = sscanf($coord, '%[A-Z]%d'); |
|
| 155 | + $sortKeys[sprintf('%09d%3s', $row, $column)] = $coord; |
|
| 156 | 156 | } |
| 157 | 157 | ksort($sortKeys); |
| 158 | 158 | |
@@ -172,16 +172,16 @@ discard block |
||
| 172 | 172 | $col = array('A' => '1A'); |
| 173 | 173 | $row = array(1); |
| 174 | 174 | foreach ($this->getCellList() as $coord) { |
| 175 | - list($c,$r) = sscanf($coord,'%[A-Z]%d'); |
|
| 175 | + list($c, $r) = sscanf($coord, '%[A-Z]%d'); |
|
| 176 | 176 | $row[$r] = $r; |
| 177 | 177 | $col[$c] = strlen($c).$c; |
| 178 | 178 | } |
| 179 | - if (!empty($row)) { |
|
| 179 | + if ( ! empty($row)) { |
|
| 180 | 180 | // Determine highest column and row |
| 181 | 181 | $highestRow = max($row); |
| 182 | - $highestColumn = substr(max($col),1); |
|
| 182 | + $highestColumn = substr(max($col), 1); |
|
| 183 | 183 | } |
| 184 | - return array( 'row' => $highestRow, |
|
| 184 | + return array('row' => $highestRow, |
|
| 185 | 185 | 'column' => $highestColumn |
| 186 | 186 | ); |
| 187 | 187 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | } else { |
| 222 | 222 | $baseUnique = mt_rand(); |
| 223 | 223 | } |
| 224 | - return uniqid($baseUnique,true); |
|
| 224 | + return uniqid($baseUnique, true); |
|
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | /** |