Skip to content

Commit 2077158

Browse files
dantleechdbu
authored andcommitted
Applied CS fixer
1 parent 7f8ef45 commit 2077158

File tree

86 files changed

+1446
-686
lines changed

Some content is hidden

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

86 files changed

+1446
-686
lines changed

.php_cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
$header = <<<EOF
4+
This file is part of the PHPCR API Tests package
5+
6+
Copyright (c) 2013 Liip and others
7+
8+
For the full copyright and license information, please view the LICENSE
9+
file that was distributed with this source code.
10+
EOF;
11+
12+
Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);
13+
14+
return Symfony\CS\Config\Config::create()
15+
->fixers(array(
16+
'header_comment',
17+
'-psr0',
18+
'psr4',
19+
'symfony',
20+
'concat_with_spaces',
21+
'concat_without_spaces',
22+
'-phpdoc_indent',
23+
'-phpdoc_params',
24+
))
25+
->finder(
26+
Symfony\CS\Finder\DefaultFinder::create()
27+
->exclude('vendor')
28+
->in(__DIR__)
29+
)
30+
;

bootstrap.dist.php

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
<?php
2+
3+
/*
4+
* This file is part of the PHPCR API Tests package
5+
*
6+
* Copyright (c) 2013 Liip and others
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
212
/** make sure we get ALL infos from php */
313
error_reporting(E_ALL | E_STRICT);
414

5-
/**
15+
/*
616
* Sample bootstrap file
717
*
818
* the thing you MUST do is define the constants as expected in the
@@ -39,11 +49,11 @@
3949
* you can do things here like registering your autoloader
4050
* or require files with classes that are used but not autoloaded
4151
*/
42-
require __DIR__.'/../src/Jackalope/autoloader.php';
52+
require __DIR__ . '/../src/Jackalope/autoloader.php';
4353

4454
### Load two classes needed for jackalope unit tests ###
45-
require __DIR__.'/../tests/Jackalope/TestCase.php';
46-
require __DIR__.'/../tests/Jackalope/Transport/DoctrineDBAL/DoctrineDBALTestCase.php';
55+
require __DIR__ . '/../tests/Jackalope/TestCase.php';
56+
require __DIR__ . '/../tests/Jackalope/Transport/DoctrineDBAL/DoctrineDBALTestCase.php';
4757

4858
### Load the implementation loader class ###
4959
require 'ImplementationLoader.php';

fixtures/06_Query/characters.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,4 @@
6565
</sv:node>
6666
</sv:node>
6767
</sv:node>
68-
</sv:node>
68+
</sv:node>

fixtures/10_Writing/mixinreferenceable.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,3 @@
130130
</sv:property>
131131
</sv:node>
132132
</sv:node>
133-

fixtures/11_Import/simple.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88
<child/>
99
</yetanother>
1010
</sibling>
11-
</data>
11+
</data>

fixtures/general/query.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
<sv:value>SELECT * FROM [nt:file] WHERE [nt:file].[jcr:mimeType] = "text/plain"</sv:value>
2525
</sv:property>
2626
</sv:node>
27-
</sv:node>
27+
</sv:node>

lib/AbstractLoader.php

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
<?php
22

3+
/*
4+
* This file is part of the PHPCR API Tests package
5+
*
6+
* Copyright (c) 2013 Liip and others
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
namespace PHPCR\Test;
413

514
use PHPCR\NoSuchWorkspaceException;
@@ -18,20 +27,20 @@ abstract class AbstractLoader
1827
protected $otherWorkspacename;
1928

2029
/**
21-
* array with chapter names to skip all test cases in (without the numbers)
30+
* array with chapter names to skip all test cases in (without the numbers).
2231
*/
2332
protected $unsupportedChapters = array();
2433
/**
25-
* array in the format Chapter\FeatureTest with all cases to skip
34+
* array in the format Chapter\FeatureTest with all cases to skip.
2635
*/
2736
protected $unsupportedCases = array();
2837
/**
29-
* array in the format Chapter\FeatureTest::testName with all single tests to skip
38+
* array in the format Chapter\FeatureTest::testName with all single tests to skip.
3039
*/
3140
protected $unsupportedTests = array();
3241

3342
/**
34-
* Create the loader
43+
* Create the loader.
3544
*
3645
* @param string $factoryclass the class name of your implementations
3746
* RepositoryFactory. You can pass null but then you must overwrite
@@ -71,7 +80,7 @@ public function getRepositoryFactoryClass()
7180
/**
7281
* @return array hashmap with the parameters for the repository factory
7382
*/
74-
public abstract function getRepositoryFactoryParameters();
83+
abstract public function getRepositoryFactoryParameters();
7584

7685
/**
7786
* You should overwrite this to instantiate the repository without the
@@ -85,39 +94,38 @@ public abstract function getRepositoryFactoryParameters();
8594
public function getRepository()
8695
{
8796
$factoryclass = $this->getRepositoryFactoryClass();
88-
$factory = new $factoryclass;
89-
if (! $factory instanceof RepositoryFactoryInterface) {
97+
$factory = new $factoryclass();
98+
if (!$factory instanceof RepositoryFactoryInterface) {
9099
throw new \Exception("$factoryclass is not of type RepositoryFactoryInterface");
91100
}
92-
/** @var $factory RepositoryFactoryInterface */
101+
/* @var $factory RepositoryFactoryInterface */
93102
return $factory->getRepository($this->getRepositoryFactoryParameters());
94103
}
95104

96105
/**
97106
* @return \PHPCR\CredentialsInterface the login credentials that lead to successful login into the repository
98107
*/
99-
public abstract function getCredentials();
108+
abstract public function getCredentials();
100109

101110
/**
102111
* @return \PHPCR\CredentialsInterface the login credentials that lead to login failure
103112
*/
104-
public abstract function getInvalidCredentials();
113+
abstract public function getInvalidCredentials();
105114

106115
/**
107116
* Used when impersonating another user in Reading\SessionReadMethodsTests::testImpersonate
108-
* And for Reading\SessionReadMethodsTest::testCheckPermissionAccessControlException
117+
* And for Reading\SessionReadMethodsTest::testCheckPermissionAccessControlException.
109118
*
110119
* The user may not have write access to /tests_general_base/numberPropertyNode/jcr:content/foo
111120
*
112121
* @return \PHPCR\CredentialsInterface the login credentials with limited permissions for testing impersonate and access control
113122
*/
114-
public abstract function getRestrictedCredentials();
123+
abstract public function getRestrictedCredentials();
115124

116125
/**
117126
* @return string the user id that is used in the credentials
118127
*/
119-
public abstract function getUserId();
120-
128+
abstract public function getUserId();
121129

122130
/**
123131
* Make the repository ready for login with null credentials, handling the
@@ -126,9 +134,9 @@ public abstract function getUserId();
126134
* If the implementation does not support this feature, it must return
127135
* false for this method, otherwise true.
128136
*
129-
* @return boolean true if anonymous login is supposed to work
137+
* @return bool true if anonymous login is supposed to work
130138
*/
131-
public abstract function prepareAnonymousLogin();
139+
abstract public function prepareAnonymousLogin();
132140

133141
/**
134142
* @return string the workspace name used for the tests
@@ -158,6 +166,7 @@ public function getOtherWorkspaceName()
158166
* Get a session for this implementation.
159167
*
160168
* @param \PHPCR\CredentialsInterface $credentials The credentials to log into the repository. If omitted, self::getCredentials should be used
169+
*
161170
* @return \PHPCR\SessionInterface the session resulting from logging into the repository with the provided credentials
162171
*/
163172
public function getSession($credentials = false)
@@ -169,6 +178,7 @@ public function getSession($credentials = false)
169178
* Get a session corresponding to the additional workspace for this implementation.
170179
*
171180
* @param \PHPCR\CredentialsInterface $credentials The credentials to log into the repository. If omitted, self::getCredentials should be used
181+
*
172182
* @return \PHPCR\SessionInterface the session resulting from logging into the repository with the provided credentials
173183
*/
174184
public function getAdditionalSession($credentials = false)
@@ -202,7 +212,7 @@ public function getSessionWithLastModified()
202212
* mix:lastModified. If that is not possible, this method should return
203213
* true, which will skip the test about this feature.
204214
*
205-
* @return boolean
215+
* @return bool
206216
*/
207217
public function doesSessionLastModified()
208218
{
@@ -223,7 +233,7 @@ public function doesSessionLastModified()
223233
*/
224234
public function getTestSupported($chapter, $case, $name)
225235
{
226-
return ! ( in_array($chapter, $this->unsupportedChapters)
236+
return !(in_array($chapter, $this->unsupportedChapters)
227237
|| in_array($case, $this->unsupportedCases)
228238
|| in_array($name, $this->unsupportedTests)
229239
);
@@ -232,11 +242,12 @@ public function getTestSupported($chapter, $case, $name)
232242
/**
233243
* @return \PHPCR\Test\FixtureLoaderInterface implementation that is used to load test fixtures
234244
*/
235-
public abstract function getFixtureLoader();
245+
abstract public function getFixtureLoader();
236246

237247
/**
238248
* @param $credentials
239249
* @param $workspaceName
250+
*
240251
* @return mixed
241252
*/
242253
private function getSessionForWorkspace($credentials, $workspaceName)

0 commit comments

Comments
 (0)