Skip to content

Commit 8ccf79d

Browse files
authored
Merge pull request #182 from phpcr/show_nb_props
Show nb props
2 parents 46ddbec + da0e8d0 commit 8ccf79d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

features/all/phpcr_node_list.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Feature: List properites and chidren of current nodeA
141141
Then the command should not fail
142142
And I should see the following:
143143
"""
144-
5 nodes in set
144+
5 nodes, 0 properties in set
145145
"""
146146

147147
Scenario: List with sort order ascending

src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class NodeListCommand extends BasePhpcrCommand
3030
protected $textHelper;
3131
protected $maxLevel;
3232
protected $time;
33-
protected $nbNodes;
33+
protected $nbNodes = 0;
34+
protected $nbProperties = 0;
3435

3536
protected function configure()
3637
{
@@ -133,8 +134,9 @@ public function execute(InputInterface $input, OutputInterface $output)
133134

134135
if ($config['show_execution_time_list']) {
135136
$output->writeln(sprintf(
136-
'%s nodes in set (%s sec)',
137+
'%s nodes, %s properties in set (%s sec)',
137138
$this->nbNodes,
139+
$this->nbProperties,
138140
number_format($this->time, $config['execution_time_expansion']))
139141
);
140142
}
@@ -238,6 +240,7 @@ private function renderProperties($currentNode, $table, $spacers, $filter = null
238240

239241
$i = 0;
240242
foreach ($properties as $name => $property) {
243+
$this->nbProperties++;
241244
try {
242245
$i++;
243246
if (isset($propertyNames[$name])) {

0 commit comments

Comments
 (0)