Skip to content
This repository

Add CodeSniffing to the travis build. #151

Closed
wants to merge 1 commit into from

2 participants

Blaine Schmeisser Ben Corlett
Blaine Schmeisser

Fixes #143 -> Good starting point for adding custom rules too!

No dev branch?

Blaine Schmeisser blainesch commented on the diff January 24, 2013
src/Illuminate/Cache/WinCacheStore.php
@@ -46,7 +46,7 @@ protected function retrieveItem($key)
46 46
 	 */
47 47
 	protected function storeItem($key, $value, $minutes)
48 48
 	{
49  
-		wincache_ucache_add($this->prefix.$key, value, $minutes * 60);
  49
+		wincache_ucache_add($this->prefix.$key, $value, $minutes * 60);
1

Not much of a "sniff" here, this should have been caught by a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Ben Corlett

I like this. +1

Blaine Schmeisser blainesch closed this March 20, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Jan 24, 2013
Blaine Schmeisser Add CodeSniffing to the travis build. 953c3f3
This page is out of date. Refresh to see the latest.
6  .travis.yml
@@ -4,8 +4,12 @@ php:
4 4
   - 5.3
5 5
   - 5.4
6 6
 
  7
+before_install:
  8
+  - pear install --alldeps pear/PHP_CodeSniffer
  9
+  - phpenv rehash
  10
+
7 11
 before_script:
8 12
   - curl -s http://getcomposer.org/installer | php
9 13
   - php composer.phar install --dev
10 14
 
11  
-script: phpunit
  15
+script: phpcs --standard=csruleset.xml ./ && phpunit
18  csruleset.xml
... ...
@@ -0,0 +1,18 @@
  1
+<?xml version="1.0"?>
  2
+<ruleset name="Laravel Standard">
  3
+
  4
+ <description>Laraval Coding Standard</description>
  5
+
  6
+ <exclude-pattern>tests/*</exclude-pattern>
  7
+ <exclude-pattern>vendor/*</exclude-pattern>
  8
+ <exclude-pattern>stubs/*</exclude-pattern>
  9
+ <exclude-pattern>Pheanstalk/*</exclude-pattern>
  10
+ <exclude-pattern>Support/helpers.php</exclude-pattern>
  11
+
  12
+ <rule ref="PSR1"/>
  13
+
  14
+ <rule ref="PSR1.Files.SideEffects.FoundWithSymbols">
  15
+  <exclude-pattern>Foundation/start.php</exclude-pattern>
  16
+ </rule>
  17
+
  18
+</ruleset>
2  src/Illuminate/Cache/WinCacheStore.php
@@ -46,7 +46,7 @@ protected function retrieveItem($key)
46 46
 	 */
47 47
 	protected function storeItem($key, $value, $minutes)
48 48
 	{
49  
-		wincache_ucache_add($this->prefix.$key, value, $minutes * 60);
  49
+		wincache_ucache_add($this->prefix.$key, $value, $minutes * 60);
50 50
 	}
51 51
 
52 52
 	/**
3  src/Illuminate/Container/BindingResolutionException.php
... ...
@@ -0,0 +1,3 @@
  1
+<?php namespace Illuminate\Container;
  2
+
  3
+class BindingResolutionException extends \Exception {}
2  src/Illuminate/Container/Container.php
... ...
@@ -1,7 +1,5 @@
1 1
 <?php namespace Illuminate\Container; use Closure, ArrayAccess, ReflectionParameter;
2 2
 
3  
-class BindingResolutionException extends \Exception {}
4  
-
5 3
 class Container implements ArrayAccess {
6 4
 
7 5
 	/**
3  src/Illuminate/Encryption/DecryptException.php
... ...
@@ -0,0 +1,3 @@
  1
+<?php namespace Illuminate\Encryption;
  2
+
  3
+class DecryptException extends \RuntimeException {}
2  src/Illuminate/Encryption/Encrypter.php
... ...
@@ -1,7 +1,5 @@
1 1
 <?php namespace Illuminate\Encryption;
2 2
 
3  
-class DecryptException extends \RuntimeException {}
4  
-
5 3
 class Encrypter {
6 4
 
7 5
 	/**
2  src/Illuminate/Events/Dispatcher.php
@@ -118,4 +118,4 @@ public function createClassListener($listener)
118 118
 		};
119 119
 	}
120 120
 
121  
-}
  121
+}
3  src/Illuminate/Filesystem/FileNotFoundException.php
... ...
@@ -0,0 +1,3 @@
  1
+<?php namespace Illuminate\Filesystem;
  2
+
  3
+class FileNotFoundException extends \Exception {}
2  src/Illuminate/Filesystem/Filesystem.php
@@ -2,8 +2,6 @@
2 2
 
3 3
 use FilesystemIterator;
4 4
 
5  
-class FileNotFoundException extends \Exception {}
6  
-
7 5
 class Filesystem {
8 6
 
9 7
 	/**
2  src/Illuminate/Workbench/Package.php
@@ -73,4 +73,4 @@ public function getFullName()
73 73
 		return $this->lowerVendor.'/'.$this->lowerName;
74 74
 	}
75 75
 
76  
-}
  76
+}
2  src/Illuminate/Workbench/Starter.php
@@ -26,4 +26,4 @@ public static function start($path, $finder = null, $files = null)
26 26
 		}
27 27
 	}
28 28
 
29  
-}
  29
+}
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.