Skip to content

Apply fixes from StyleCI #213

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
May 2, 2022
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
4 changes: 3 additions & 1 deletion spec/PHPCR/Shell/Event/ProfileInitEventSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public function let(
OutputInterface $output
) {
$this->beConstructedWith(
$profile, $input, $output
$profile,
$input,
$output
);
}

Expand Down
5 changes: 3 additions & 2 deletions spec/PHPCR/Shell/Serializer/YamlEncoderSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ public function it_is_initializable()
public function it_should_encode_to_yaml()
{
$data = ['foobar' => 'barfoo', 'barfoo' => 'foobar'];
$this->encode($data, 'yaml')->shouldReturn(<<<'EOT'
$this->encode($data, 'yaml')->shouldReturn(
<<<'EOT'
foobar: barfoo
barfoo: foobar

EOT
);
);
}

public function is_should_decode_yaml()
Expand Down
6 changes: 4 additions & 2 deletions src/PHPCR/Shell/Config/Profile.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ protected function validateDomain($domain)
if (!array_key_exists($domain, $this->profile)) {
throw new \InvalidArgumentException(sprintf(
'Unknown profile domain "%s", can only use one of: %s',
$domain, implode(', ', array_keys($this->profile))
$domain,
implode(', ', array_keys($this->profile))
));
}
}
Expand Down Expand Up @@ -87,7 +88,8 @@ public function get($domain, $key = null)
if (!isset($this->profile[$domain][$key])) {
throw new \InvalidArgumentException(sprintf(
'Unknown key "%s" for profile domain "%s"',
$key, $domain
$key,
$domain
));
}

Expand Down
9 changes: 6 additions & 3 deletions src/PHPCR/Shell/Config/ProfileLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ public function loadProfile(Profile $profile)
$path = $this->getProfilePath($profile->getName());

if (!file_exists($path)) {
throw new \InvalidArgumentException(sprintf('Profile "%s" does not exist, expected to find it in "%s"',
$profile->getName(), $path
throw new \InvalidArgumentException(sprintf(
'Profile "%s" does not exist, expected to find it in "%s"',
$profile->getName(),
$path
));
}

Expand Down Expand Up @@ -99,7 +101,8 @@ public function saveProfile(Profile $profile, $overwrite = false)

if (false === $overwrite && file_exists($path)) {
throw new FileExistsException(sprintf(
'Profile already exists at "%s"', $path
'Profile already exists at "%s"',
$path
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ protected function configure()
$this->setDescription('List the privileges of the repository or a specific node');
$this->addArgument('absPath', InputArgument::OPTIONAL, 'Absolute path for node, optional.');
$this->addOption('supported', null, InputOption::VALUE_NONE, 'List privileges supported by repository rather than current session.');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
NOTE: This command is not supported by Jackrabbit.

List the privileges of the current session or the node at the given path.
Expand All @@ -49,7 +50,7 @@ protected function configure()
list the privileges held by the current session, but rather the privileges
supported by the repository.
HERE
);
);

$this->requiresDescriptor(RepositoryInterface::OPTION_ACCESS_CONTROL_SUPPORTED, true);
}
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/LockInfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ protected function configure()
$this->setName('lock:info');
$this->setDescription('Show details of the lock that applies to the specified node path');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of locked node');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Shows the details of the lock that applies to the node at the specified
path.

Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/LockLockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ protected function configure()
$this->addOption('session-scoped', null, InputOption::VALUE_NONE, 'If given, this lock expires with the current session; if not it expires when explicitly or automatically unlocked for some other reason');
$this->addOption('timeout', null, InputOption::VALUE_REQUIRED, 'Desired lock timeout in seconds (servers are free to ignore this value). If not used lock will not timeout');
$this->addOption('owner-info', null, InputOption::VALUE_REQUIRED, ' string containing owner information supplied by the client; servers are free to ignore this value. If none is specified, the implementation chooses one (i.e. user name of current backend authentication credentials');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Places a lock on the node at <info>path</info>.

If successful, the node is said to hold the lock.
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/LockRefreshCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setName('lock:refresh');
$this->setDescription('Refresh the TTL of the lock of the node at the given path');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node containing the lock to be refreshed');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
If this lock's time-to-live is governed by a timer, this command resets
that timer so that the lock does not timeout and expire.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setName('lock:token:add');
$this->setDescription('Add a lock token to the current session');
$this->addArgument('lockToken', InputArgument::REQUIRED, 'Lock token');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Adds the specified lock token to the current Session.

Holding a lock token makes the current Session the owner of the lock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ protected function configure()
{
$this->setName('lock:token:list');
$this->setDescription('List a lock token to the current session');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Show a list of previously registered tokens.

Displays all lock tokens currently held by the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setName('lock:token:remove');
$this->setDescription('Remove a lock token to the current session');
$this->addArgument('lockToken', InputArgument::REQUIRED, 'Lock token');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Removes the specified lock token from the current Session.
HERE
);
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/LockUnlockCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setName('lock:unlock');
$this->setDescription('Unlock the node at the given path');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Removes the lock on the node at path.

Also removes the properties jcr:lockOwner and jcr:lockIsDeep from that
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/NodeCloneCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ protected function configure()
$this->addArgument('destPath', InputArgument::REQUIRED, 'Path to destination node');
$this->addArgument('srcWorkspace', InputArgument::OPTIONAL, 'If specified, copy from this workspace');
$this->addOption('remove-existing', null, InputOption::VALUE_NONE, 'Remove existing nodes');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Clones the subgraph at the node <info>srcAbsPath</info> in
<info>srcWorkspace</info> to the new location at <info>destAbsPath</info> in
the current workspace.
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/NodeCopyCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ protected function configure()
$this->addArgument('srcPath', InputArgument::REQUIRED, 'Path to source node');
$this->addArgument('destPath', InputArgument::REQUIRED, 'Path to destination node');
$this->addArgument('srcWorkspace', InputArgument::OPTIONAL, 'If specified, copy from this workspace');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Copies a Node including its children to a new location to the given workspace.

This method copies the subgraph rooted at, and including, the node at
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setDescription('Show the path for the current nodes corresponding path in named workspace');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
$this->addArgument('workspaceName', InputArgument::REQUIRED, 'The name of the workspace');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Returns the absolute path of the node in the specified workspace that
corresponds to this node.
HERE
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/NodeCreateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setDescription('Create a node at the current path');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node to create');
$this->addArgument('primaryNodeTypeName', InputArgument::OPTIONAL, 'Optional name of primary node type to use');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Creates a new node at the specified <info>path</info>

This is session-write method, meaning that the addition of the new node
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/NodeEditCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ protected function configure()
$this->setDescription('Edit the given node in the EDITOR configured by the system');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
$this->addOption('type', null, InputOption::VALUE_REQUIRED, 'Optional type to use when creating new nodes', 'nt:unstructured');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Edit or create a node at the given path using the default editor as defined by the EDITOR environment variable.

When you invoke the command a temporary file in YAML format will be created on the filesystem. This file will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ protected function configure()
$this->addOption('mime-type', null, InputOption::VALUE_REQUIRED, 'Mime type (optional, auto-detected)');
$this->addOption('force', null, InputOption::VALUE_NONE, 'Force overwriting any existing node');
$this->addOption('no-container', null, InputOption::VALUE_NONE, 'Do not wrap in a JCR nt:file, but write directly to the specified property');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Import an external file into the repository.

The file will be imported as a node of built-in type <comment>nt:file</comment>.
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/NodeInfoCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setName('node:info');
$this->setDescription('Show information about the current node');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Show information about the node(s) at the given path:

PHPCRSH> node:info path/to/node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ protected function configure()
$this->setDescription('Causes the lifecycle state of this node to undergo the specified transition.');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
$this->addArgument('transition', InputArgument::REQUIRED, 'A state transition');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Causes the lifecycle state of the current node to undergo the specified
transition.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setName('node:lifecycle:list');
$this->setDescription('Returns the list of valid state transitions for this node.');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Returns the list of valid state transitions for this node.
HERE
);
Expand Down
12 changes: 8 additions & 4 deletions src/PHPCR/Shell/Console/Command/Phpcr/NodeListCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ protected function configure()
'Sort properties, one of: <comment>%s</comment>',
implode('</comment>, <comment>', $this->sortOptions)
), 'asc');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
List both or one of the children and properties of this node.

Multiple levels can be shown by using the <info>--level</info> option.
Expand Down Expand Up @@ -123,7 +124,8 @@ public function execute(InputInterface $input, OutputInterface $output)
$this->renderNode($node, $table, [], $filter);

if ($table->getNumberOfRows() > 0) {
$output->writeln(sprintf('<pathbold>%s</pathbold> [%s] > %s',
$output->writeln(sprintf(
'<pathbold>%s</pathbold> [%s] > %s',
$node->getPath(),
$node->getPrimaryNodeType()->getName(),
implode(', ', $node->getPrimaryNodeType()->getDeclaredSupertypeNames())
Expand All @@ -133,11 +135,13 @@ public function execute(InputInterface $input, OutputInterface $output)
}

if ($config['show_execution_time_list']) {
$output->writeln(sprintf(
$output->writeln(
sprintf(
'%s nodes, %s properties in set (%s sec)',
$this->nbNodes,
$this->nbProperties,
number_format($this->time, $config['execution_time_expansion']))
number_format($this->time, $config['execution_time_expansion'])
)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setDescription('Add the named mixin to the node (can include wildcards)');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
$this->addArgument('mixinName', InputArgument::REQUIRED, 'The name of the mixin node type to be added');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Adds the mixin node type named <info>mixinName</info> to the node(s) inferred by the path.

If this node is already of type <info>mixinName</info> (either due to a previously
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setDescription('Remove the named mixin to the current node');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node (can include wildcards)');
$this->addArgument('mixinName', InputArgument::REQUIRED, 'The name of the mixin node type to be removeed');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Removes the specified mixin node type from this node and removes
mixinName from this node's jcr:mixinTypes property.
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/NodeMoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setDescription('Move a node in the current session');
$this->addArgument('srcPath', InputArgument::REQUIRED, 'The root of the subgraph to be moved.');
$this->addArgument('destPath', InputArgument::REQUIRED, 'The location to which the subgraph is to be moved');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Moves the node at <info>srcPath</info> (and its entire subgraph) to the new
location at <info>destPath</info>.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ protected function configure()
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
$this->addArgument('srcChildRelPath', InputArgument::REQUIRED, 'The relative path to the child node to be moved in the ordering');
$this->addArgument('destChildRelPath', InputArgument::REQUIRED, 'The relative path to the child before which the node srcChildRelPath will be placed');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
This command is used to change the order of a child node relative to the current node.

For example, given that the node <pathbold>/foobar</pathbold> has the children <node>child2</node> and
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setName('node:property:remove');
$this->setDescription('Remove the property at the given absolute path');
$this->addArgument('absPath', InputArgument::REQUIRED, 'Absolute path to property');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Remove the property from the current session at the given path
HERE
);
Expand All @@ -39,7 +40,8 @@ public function execute(InputInterface $input, OutputInterface $output)
$property = $session->getProperty($absPath);
} catch (PathNotFoundException $e) {
throw new \Exception(sprintf(
'Could not find a property at "%s"', $absPath
'Could not find a property at "%s"',
$absPath
));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ protected function configure()
$this->addArgument('path', InputArgument::REQUIRED, 'Path of property - parent path can include wildcards');
$this->addArgument('value', InputArgument::OPTIONAL, 'Value for named property');
$this->addOption('type', null, InputOption::VALUE_REQUIRED, 'Type of named property');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Defines or set a value for a property identified by its name.

PHPCRSH> node:property:set . propname "some value" --type="String"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ protected function configure()
$this->setName('node:property:show');
$this->setDescription('Show the property at the given path');
$this->addArgument('path', InputArgument::REQUIRED, 'Path to property (can include wildcards)');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Show the full value of a property at the given path
HERE
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,16 @@ protected function configure()
$this->setDescription('Returns all REFERENCE properties that refer to this node');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node (can include wildcard)');
$this->addArgument('name', InputArgument::OPTIONAL, 'Limit references to given name');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
This command returns all REFERENCE properties that refer to this node,
have the specified name and that are accessible through the current
Session.
If the <info>name</info> parameter is null then all referring REFERENCES are returned
regardless of name.
HERE
);
);
}

public function execute(InputInterface $input, OutputInterface $output)
Expand Down
3 changes: 2 additions & 1 deletion src/PHPCR/Shell/Console/Command/Phpcr/NodeRemoveCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ protected function configure()
$this->setDescription('Remove the node at path (can include wildcards)');
$this->addArgument('path', InputArgument::REQUIRED, 'Path of node');
$this->addOption('shared', null, InputOption::VALUE_NONE, 'Remove nodes in shared set');
$this->setHelp(<<<'HERE'
$this->setHelp(
<<<'HERE'
Remove the node at the given path.

If the `--shared` option is specified then any nodes within this nodes
Expand Down
Loading