Skip to content

Show nb props #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/all/phpcr_node_list.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down Expand Up @@ -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']))
);
}
Expand Down Expand Up @@ -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])) {
Expand Down