forked from doctrine/doctrine1
-
Notifications
You must be signed in to change notification settings - Fork 77
add php cs fixer #112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
connorhu
wants to merge
19
commits into
FriendsOfSymfony1:master
Choose a base branch
from
connorhu:feature/phpcsfixer
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
add php cs fixer #112
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a294cac
add(qa) php-cs-fixer config and github action
connorhu 731b398
add(qa) cs-fix dev req. and scripts
connorhu 85f594a
fix(qa) apply cs-fix base rules
connorhu 739a233
add(qa) PHP54Migration rule (witch is array_syntax short)
connorhu 58c2e26
fix(qa) apply PHP54Migration rule
connorhu 9c8e027
add(qa) PHP70Migration rule
connorhu 36237d6
fix(qa) apply PHP70Migration rule
connorhu ca24853
add(qa) PHP70Migration:risky rule without strict types
connorhu 902d9c9
fix(qa) apply PHP70Migration:risky rule
connorhu 4f17c3b
add(qa) PHP71Migration rule
connorhu f244334
fix(qa) apply PHP71Migration rule
connorhu e701769
add(qa) PHP74Migration rule minus heredoc_indentation
connorhu e26c879
fix(qa) apply PHP74Migration rule
connorhu bfd53f9
add(qa) PHP74Migration:risky rule
connorhu d75496e
fix(qa) apply PHP74Migration:risky rule
connorhu ec9f90e
will diff more useful?
connorhu e8906f2
remove cs2pr, progress off
connorhu 335375f
bump version
connorhu 1d24b23
revert dev dep
connorhu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,30 @@ | ||
name: "Code Linting" | ||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
php-cs-fixer: | ||
name: 'PHP-CS-Fixer' | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.2 | ||
tools: php-cs-fixer:3.49 | ||
|
||
- uses: actions/cache@v3 | ||
with: | ||
path: '.php-cs-fixer.cache' | ||
key: ${{ github.repository }}-8.2-phpcsfixer-${{ github.ref_name }} | ||
restore-keys: | | ||
${{ github.repository }}-8.2-phpcsfixer-master | ||
${{ github.repository }}-8.2-phpcsfixer- | ||
|
||
- name: Run PHP-CS-Fixer | ||
run: 'php-cs-fixer fix --dry-run --show-progress=none --diff' |
This file contains hidden or 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 @@ tests/DoctrineTest/doctrine_tests/* | |
/tests/tmp | ||
/tests/foo.sq3 | ||
/vendor/ | ||
.php-cs-fixer.cache |
This file contains hidden or 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,56 @@ | ||
<?php | ||
|
||
$finder = PhpCsFixer\Finder::create() | ||
->ignoreVCSIgnored(true) | ||
->in(__DIR__.'/lib') | ||
->in(__DIR__.'/tests') | ||
->append([__FILE__]) | ||
// Exclude generated files (single files) | ||
->notPath('should-be-ignored.php') | ||
; | ||
|
||
$config = new PhpCsFixer\Config(); | ||
$config->setRules([ | ||
'@PhpCsFixer' => true, | ||
'@Symfony' => true, | ||
'@PHP70Migration' => true, | ||
'@PHP70Migration:risky' => true, | ||
'@PHP71Migration' => true, | ||
'@PHP74Migration' => true, | ||
'@PHP74Migration:risky' => true, | ||
'heredoc_indentation' => false, | ||
'declare_strict_types' => false, | ||
'void_return' => false, | ||
'array_syntax' => [ | ||
'syntax' => 'short', | ||
], | ||
'method_argument_space' => [ | ||
'on_multiline' => 'ensure_fully_multiline', | ||
], | ||
'general_phpdoc_annotation_remove' => [ | ||
'annotations' => ['version', 'license', 'since'], | ||
], | ||
'phpdoc_no_package' => true, | ||
'phpdoc_separation' => [ | ||
'groups' => [ | ||
[ | ||
'author', | ||
], | ||
[ | ||
'deprecated', | ||
'see', | ||
], | ||
[ | ||
'param', | ||
'return', | ||
'throws', | ||
], | ||
], | ||
], | ||
]) | ||
->setRiskyAllowed(true) | ||
->setCacheFile('.php-cs-fixer.cache') | ||
->setFinder($finder) | ||
; | ||
|
||
return $config; |
This file contains hidden or 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 hidden or 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 |
---|---|---|
|
@@ -20,23 +20,19 @@ | |
*/ | ||
|
||
/** | ||
* Provides array access and property overload interface for Doctrine subclasses | ||
* Provides array access and property overload interface for Doctrine subclasses. | ||
* | ||
* @see www.doctrine-project.org | ||
* | ||
* @package Doctrine | ||
* @subpackage Access | ||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL | ||
* @link www.doctrine-project.org | ||
* @since 1.0 | ||
* @version $Revision: 7490 $ | ||
* @author Konsta Vesterinen <[email protected]> | ||
*/ | ||
abstract class Doctrine_Access extends Doctrine_Locator_Injectable implements ArrayAccess | ||
{ | ||
/** | ||
* Set an entire aray to the data | ||
* Set an entire aray to the data. | ||
* | ||
* @param array $array An array of key => value pairs | ||
* @return Doctrine_Access | ||
* @param array $array An array of key => value pairs | ||
* @return Doctrine_Access | ||
*/ | ||
public function setArray(array $array) | ||
{ | ||
|
@@ -48,48 +44,42 @@ public function setArray(array $array) | |
} | ||
|
||
/** | ||
* Set key and value to data | ||
* Set key and value to data. | ||
* | ||
* @see set, offsetSet | ||
* @param $name | ||
* @param $value | ||
* @return void | ||
*/ | ||
public function __set($name, $value) | ||
{ | ||
$this->set($name, $value); | ||
} | ||
|
||
/** | ||
* Get key from data | ||
* Get key from data. | ||
* | ||
* @see get, offsetGet | ||
* @param mixed $name | ||
* @return mixed | ||
*/ | ||
public function __get($name) | ||
{ | ||
return $this->get($name); | ||
} | ||
|
||
/** | ||
* Check if key exists in data | ||
* Check if key exists in data. | ||
* | ||
* @param string $name | ||
* @return boolean whether or not this object contains $name | ||
* @param string $name | ||
* @return bool whether or not this object contains $name | ||
*/ | ||
public function __isset($name) | ||
{ | ||
return $this->contains($name); | ||
} | ||
|
||
/** | ||
* Remove key from data | ||
* Remove key from data. | ||
* | ||
* @param string $name | ||
* @return void | ||
* @param string $name | ||
*/ | ||
#[\ReturnTypeWillChange] | ||
#[ReturnTypeWillChange] | ||
public function __unset($name) | ||
{ | ||
return $this->remove($name); | ||
|
@@ -98,16 +88,13 @@ public function __unset($name) | |
/** | ||
* @return bool | ||
*/ | ||
#[\ReturnTypeWillChange] | ||
#[ReturnTypeWillChange] | ||
public function offsetExists($offset) | ||
{ | ||
return $this->contains($offset); | ||
} | ||
|
||
/** | ||
* @return mixed | ||
*/ | ||
#[\ReturnTypeWillChange] | ||
#[ReturnTypeWillChange] | ||
public function offsetGet($offset) | ||
{ | ||
// array notation with no index was causing 'undefined variable: $offset' notices in php7, | ||
|
@@ -116,84 +103,76 @@ public function offsetGet($offset) | |
if (!isset($offset)) { | ||
return $this->get(null); | ||
} | ||
|
||
return $this->get($offset); | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
#[\ReturnTypeWillChange] | ||
#[ReturnTypeWillChange] | ||
public function offsetSet($offset, $value) | ||
{ | ||
if ( ! isset($offset)) { | ||
if (!isset($offset)) { | ||
$this->add($value); | ||
} else { | ||
$this->set($offset, $value); | ||
} | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
#[\ReturnTypeWillChange] | ||
#[ReturnTypeWillChange] | ||
public function offsetUnset($offset) | ||
{ | ||
$this->remove($offset); | ||
} | ||
|
||
/** | ||
* Remove the element with the specified offset | ||
* Remove the element with the specified offset. | ||
* | ||
* @param mixed $offset The offset to remove | ||
* @return bool True if removed otherwise false | ||
* @param mixed $offset The offset to remove | ||
* @return bool True if removed otherwise false | ||
*/ | ||
public function remove($offset) | ||
{ | ||
throw new Doctrine_Exception('Remove is not supported for ' . get_class($this)); | ||
throw new Doctrine_Exception('Remove is not supported for '.get_class($this)); | ||
} | ||
|
||
/** | ||
* Return the element with the specified offset | ||
* Return the element with the specified offset. | ||
* | ||
* @param mixed $offset The offset to return | ||
* @return mixed | ||
* @param mixed $offset The offset to return | ||
*/ | ||
public function get($offset) | ||
{ | ||
throw new Doctrine_Exception('Get is not supported for ' . get_class($this)); | ||
throw new Doctrine_Exception('Get is not supported for '.get_class($this)); | ||
} | ||
|
||
/** | ||
* Set the offset to the value | ||
* Set the offset to the value. | ||
* | ||
* @param mixed $offset The offset to set | ||
* @param mixed $value The value to set the offset to | ||
* | ||
* @param mixed $value The value to set the offset to | ||
*/ | ||
public function set($offset, $value) | ||
{ | ||
throw new Doctrine_Exception('Set is not supported for ' . get_class($this)); | ||
throw new Doctrine_Exception('Set is not supported for '.get_class($this)); | ||
} | ||
|
||
/** | ||
* Check if the specified offset exists | ||
* Check if the specified offset exists. | ||
* | ||
* @param mixed $offset The offset to check | ||
* @return boolean True if exists otherwise false | ||
* @param mixed $offset The offset to check | ||
* @return bool True if exists otherwise false | ||
*/ | ||
public function contains($offset) | ||
{ | ||
throw new Doctrine_Exception('Contains is not supported for ' . get_class($this)); | ||
throw new Doctrine_Exception('Contains is not supported for '.get_class($this)); | ||
} | ||
|
||
/** | ||
* Add the value | ||
* Add the value. | ||
* | ||
* @param mixed $value The value to add | ||
* @return void | ||
*/ | ||
public function add($value) | ||
{ | ||
throw new Doctrine_Exception('Add is not supported for ' . get_class($this)); | ||
throw new Doctrine_Exception('Add is not supported for '.get_class($this)); | ||
} | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -20,15 +20,12 @@ | |
*/ | ||
|
||
/** | ||
* Doctrine_Adapter exception class | ||
* Doctrine_Adapter exception class. | ||
* | ||
* @see www.doctrine-project.org | ||
* | ||
* @package Doctrine | ||
* @subpackage Adapter | ||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL | ||
* @link www.doctrine-project.org | ||
* @since 1.0 | ||
* @version $Revision$ | ||
* @author Konsta Vesterinen <[email protected]> | ||
*/ | ||
class Doctrine_Adapter_Exception extends Doctrine_Exception | ||
{ } | ||
{ | ||
} |
This file contains hidden or 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 |
---|---|---|
|
@@ -20,28 +20,35 @@ | |
*/ | ||
|
||
/** | ||
* This adapter interface should be implemented by all custom adapters | ||
* This adapter interface should be implemented by all custom adapters. | ||
* | ||
* @author Konsta Vesterinen <[email protected]> | ||
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL | ||
* @package Doctrine | ||
* @subpackage Adapter | ||
* @link www.doctrine-project.org | ||
* @since 1.0 | ||
* @version $Revision: 7490 $ | ||
* | ||
* @see www.doctrine-project.org | ||
*/ | ||
interface Doctrine_Adapter_Interface | ||
{ | ||
public function prepare($prepareString); | ||
|
||
public function query($queryString); | ||
|
||
public function quote($input); | ||
|
||
public function exec($statement); | ||
|
||
public function lastInsertId(); | ||
|
||
public function beginTransaction(); | ||
|
||
public function commit(); | ||
|
||
public function rollBack(); | ||
|
||
public function errorCode(); | ||
|
||
public function errorInfo(); | ||
|
||
public function setAttribute($attribute, $value); | ||
|
||
public function getAttribute($attribute); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.