Fixed Codesniffer test files according to FHComplete Style

This commit is contained in:
Andreas Oesterreicher
2017-07-02 18:37:55 +02:00
parent 5f47ce6e30
commit 4c95ee4d58
31 changed files with 107 additions and 302 deletions
@@ -8,29 +8,29 @@ use Other\Error as OtherError;
class Throws
{
/**
* Test throws
*
* @throws Exception An expection happened.
* @throws FHComplete\Boom A boom went off.
* @throws FHComplete\Error\Boom Oh, shucks, another boom.
* @throws Other\Crap Oh boy.
* @throws Other\Error\Issue A missing tissue for your PSR-2 issues.
* @return void
*/
public function test()
{
switch ($a) {
case 1:
throw new Boom();
case 2:
throw new Error\Boom();
case 3:
throw new OtherError\Issue();
case 4:
throw new Crap();
default:
throw new \Exception();
}
}
/**
* Test throws
*
* @throws Exception An expection happened.
* @throws FHComplete\Boom A boom went off.
* @throws FHComplete\Error\Boom Oh, shucks, another boom.
* @throws Other\Crap Oh boy.
* @throws Other\Error\Issue A missing tissue for your PSR-2 issues.
* @return void
*/
public function test()
{
switch ($a) {
case 1:
throw new Boom();
case 2:
throw new Error\Boom();
case 3:
throw new OtherError\Issue();
case 4:
throw new Crap();
default:
throw new \Exception();
}
}
}
@@ -1,19 +1,25 @@
<?php
for ($i = 0; $i < 10; $i++) {
for ($i = 0; $i < 10; $i++)
{
echo 'hello';
}
if ($i < 10) {
if ($i < 10)
{
echo 'hello2';
} elseif ($i > 100) {
}
elseif ($i > 100)
{
echo 'i > 100';
}
while (false) {
while (false)
{
echo 'false';
}
do {
do
{
echo 'dowhile test';
} while (false);
@@ -1,6 +1,7 @@
<?php
do
{
echo 'dowhile test';
}
while (false);
@@ -1,6 +1,9 @@
<?php
if (isset($a)) {
if (isset($a))
{
echo 'a isset';
} else if (isset($b)) {
}
elseif (isset($b))
{
echo 'b isset';
}
@@ -1,4 +1,5 @@
<?php
if ($value) {
if ($value)
{
$thing = 'test';
}
}
@@ -1,4 +1,5 @@
<?php
if(isset($test)) {
if(isset($test))
{
echo 'hello';
}
@@ -11,22 +11,23 @@ namespace App\Person\Patient;
*/
class Foo extends Bar
{
/**
* What are your thoughts?
*
* @var array $brain
*/
public $brain = array();
/**
* What are your thoughts?
*
* @var array $brain
*/
public $brain = array();
/**
* Tell me your thoughts.
*
* @return void
*/
public function dumpThoughts()
{
foreach ($thoughts as $thought) {
echo $thought;
}
}
public function dumpThoughts()
{
foreach ($thoughts as $thought)
{
echo $thought;
}
}
}
@@ -17,7 +17,8 @@ $anotherThing = 'what';
* What happens with If's?
*
*/
if ($anotherThing !== 'notfun') {
if ($anotherThing !== 'notfun')
{
$anotherThing = 'Oh no.';
}
@@ -8,22 +8,23 @@ namespace FHC;
*/
class Foo extends Bar
{
/**
* What are your thoughts?
*
* @var array $brain
*/
public $brain = array();
/**
* What are your thoughts?
*
* @var array $brain
*/
public $brain = array();
/**
* Tell me your thoughts.
*
* @return void
*/
public function dumpThoughts()
{
foreach ($thoughts as $thought) {
echo $thought;
}
}
/**
* Tell me your thoughts.
*
* @return void
*/
public function dumpThoughts()
{
foreach ($thoughts as $thought)
{
echo $thought;
}
}
}
@@ -3,13 +3,13 @@ namespace Beakman;
class Foo
{
/**
* [doThing description]
*
* @param string $foo Foo foo foo.
* @return void
*/
public function doThing($foo)
{
}
/**
* [doThing description]
*
* @param string $foo Foo foo foo.
* @return void
*/
public function doThing($foo)
{
}
}
@@ -1,13 +0,0 @@
<?php
class Foo {
/**
* There is a (disallowed) trailing space after the opening ** in this doc block.
*
* @return void
*/
public function bar()
{
}
}
@@ -1,14 +0,0 @@
<?php
class Foo {
/**
* Some sentence.
*
* @param integer $param Some Param.
* @param boolean $otherParam Some Other Param.
* @return string Something.
*/
public function bar($param, $otherParam)
{
}
}
@@ -1,49 +0,0 @@
<?php
namespace Beakman;
class Foo
{
/**
* Some sentence.
*
* @param int $param Some Param.
* @param bool $otherParam Some Other Param.
* @return void
*/
public function bar($param, $otherParam)
{
}
/**
* Description
*
* @return mixed
*/
public function baz()
{
if ($something) {
return;
}
return 'foo';
}
/**
* Description
*
* @return void|string
*/
public function foo()
{
if ($something) {
return;
}
return 'foo';
}
/**
* {@inheritDoc}
*/
public function inherited($param)
{
}
}
@@ -1,6 +0,0 @@
<?php
if ($indented) {
$var = array(
'space' => 'after 2 tabs'
);
}
@@ -1,6 +0,0 @@
<?php
use FHC\Test,
FHC\Fail;
class Foo {
}
@@ -1,9 +0,0 @@
<?php
namespace Beakman;
use FHC\Test as Test;
use Testing\Ok;
class Foo
{
}
@@ -1,11 +1,12 @@
<?php
$foo = -1;
switch($foo) {
case -1:
break;
case 'negative':
return -1;
switch($foo)
{
case -1:
break;
case 'negative':
return -1;
}
$bar = isset($foo) ? -2 : 0;
$foo = isset($bar) ? 0 : -2;
@@ -1,2 +1,2 @@
<?php
$var = 'space and tab';
$var = 'space and tab';
@@ -3,9 +3,8 @@
use One;
use Two;
class Foo {
use LogTrait;
use FirstTrait;
class Foo
{
use LogTrait;
use FirstTrait;
}
@@ -7,9 +7,10 @@ use FHC\More;
class Foo
{
use BarTrait;
use FirstTrait {
foo as bar;
config as protected _config;
}
use BarTrait;
use FirstTrait
{
foo as bar;
config as protected _config;
}
}
@@ -1,4 +0,0 @@
<?php
$isActive = (boolean)$value;
$count = (integer)$someNumber;
@@ -1,4 +0,0 @@
<?php
$isActive = (bool)$value;
$count = (int)$someNumber;
@@ -1,22 +0,0 @@
<?php
namespace Beakman;
class TraitUser
{
use FunctionsTrait;
/**
* [doThing description]
*
* @param callable $callback The description.
* @return void
*/
public function doThing(callable $callback)
{
$visitor = function ($expression) use (&$visitor, $callback) {
echo 'It works';
};
$visitor($this);
}
}
@@ -1,8 +0,0 @@
<?php
$foo = 'bar';
$bar = 'foo';
$zum = function () use ($foo, $bar) {
return $foo;
};
@@ -1,8 +0,0 @@
<?php
use FHC\Routing\Router;
use FHC\Error;
use FHC\Utility\Hash;
class Foo {
}
@@ -1,10 +0,0 @@
<?php
namespace BryanCrowe;
use FHC\Routing\RouteCollection;
use FHC\Routing\Router;
use FHC\Routing\Route\Route;
class Foo
{
}
@@ -1,7 +0,0 @@
<?php
use FHC\Routing\Router, FHC\Error;
class Foo
{
}
@@ -1,45 +0,0 @@
<?php
namespace Beakman;
class VariablenamePass
{
public $passing;
public $passingPublic = 'defined';
protected $underScoredStart = 'OK';
protected $underScored;
private $doubleUnderscore = 'applications';
public static $publicStatic = true;
protected static $protectedStatic = true;
private static $privateStatic = true;
/**
* [setVariables description]
*
* @return void
*/
public function setVariables()
{
$this->passingPublic = 'changed';
$this->underscored = 'has value now';
$this->doubleUnderscore = 'not recommended';
}
/**
* [setStatics description]
*
* @return void
*/
public static function setStatics()
{
self::$publicStatic = true;
self::$protectedStatic = true;
self::$privateStatic = true;
}
}
@@ -1,2 +0,0 @@
<?php
echo implode('', array_map('chr', array_map('hexdec',array_filter(explode($delimiter, $string)))));
@@ -1,2 +0,0 @@
<?php
echo implode('', array_map('chr', array_map('hexdec' , array_filter(explode($delimiter, $string)))));
@@ -1,2 +0,0 @@
<?php
echo implode('', array_map('chr', array_map('hexdec', array_filter(explode($delimiter, $string)))));