From da0e8d0c7e1b3db178aaca03459bb78c3178835f Mon Sep 17 00:00:00 2001 From: dantleech Date: Tue, 23 Aug 2016 16:30:18 +0100 Subject: [PATCH] Show nb props --- features/all/phpcr_node_list.feature | 2 +- src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/features/all/phpcr_node_list.feature b/features/all/phpcr_node_list.feature index 986a1cd7..39897518 100644 --- a/features/all/phpcr_node_list.feature +++ b/features/all/phpcr_node_list.feature @@ -141,7 +141,7 @@ Feature: List properites and chidren of current nodeA Then the command should not fail And I should see the following: """ - 5 nodes in set + 5 nodes, 0 properties in set """ Scenario: List with sort order ascending diff --git a/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php b/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php index a04cff70..4c3a3a60 100644 --- a/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php +++ b/src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php @@ -30,7 +30,8 @@ class NodeListCommand extends BasePhpcrCommand protected $textHelper; protected $maxLevel; protected $time; - protected $nbNodes; + protected $nbNodes = 0; + protected $nbProperties = 0; protected function configure() { @@ -133,8 +134,9 @@ public function execute(InputInterface $input, OutputInterface $output) if ($config['show_execution_time_list']) { $output->writeln(sprintf( - '%s nodes in set (%s sec)', + '%s nodes, %s properties in set (%s sec)', $this->nbNodes, + $this->nbProperties, number_format($this->time, $config['execution_time_expansion'])) ); } @@ -238,6 +240,7 @@ private function renderProperties($currentNode, $table, $spacers, $filter = null $i = 0; foreach ($properties as $name => $property) { + $this->nbProperties++; try { $i++; if (isset($propertyNames[$name])) {