Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from SignpostMarv/php-cs-fixer
added & applied php-cs-fixer config for symfony sans yoda
- Loading branch information
Showing
48 changed files
with
418 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,3 @@ insert_final_newline = false | |
|
||
[.travis.yml] | ||
indent_size = 2 | ||
|
||
[composer.json] | ||
indent_style = tab |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ vendor/ | |
/.buildpath | ||
/.project | ||
/.idea | ||
/.php_cs.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
/** | ||
* PHP-CS-Fixer Config. | ||
*/ | ||
|
||
namespace GoetasWebservices\CS; | ||
|
||
require_once __DIR__.'/vendor/autoload.php'; | ||
|
||
return new Config([ | ||
__FILE__, | ||
(__DIR__.'/src/'), | ||
(__DIR__.'/tests/'), | ||
]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,43 @@ | ||
{ | ||
"name" : "goetas-webservices/xsd-reader", | ||
"description" : "Read any XML Schema (XSD) programmatically with PHP", | ||
"keywords" : [ | ||
"xsd", | ||
"xml", | ||
"php", | ||
"parser", | ||
"xmlschema" | ||
], | ||
"license" : "MIT", | ||
"authors" : [{ | ||
"name" : "Asmir Mustafic", | ||
"email" : "goetas@lignano.it" | ||
} | ||
], | ||
"require" : { | ||
"php" : ">=5.4.0" | ||
}, | ||
"require-dev" : { | ||
"phpunit/phpunit" : "^4.8|^5.0" | ||
}, | ||
"autoload" : { | ||
"psr-4" : { | ||
"GoetasWebservices\\XML\\XSDReader\\" : "src/" | ||
} | ||
}, | ||
"autoload-dev" : { | ||
"psr-4" : { | ||
"GoetasWebservices\\XML\\XSDReader\\Tests\\" : "tests/" | ||
} | ||
}, | ||
"extra" : { | ||
"branch-alias" : { | ||
"dev-master" : "0.2-dev" | ||
} | ||
}, | ||
"scripts": { | ||
"test": "vendor/bin/phpunit" | ||
} | ||
"name" : "goetas-webservices/xsd-reader", | ||
"description" : "Read any XML Schema (XSD) programmatically with PHP", | ||
"keywords" : [ | ||
"xsd", | ||
"xml", | ||
"php", | ||
"parser", | ||
"xmlschema" | ||
], | ||
"license" : "MIT", | ||
"authors" : [{ | ||
"name" : "Asmir Mustafic", | ||
"email" : "goetas@lignano.it" | ||
} | ||
], | ||
"require" : { | ||
"php" : ">=5.4.0" | ||
}, | ||
"require-dev" : { | ||
"phpunit/phpunit" : "^4.8|^5.0" | ||
}, | ||
"autoload" : { | ||
"psr-4" : { | ||
"GoetasWebservices\\XML\\XSDReader\\" : "src/" | ||
} | ||
}, | ||
"autoload-dev" : { | ||
"psr-4" : { | ||
"GoetasWebservices\\CS\\": "./php-cs-fixer/", | ||
"GoetasWebservices\\XML\\XSDReader\\Tests\\" : "tests/" | ||
} | ||
}, | ||
"extra" : { | ||
"branch-alias" : { | ||
"dev-master" : "0.2-dev" | ||
} | ||
}, | ||
"scripts": { | ||
"php-cs-fixer": "php-cs-fixer fix --verbose --dry-run", | ||
"test": "vendor/bin/phpunit" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
/** | ||
* @author SignpostMarv | ||
*/ | ||
namespace GoetasWebservices\CS; | ||
|
||
use PhpCsFixer\Config as BaseConfig; | ||
use PhpCsFixer\Finder as DefaultFinder; | ||
|
||
class Config extends BaseConfig | ||
{ | ||
const DEFAULT_RULES = [ | ||
'@Symfony' => true, | ||
'yoda_style' => false, | ||
]; | ||
|
||
public function __construct(array $inPaths) | ||
{ | ||
parent::__construct( | ||
str_replace( | ||
'\\', | ||
' - ', | ||
preg_replace( | ||
'/([a-z0-9])([A-Z])/', | ||
'$1 $2', | ||
static::class | ||
) | ||
) | ||
); | ||
|
||
$this->setUsingCache(true); | ||
$this->setRules(static::DEFAULT_RULES); | ||
|
||
/** | ||
* @var DefaultFinder $finder | ||
*/ | ||
$finder = $this->getFinder(); | ||
$this->setFinder(array_reduce( | ||
$inPaths, | ||
function (DefaultFinder $finder, $directory) { | ||
if (is_file($directory) === true) { | ||
return $finder->append([$directory]); | ||
} | ||
return $finder->in($directory); | ||
}, | ||
$finder->ignoreUnreadableDirs() | ||
)); | ||
} | ||
|
||
/** | ||
* Resolve rules at runtime. | ||
*/ | ||
protected static function RuntimeResolveRules() | ||
{ | ||
return static::DEFAULT_RULES; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
namespace GoetasWebservices\XML\XSDReader\Exception; | ||
|
||
class IOException extends \Exception | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
<?php | ||
|
||
namespace GoetasWebservices\XML\XSDReader\Exception; | ||
|
||
class TypeException extends \Exception | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.