Comments (12)
Check if you have a folder ~/.composer/vendor/pragmarx/laravelcs
On Linux/Mac:
ls -la ~/.composer/vendor/pragmarx/laravelcs
from laravelcs.
Yep, that directory is there -- here are a few pertinent results:
➜ ~ ls -lah ~/.composer/vendor/pragmarx/laravelcs
total 24
drwxr-xr-x 7 jason staff 238B Dec 9 07:57 .
drwxr-xr-x 3 jason staff 102B Dec 9 07:57 ..
drwxr-xr-x 15 jason staff 510B Dec 9 07:57 .git
-rw-r--r-- 1 jason staff 1.5K Dec 9 07:57 LICENSE
drwxr-xr-x 4 jason staff 136B Dec 9 07:57 Standards
-rw-r--r-- 1 jason staff 455B Dec 9 07:57 composer.json
-rw-r--r-- 1 jason staff 2.7K Dec 9 07:57 readme.md
➜ ~ phpcs ~/Development/laravel-framework/src/Illuminate/Cache/Console/CacheTableCommand.php
FILE: ...nt/laravel-framework/src/Illuminate/Cache/Console/CacheTableCommand.php
--------------------------------------------------------------------------------
FOUND 98 ERRORS AFFECTING 60 LINES
--------------------------------------------------------------------------------
1 | ERROR | [ ] Missing file doc comment
7 | ERROR | [ ] Missing class doc comment
7 | ERROR | [x] Opening brace of a class must be on the line after the
| | definition
... shortened for brevity
➜ ~ phpcs --standard=~/.composer/vendor/pragmarx/laravelcs/Standards/Laravel ~/Development/laravel-framework/src/Illuminate/Cache/Console/CacheTableCommand.php
ERROR: the "~/.composer/vendor/pragmarx/laravelcs/Standards/Laravel" coding standard is not installed. The installed coding standards are MySource, PEAR, PHPCS, PSR1, PSR2, Squiz and Zend
from laravelcs.
That was tough. Looks like PHP_CodeSniffer doesn't accept standards inside hidden folders like ~/.composer
, so copying it to /tmp worked:
cp -a ~/.composer/vendor/pragmarx/laravelcs /tmp
phpcs -v --standard=/tmp/laravelcs/Standards/Laravel/ /tmp/laravelcs/Standards/TestFiles/Filesystem.php
Now I just have to fix this... :(
/cc @mvpasarel
from laravelcs.
Looks like they knew & fixed it:
http://pear.php.net/package/PHP_CodeSniffer/download/All
- Standards can now be located within hidden directories (further fix for bug #20323)
This should work on 2.0.0RC2, but I have 2.0.0 (stable) and it's not.
from laravelcs.
Not sure if it was fixed here or not: squizlabs/PHP_CodeSniffer#254
from laravelcs.
Hmm... The problem seems to be from the ~/
because I actually tested it with /Users/mvpasarel/.composer/...
and is working with .composer
hidden directory.
I can change the readme to use the full path only.
@xsbeats Can you try with the full path please?
from laravelcs.
You're right! I'll change it. Thanks.
from laravelcs.
While you're there, I have a typo as well at Usage wih
, please change that too. Thanks.
from laravelcs.
Done and done.
You can run it using:
phpcs -v --standard=$HOME/.composer/vendor/pragmarx/laravelcs/Standards/Laravel /path/to/folder/or/file
from laravelcs.
I also opened an issue on CodeSniffer: squizlabs/PHP_CodeSniffer#353, they should use realpath()
to convert those paths before start to traverse them...
from laravelcs.
I also created a pull request to fix it on CodeSniffer: https://github.com/squizlabs/PHP_CodeSniffer/pull/354/files
from laravelcs.
thanks @antonioribeiro @mvpasarel. working great now!
from laravelcs.
Related Issues (14)
- Update for Laravel 5 HOT 2
- document Laravel as default
- PHP Fatal error: Interface 'PHP_CodeSniffer_Sniff' not found HOT 1
- PHPCS needs updated support. HOT 10
- Tabs incorrectly expected when using Standard
- Your requirements could not be resolved to an installable set of packages.
- Deprecation notice
- Interface "PHP_CodeSniffer_Sniff" not found
- Documentation HOT 2
- How to specify your own rulesets?
- Docblock space indents are being flagged as incorrect HOT 7
- PHP Notice: Use of undefined constant T_DOC_COMMENT_STRING - assumed 'T_DOC_COMMENT_STRING' HOT 2
- Conditional if error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laravelcs.