for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Mage Scan
*
* PHP version 5
* @category MageScan
* @package MageScan
* @author Steve Robbins <[email protected]>
* @copyright 2015 Steve Robbins
* @license http://creativecommons.org/licenses/by/4.0/ CC BY 4.0
* @link https://github.com/steverobbins/magescan
*/
namespace MageScan\Command\Scan;
use MageScan\Check\Catalog;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
* Scan catalog command
class CatalogCommand extends AbstractCommand
{
* Configure command
* @return void
protected function configure()
$this
->setName('scan:catalog')
->setDescription('Get catalog information');
parent::configure();
}
* Execute command
* @param InputInterface $input
* @param OutputInterface $output
protected function execute(InputInterface $input, OutputInterface $output)
$rows = [];
$catalog = new Catalog;
$catalog->setRequest($this->request);
$categoryCount = $catalog->categoryCount();
$rows[] = [
'Categories',
$categoryCount !== false ? $categoryCount : 'Unknown'
];
$productCount = $catalog->productCount();
'Products',
$productCount !== false ? $productCount : 'Unknown'
$this->out('Catalog Information', [[
'type' => 'table',
'data' => [
['Type', 'Count'],
$rows
]
]]);