Skip to content

Commit ec608ad

Browse files
committed
modernize code for php8
1 parent b358af3 commit ec608ad

File tree

98 files changed

+493
-285
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+493
-285
lines changed

src/PHPCR/Util/CND/Exception/ParserException.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Exception;
46

57
use PHPCR\Util\CND\Scanner\GenericToken;

src/PHPCR/Util/CND/Exception/ScannerException.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Exception;
46

57
use PHPCR\Util\CND\Reader\ReaderInterface;

src/PHPCR/Util/CND/Parser/AbstractParser.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Parser;
46

57
use PHPCR\Util\CND\Exception\ParserException;

src/PHPCR/Util/CND/Parser/CndParser.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Parser;
46

57
use PHPCR\NodeType\NodeDefinitionTemplateInterface;

src/PHPCR/Util/CND/Reader/BufferReader.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Reader;
46

57
/**

src/PHPCR/Util/CND/Reader/FileReader.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Reader;
46

57
/**

src/PHPCR/Util/CND/Reader/ReaderInterface.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Reader;
46

57
/**

src/PHPCR/Util/CND/Scanner/AbstractScanner.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner;
46

57
use PHPCR\Util\CND\Reader\ReaderInterface;

src/PHPCR/Util/CND/Scanner/Context/DefaultScannerContext.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner\Context;
46

57
/**

src/PHPCR/Util/CND/Scanner/Context/DefaultScannerContextWithoutSpacesAndComments.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner\Context;
46

57
use PHPCR\Util\CND\Scanner\TokenFilter;

src/PHPCR/Util/CND/Scanner/Context/ScannerContext.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner\Context;
46

57
use PHPCR\Util\CND\Scanner\TokenFilter\TokenFilterInterface;

src/PHPCR/Util/CND/Scanner/GenericScanner.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner;
46

57
use PHPCR\Util\CND\Exception\ScannerException;

src/PHPCR/Util/CND/Scanner/GenericToken.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner;
46

57
/**

src/PHPCR/Util/CND/Scanner/Token.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner;
46

57
/**

src/PHPCR/Util/CND/Scanner/TokenFilter/NoCommentsFilter.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner\TokenFilter;
46

57
use PHPCR\Util\CND\Scanner\GenericToken;

src/PHPCR/Util/CND/Scanner/TokenFilter/NoNewlinesFilter.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner\TokenFilter;
46

57
use PHPCR\Util\CND\Scanner\GenericToken;

src/PHPCR/Util/CND/Scanner/TokenFilter/NoWhitespacesFilter.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner\TokenFilter;
46

57
use PHPCR\Util\CND\Scanner\GenericToken;

src/PHPCR/Util/CND/Scanner/TokenFilter/TokenFilterChain.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner\TokenFilter;
46

57
use PHPCR\Util\CND\Scanner\Token;

src/PHPCR/Util/CND/Scanner/TokenFilter/TokenFilterInterface.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner\TokenFilter;
46

57
use PHPCR\Util\CND\Scanner\Token;

src/PHPCR/Util/CND/Scanner/TokenFilter/TokenTypeFilter.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner\TokenFilter;
46

57
use PHPCR\Util\CND\Scanner\Token;

src/PHPCR/Util/CND/Scanner/TokenQueue.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Scanner;
46

57
/**

src/PHPCR/Util/CND/Writer/CndWriter.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\CND\Writer;
46

57
use PHPCR\NamespaceRegistryInterface;

src/PHPCR/Util/Console/Command/BaseCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\Console\Command;
46

57
use PHPCR\SessionInterface;

src/PHPCR/Util/Console/Command/BaseNodeManipulationCommand.php

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\Console\Command;
46

57
use Symfony\Component\Console\Input\InputOption;

src/PHPCR/Util/Console/Command/NodeDumpCommand.php

+11-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\Console\Command;
46

57
use PHPCR\ItemNotFoundException;
@@ -36,16 +38,16 @@ protected function configure(): void
3638
->setDescription('Dump subtrees of the content repository')
3739
->setHelp(
3840
<<<'HERE'
39-
The <info>dump</info> command recursively outputs the name of the node specified
40-
by the <info>identifier</info> argument and its subnodes in a yaml-like style.
41+
The <info>dump</info> command recursively outputs the name of the node specified
42+
by the <info>identifier</info> argument and its subnodes in a yaml-like style.
4143
42-
If the <info>props</info> option is used the nodes properties are
43-
displayed as yaml arrays.
44+
If the <info>props</info> option is used the nodes properties are
45+
displayed as yaml arrays.
4446
45-
By default the command filters out system nodes and properties (i.e. nodes and
46-
properties with names starting with 'jcr:'), the <info>--sys-nodes</info> option
47-
allows to turn this filter off.
48-
HERE
47+
By default the command filters out system nodes and properties (i.e. nodes and
48+
properties with names starting with 'jcr:'), the <info>--sys-nodes</info> option
49+
allows to turn this filter off.
50+
HERE
4951
);
5052
}
5153

@@ -83,7 +85,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8385
$node = $session->getNode($identifier);
8486
}
8587

86-
$walker->traverse($node, $input->getOption('depth'));
88+
$walker->traverse($node, (int) $input->getOption('depth'));
8789
} catch (RepositoryException $e) {
8890
if ($e instanceof PathNotFoundException || $e instanceof ItemNotFoundException) {
8991
$output->writeln("<error>Path '$identifier' does not exist</error>");

src/PHPCR/Util/Console/Command/NodeMoveCommand.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\Console\Command;
46

57
use Symfony\Component\Console\Command\Command;
@@ -26,14 +28,14 @@ protected function configure(): void
2628
->setDescription('Moves a node from one path to another')
2729
->setHelp(
2830
<<<'EOF'
29-
This command simply moves a node from one path (the source path)
30-
to another (the destination path), it can also be considered
31-
as a rename command.
31+
This command simply moves a node from one path (the source path)
32+
to another (the destination path), it can also be considered
33+
as a rename command.
3234
33-
$ php bin/phpcr phpcr:move /foobar /barfoo
35+
$ php bin/phpcr phpcr:move /foobar /barfoo
3436
35-
Note that the parent node of the destination path must already exist.
36-
EOF
37+
Note that the parent node of the destination path must already exist.
38+
EOF
3739
);
3840
}
3941

src/PHPCR/Util/Console/Command/NodeRemoveCommand.php

+9-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\Console\Command;
46

57
use PHPCR\NodeInterface;
@@ -33,17 +35,17 @@ protected function configure(): void
3335
->addOption('only-children', null, InputOption::VALUE_NONE, 'Use to only purge children of specified path')
3436
->setHelp(
3537
<<<'EOF'
36-
The <info>phpcr:node:remove</info> command will remove the given node or the
37-
children of the given node according to the options given.
38+
The <info>phpcr:node:remove</info> command will remove the given node or the
39+
children of the given node according to the options given.
3840
39-
Remove specified node and its children:
41+
Remove specified node and its children:
4042
41-
$ php bin/phpcr phpcr:node:remove /cms/content/blog
43+
$ php bin/phpcr phpcr:node:remove /cms/content/blog
4244
43-
Remove only the children of the specified node
45+
Remove only the children of the specified node
4446
45-
$ php bin/phpcr phpcr:node:remove /cms/content/blog --only-children
46-
EOF
47+
$ php bin/phpcr phpcr:node:remove /cms/content/blog --only-children
48+
EOF
4749
);
4850
}
4951

src/PHPCR/Util/Console/Command/NodeTouchCommand.php

+12-10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\Console\Command;
46

57
use PHPCR\PathNotFoundException;
@@ -49,21 +51,21 @@ protected function configure(): void
4951
->setDescription('Create or modify a node')
5052
->setHelp(
5153
<<<'HERE'
52-
This command allows you to create or modify a node at the specified path.
54+
This command allows you to create or modify a node at the specified path.
5355
54-
For example::
56+
For example::
5557
56-
$ ./bin/phpcr phpcr:touch /foobar --type=my:nodetype --set-prop=foo=bar
58+
$ ./bin/phpcr phpcr:touch /foobar --type=my:nodetype --set-prop=foo=bar
5759
58-
Will create the node "/foobar" and set (or create) the "foo" property
59-
with a value of "bar".
60+
Will create the node "/foobar" and set (or create) the "foo" property
61+
with a value of "bar".
6062
61-
You can execute the command again to further modify the node. Here we add
62-
the property "bar" and remove the property "foo". We also add the dump option
63-
to output a string reperesentation of the node.
63+
You can execute the command again to further modify the node. Here we add
64+
the property "bar" and remove the property "foo". We also add the dump option
65+
to output a string reperesentation of the node.
6466
65-
$ ./bin/phpcr phpcr:touch /foobar --type=my:nodetype --set-prop=bar=myvalue --remove-prop=foo --dump
66-
HERE
67+
$ ./bin/phpcr phpcr:touch /foobar --type=my:nodetype --set-prop=bar=myvalue --remove-prop=foo --dump
68+
HERE
6769
);
6870
}
6971

src/PHPCR/Util/Console/Command/NodeTypeListCommand.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace PHPCR\Util\Console\Command;
46

57
use Symfony\Component\Console\Command\Command;
@@ -22,9 +24,9 @@ protected function configure(): void
2224
->setDescription('List all available node types in the repository')
2325
->setHelp(
2426
<<<'EOT'
25-
This command lists all of the available node types and their subtypes
26-
in the PHPCR repository.
27-
EOT
27+
This command lists all of the available node types and their subtypes
28+
in the PHPCR repository.
29+
EOT
2830
);
2931
}
3032

0 commit comments

Comments
 (0)