Skip to content

Commit 58b5a6b

Browse files
committed
Fixed problem with PHP < 5.6
2 parents 4f6cff8 + 95ac5dd commit 58b5a6b

File tree

4 files changed

+11
-28
lines changed

4 files changed

+11
-28
lines changed

phpcodesniffer

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ done
2121
cd vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/ || exit_error "PHP_CodeSniffer not installed"
2222
if [ -d PHPCompatibility ]; then
2323
cd PHPCompatibility
24-
git pull
24+
git pull -q
2525
else
26-
git clone http://github.com/wimg/PHPCompatibility.git
26+
git clone http://github.com/wimg/PHPCompatibility.git -q
2727
fi
2828

2929
# Run PHP_CodeSniffer
3030

3131
cd "$DIR"
32-
./vendor/bin/phpcs --report-width=100 --tab-width=4 --standard=phpcodesniffer.xml,PHPCompatibility src/ -as --runtime-set testVersion 5.4
32+
./vendor/bin/phpcs --report-width=100 --tab-width=4 --standard=phpcodesniffer.xml,PHPCompatibility src/ -as --runtime-set testVersion 5.3
3333

3434
exit 0

phpcodesniffer.xml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@
1010
<rule ref="Generic.Formatting.SpaceAfterCast"/>
1111

1212
<!--Function name in camelCase-->
13-
<rule ref="Generic.NamingConventions.CamelCapsFunctionName">
14-
<!--Allow helpers with snake_case-->
15-
<exclude-pattern>helpers.php</exclude-pattern>
16-
</rule>
13+
<rule ref="Generic.NamingConventions.CamelCapsFunctionName"/>
1714

1815
<!--PHP5 constructor syntax "function __construct()"-->
1916
<rule ref="Generic.NamingConventions.ConstructorName"/>
@@ -24,10 +21,7 @@
2421
<!--Force tabs identation-->
2522
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
2623

27-
<!--Suppress warning for some files without PHP code-->
28-
<rule ref="Internal.NoCodeFound">
29-
<exclude-pattern>/views/</exclude-pattern>
30-
</rule>
24+
<rule ref="Internal.NoCodeFound"/>
3125

3226
<rule ref="PSR2">
3327
<!--Allow one line control structures to have no curly braces-->
@@ -71,5 +65,3 @@
7165
<rule ref="Squiz.WhiteSpace.SemicolonSpacing"/>
7266

7367
</ruleset>
74-
75-

src/Command.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ protected function setParametersFromConfig()
4343
{
4444
$this->info("Using '$connection' connection");
4545

46-
$this->parameters['-host'] = $connections[$connection]['host'];
47-
$this->parameters['-db'] = $connections[$connection]['database'];
48-
$this->parameters['-u'] = $connections[$connection]['username'];
49-
$this->parameters['-p'] = $connections[$connection]['password'];
46+
$this->parameters['-host'] = $connections[$connection]['host'];
47+
$this->parameters['-db'] = $connections[$connection]['database'];
48+
$this->parameters['-u'] = $connections[$connection]['username'];
49+
$this->parameters['-p'] = $connections[$connection]['password'];
5050
}
5151
else
5252
$this->comment("Unknown connection '$connection'. Command will fail unless you provide DB credentials.");

src/ServiceProvider.php

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44

55
class ServiceProvider extends LaravelServiceProvider
66
{
7-
/**
8-
* Path to the default config file.
9-
*
10-
* @var string
11-
*/
12-
protected $configFile = __DIR__ . '/config.php';
13-
147
/**
158
* Register bindings in the container.
169
*
@@ -19,7 +12,7 @@ class ServiceProvider extends LaravelServiceProvider
1912
public function register()
2013
{
2114
// Merge user's configuration
22-
$this->mergeConfigFrom($this->configFile, 'spy');
15+
$this->mergeConfigFrom(__DIR__ . '/config.php', 'spy');
2316

2417
// Bind 'stolz.schemaspy.command.spy' component to the IoC container
2518
$this->app->bind('stolz.schemaspy.command.spy', function ($app) {
@@ -36,12 +29,10 @@ public function boot()
3629
{
3730
// Register paths to be published by 'vendor:publish' artisan command
3831
$this->publishes([
39-
$this->configFile => config_path('spy.php'),
32+
__DIR__ . '/config.php' => config_path('spy.php'),
4033
]);
4134

4235
// Add artisan command
4336
$this->commands('stolz.schemaspy.command.spy');
4437
}
45-
46-
4738
}

0 commit comments

Comments
 (0)