PK CV@èA8 8 LICENSEnu W+A„¶ The MIT License (MIT)
Copyright (c) 2013 Steve Müller
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
PK CVÓLŸDG G ruleset.xmlnu W+A„¶
The Doctrine coding standard.
error
PK CVØ¥þpË Ë
composer.jsonnu W+A„¶ {
"name": "doctrine/coding-standard",
"type": "library",
"description": "Doctrine Coding Standard",
"keywords": ["doctrine", "coding", "standard", "cs", "code", "style", "sniffer"],
"homepage": "http://www.doctrine-project.org",
"license": "MIT",
"authors": [
{"name": "Benjamin Eberlei", "email": "kontakt@beberlei.de"},
{"name": "Steve Müller", "email": "st.mueller@dzh-online.de"}
],
"require": {
"php": ">=5.3",
"squizlabs/php_codesniffer": "~1.0"
},
"require-dev": {
"phpunit/phpunit": "~4.7"
},
"target-dir": "Doctrine",
"extra": {
"branch-alias": {
"dev-master": "0.1-dev"
}
}
}
PK CVWŠºP£ £ * Docs/Strings/ConcatenationSpacingSniff.xmlnu W+A„¶
. 'World!';
]]>
'. 'World!';
]]>
.'World!';
]]>
'.'World!';
]]>
PK CVº¼)º º Docs/README.mdnu W+A„¶ Doctrine Coding Standard
========================
The Doctrine project follows a coding standard based on
[PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) with custom
additions and modifications.
When contributing to the Doctrine project, the following rules have to be met in order to fulfill this standard.
Formatting
----------
- Corresponding assignment statement tokens MUST be aligned. Assignment tokens are:
`=`, `&=`, `.=`, `/=`, `-=`, `%=`, `*=`, `+=`, `^=`.
Each `=` token MUST be on the same column as the one from the previous corresponding statement.
```php
$foo = 'Foo';
$fooBar = 'FooBar';
$fooBarBaz = 'FooBarBaz';
$foo .= $bar;
$foo = 'Foo';
$object->foo($foo);
$fooBar = 'FooBar';
$object->fooBar($fooBar);
$fooBarBaz = 'FoobarBaz';
$object->fooBarBaz($fooBarBaz);
```
Strings
-------
- The string concatenation token `.` MUST be surrounded by spaces.
PK CVÅÉ™² ² README.mdnu W+A„¶ Doctrine PHP_CodeSniffer Coding Standard
========================================
[![Build Status](https://secure.travis-ci.org/doctrine/coding-standard.png?branch=master)](http://travis-ci.org/doctrine/coding-standard)
[![Coverage Status](https://coveralls.io/repos/doctrine/coding-standard/badge.png?branch=master)](https://coveralls.io/r/doctrine/coding-standard?branch=master)
The [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) Coding Standard to check against the [Doctrine Coding Standard](https://github.com/deeky666/doctrine-coding-standard/blob/master/Docs/README.md).
Installation
------------
You have three possibilities to use the Doctrine Coding Standard with PHP_CodeSniffer in a particular project.
### 1. Standalone installation
You can install the Doctrine Coding Standard as a plugin into your global system PHP_CodeSniffer installation:
```bash
$ cd /path/to/phpcs/CodeSniffer/Standards
$ php composer create-project doctrine/coding-standard Doctrine ~0.1@dev
```
Then you can use it like
(assuming that you have the `phpcs` binary in your search path):
```bash
$ phpcs --standard=Doctrine /path/to/some/file/to/sniff.php
```
Or even set it as default standard
(assuming that you have the `phpcs` binary in your search path):
```bash
$ phpcs --config-set default_standard Doctrine
```
And just sniff a particular file with
(assuming that you have the `phpcs` binary in your search path):
```bash
$ phpcs /path/to/some/file/to/sniff.php
```
### 2. Global installation
You also can install the Doctrine Coding Standard globally:
```bash
$ php composer global require doctrine/coding-standard:~0.1@dev
```
Then you can use it like:
```bash
$ phpcs --standard=~/.composer/vendor/doctrine/coding-standard/Doctrine /path/to/some/file/to/sniff.php
```
Or even set it as default standard:
```bash
$ phpcs --config-set default_standard ~/.composer/vendor/doctrine/coding-standard/Doctrine
```
And just sniff a particular file with:
```bash
$ phpcs /path/to/some/file/to/sniff.php
```
### 3. Custom installation
You can install the Doctrine Coding Standard anywhere you want:
```bash
$ php composer create-project doctrine/coding-standard /path/to/coding-standard/Doctrine ~0.1@dev
```
Then you can use it like:
```bash
$ ./vendor/bin/phpcs --standard=. /path/to/some/file/to/sniff.php
```
### 4. As a composer dependency of your project
You can install the Doctrine Coding Standard as a composer dependency to your particular project.
Just add the following block to your project's `composer.json` file:
```bash
$ php composer require doctrine/coding-standard:~0.1@dev
```
Then you can use it like:
```bash
$ ./vendor/bin/phpcs --standard=vendor/doctrine/coding-standard/Doctrine /path/to/some/file/to/sniff.php
```
Testing
-------
If you are contributing to the Doctrine Coding Standard and want to test your contribution, you have to
make sure all dependencies are correctly installed:
```bash
$ php composer install --prefer-source
```
The option `--prefer-source` is particularly necessary to ensure the test suite from PHP_CodeSniffer is
installed. Otherwise the test suite for the Doctrine Coding Standard won't work!
Run the test suite with:
```bash
$ ./vendor/bin/phpunit
```
PK CVörÐh^ ^ , Sniffs/Strings/ConcatenationSpacingSniff.phpnu W+A„¶ .
*/
/**
* Sniff that verifies that there are spaces around the string concatenation operator ".".
*
* @author Steve Müller
*/
class Doctrine_Sniffs_Strings_ConcatenationSpacingSniff implements PHP_CodeSniffer_Sniff
{
/**
* {@inheritdoc}
*/
public function register()
{
return array(T_STRING_CONCAT);
}
/**
* {@inheritdoc}
*/
public function process(PHP_CodeSniffer_File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if (T_WHITESPACE !== $tokens[$stackPtr - 1]['code']) {
$phpcsFile->addError('Missing space before the string concatenation operator ".".', $stackPtr, 'Before');
}
if (T_WHITESPACE !== $tokens[$stackPtr + 1]['code']) {
$phpcsFile->addError('Missing space after the string concatenation operator ".".', $stackPtr, 'After');
}
}
}
PK CV@èA8 8 LICENSEnu W+A„¶ PK CVÓLŸDG G o ruleset.xmlnu W+A„¶ PK CVØ¥þpË Ë
ñ composer.jsonnu W+A„¶ PK CVWŠºP£ £ * ù Docs/Strings/ConcatenationSpacingSniff.xmlnu W+A„¶ PK CVº¼)º º ö
Docs/README.mdnu W+A„¶ PK CVÅÉ™² ² î README.mdnu W+A„¶ PK CVörÐh^ ^ , Ù Sniffs/Strings/ConcatenationSpacingSniff.phpnu W+A„¶ PK L “&