code merge : GWM
This commit is contained in:
parent
13a8e67711
commit
dc8a4229af
4
.env
4
.env
@ -29,6 +29,10 @@ app.baseURL = 'http://localhost/ria/'
|
||||
#--------------------------------------------------------------------
|
||||
# DATABASE
|
||||
#--------------------------------------------------------------------
|
||||
# database.default.hostname = 'vprodb1.mysql.database.azure.com'
|
||||
# database.default.database = 'ria_prod'
|
||||
# database.default.username = 'dbroot'
|
||||
# database.default.password = 'root@DB23'
|
||||
|
||||
database.default.hostname = '119.18.54.85'
|
||||
database.default.database = 'venbaehn_ria'
|
||||
|
||||
@ -344,7 +344,10 @@ class Purchaseorder extends BaseController
|
||||
|
||||
$data['TotalAmountInWords'] = $this->convertNumber($totalAmt);
|
||||
$data['RequistionDetails'] = $this->purchaseorder_model->GetPdfRequistionDetails($PONO);
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($data);
|
||||
// echo '</pre>';
|
||||
// die;
|
||||
$mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8',
|
||||
'format' => 'A4',
|
||||
'default_font' => 'sans-serif',
|
||||
@ -380,7 +383,7 @@ $mpdf->use_kwt = true;
|
||||
// $html = view('pdf_view', $data);
|
||||
// $mpdf->WriteHTML($html); // Use WriteHTML() method to add body content
|
||||
$html = view('po_pdf', $data);
|
||||
//echo $html;die;
|
||||
// echo $html;die;
|
||||
$mpdf->WriteHTML($html); // Use WriteHTML() method to add body content
|
||||
|
||||
// Set HTML footer
|
||||
|
||||
@ -3201,10 +3201,13 @@ if (!empty($getlogpodtl)) {
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- --------------------------------------- -->
|
||||
|
||||
<!-- --------------------------------------- -->
|
||||
<div class="col-md-12" style="padding:0px;">
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<label>Discount Type </label>
|
||||
<div>
|
||||
@ -3233,29 +3236,10 @@ if (!empty($getlogpodtl)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<label>CGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewCGST', 'value' => set_value('tViewCGST'), 'id' => 'ViewCGST', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateCST(0);', 'readonly' => 'true',);
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>CGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewAfterCGST', 'value' => set_value('ViewAfterCGST'), 'id' => 'ViewAfterCGST', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12" style="text-align:left;">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<label>Packaging Type </label>
|
||||
<div>
|
||||
@ -3284,51 +3268,11 @@ if (!empty($getlogpodtl)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="SGSTViewModel">
|
||||
<div class="col-md-2">
|
||||
<label>SGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewSGST', 'value' => set_value('ViewSGST'), 'id' => 'ViewSGST', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateGST(0);', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewAfterSGST', 'value' => set_value('ViewAfterSGST'), 'id' => 'ViewAfterSGST', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="IGSTViewModel" style="display:none;">
|
||||
<div class="col-md-2">
|
||||
<label>IGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewIGST', 'value' => set_value('tViewIGST'), 'id' => 'ViewIGST', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => ' calculateGST(0);', 'readonly' => 'true',);
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewAfterIGST', 'value' => set_value('ViewAfterIGST'), 'id' => 'ViewAfterIGST', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-4"></div>
|
||||
<div class="col-md-4">
|
||||
<label>Freight Type </label>
|
||||
<div>
|
||||
<?php
|
||||
@ -3374,6 +3318,76 @@ if (!empty($getlogpodtl)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-8"></div>
|
||||
<div class="col-md-2">
|
||||
<label>CGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewCGST', 'value' => set_value('tViewCGST'), 'id' => 'ViewCGST', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateCST(0);', 'readonly' => 'true',);
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>CGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewAfterCGST', 'value' => set_value('ViewAfterCGST'), 'id' => 'ViewAfterCGST', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-8"></div>
|
||||
<div id="SGSTViewModel">
|
||||
<div class="col-md-2">
|
||||
<label>SGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewSGST', 'value' => set_value('ViewSGST'), 'id' => 'ViewSGST', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'calculateGST(0);', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>SGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewAfterSGST', 'value' => set_value('ViewAfterSGST'), 'id' => 'ViewAfterSGST', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="IGSTViewModel" style="display:none;">
|
||||
<div class="col-md-2">
|
||||
<label>IGST In %</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewIGST', 'value' => set_value('tViewIGST'), 'id' => 'ViewIGST', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => ' calculateGST(0);', 'readonly' => 'true',);
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<label>IGST Amt <?php echo "($INRSYM)" ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'ViewAfterIGST', 'value' => set_value('ViewAfterIGST'), 'id' => 'ViewAfterIGST', 'class' => 'form-control num', 'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-8"></div>
|
||||
<div class="col-md-4">
|
||||
<label> Insurance <?php echo "($INRSYM)" ?> (if Any)</label>
|
||||
<div class="form-group">
|
||||
@ -3383,12 +3397,10 @@ if (!empty($getlogpodtl)) {
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-8"></div>
|
||||
<div class="col-md-4"> <label><?php echo "Total Order Amt ($INRSYM)"; ?></label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
|
||||
5
vendor/bin/php-cs-fixer
vendored
5
vendor/bin/php-cs-fixer
vendored
@ -112,8 +112,9 @@ if (PHP_VERSION_ID < 80000) {
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
return include("phpvfscomposer://" . __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer');
|
||||
include("phpvfscomposer://" . __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer');
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
return include __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer';
|
||||
include __DIR__ . '/..'.'/friendsofphp/php-cs-fixer/php-cs-fixer';
|
||||
|
||||
5
vendor/bin/php-parse
vendored
5
vendor/bin/php-parse
vendored
@ -112,8 +112,9 @@ if (PHP_VERSION_ID < 80000) {
|
||||
(function_exists('stream_get_wrappers') && in_array('phpvfscomposer', stream_get_wrappers(), true))
|
||||
|| (function_exists('stream_wrapper_register') && stream_wrapper_register('phpvfscomposer', 'Composer\BinProxyWrapper'))
|
||||
) {
|
||||
return include("phpvfscomposer://" . __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse');
|
||||
include("phpvfscomposer://" . __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse');
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
return include __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse';
|
||||
include __DIR__ . '/..'.'/nikic/php-parser/bin/php-parse';
|
||||
|
||||
@ -4,6 +4,10 @@ All notable changes to this library will be documented in this file.
|
||||
|
||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [v1.8.0](https://github.com/CodeIgniter/coding-standard/compare/v1.7.16...v1.8.0) - 2024-06-16
|
||||
|
||||
- Enable rules for PHP 8.1 (#20)
|
||||
|
||||
## [v1.7.16](https://github.com/CodeIgniter/coding-standard/compare/v1.7.15...v1.7.16) - 2024-05-18
|
||||
|
||||
- Disable `php_unit_attributes` for now
|
||||
|
||||
@ -19,15 +19,15 @@
|
||||
"slack": "https://codeigniterchat.slack.com"
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.4 || ^8.0",
|
||||
"php": "^8.1",
|
||||
"ext-tokenizer": "*",
|
||||
"friendsofphp/php-cs-fixer": "^3.50",
|
||||
"nexusphp/cs-config": "<=3.18.0"
|
||||
"nexusphp/cs-config": "^3.19.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"nexusphp/tachycardia": "^1.3",
|
||||
"nexusphp/tachycardia": "^2.1",
|
||||
"phpstan/phpstan": "^1.0",
|
||||
"phpunit/phpunit": "^9.5"
|
||||
"phpunit/phpunit": "^10.5"
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true,
|
||||
|
||||
@ -243,7 +243,7 @@ final class CodeIgniter4 extends AbstractRuleset
|
||||
'attribute_placement' => 'standalone',
|
||||
],
|
||||
'method_chaining_indentation' => true,
|
||||
'modernize_strpos' => false, // requires 8.0+
|
||||
'modernize_strpos' => true,
|
||||
'modernize_types_casting' => true,
|
||||
'multiline_comment_opening_closing' => true,
|
||||
'multiline_string_to_heredoc' => false,
|
||||
@ -344,13 +344,13 @@ final class CodeIgniter4 extends AbstractRuleset
|
||||
'normalize_index_brace' => true,
|
||||
'not_operator_with_space' => false,
|
||||
'not_operator_with_successor_space' => true,
|
||||
'nullable_type_declaration' => false, // requires 8.0+
|
||||
'nullable_type_declaration' => ['syntax' => 'question_mark'],
|
||||
'nullable_type_declaration_for_default_null_value' => true,
|
||||
'numeric_literal_separator' => false,
|
||||
'object_operator_without_whitespace' => true,
|
||||
'octal_notation' => false, // requires 8.1+
|
||||
'operator_linebreak' => ['only_booleans' => true, 'position' => 'beginning'],
|
||||
'ordered_attributes' => false, // requires 8.0+
|
||||
'ordered_attributes' => ['order' => [], 'sort_algorithm' => 'alpha'],
|
||||
'ordered_class_elements' => [
|
||||
'order' => [
|
||||
'use_trait',
|
||||
@ -366,10 +366,14 @@ final class CodeIgniter4 extends AbstractRuleset
|
||||
'imports_order' => ['class', 'function', 'const'],
|
||||
'case_sensitive' => false,
|
||||
],
|
||||
'ordered_interfaces' => false,
|
||||
'ordered_traits' => false,
|
||||
'ordered_types' => false, // requires 8.0+
|
||||
'php_unit_attributes' => false, // requires 8.1+
|
||||
'ordered_interfaces' => false,
|
||||
'ordered_traits' => false,
|
||||
'ordered_types' => [
|
||||
'null_adjustment' => 'always_last',
|
||||
'sort_algorithm' => 'alpha',
|
||||
'case_sensitive' => false,
|
||||
],
|
||||
'php_unit_attributes' => true,
|
||||
'php_unit_construct' => [
|
||||
'assertions' => [
|
||||
'assertSame',
|
||||
@ -689,7 +693,7 @@ final class CodeIgniter4 extends AbstractRuleset
|
||||
],
|
||||
];
|
||||
|
||||
$this->requiredPHPVersion = 70400;
|
||||
$this->requiredPHPVersion = 80100;
|
||||
|
||||
$this->autoActivateIsRiskyAllowed = true;
|
||||
}
|
||||
|
||||
108
vendor/composer/ClassLoader.php
vendored
108
vendor/composer/ClassLoader.php
vendored
@ -45,34 +45,35 @@ class ClassLoader
|
||||
/** @var \Closure(string):void */
|
||||
private static $includeFile;
|
||||
|
||||
/** @var string|null */
|
||||
/** @var ?string */
|
||||
private $vendorDir;
|
||||
|
||||
// PSR-4
|
||||
/**
|
||||
* @var array<string, array<string, int>>
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, int>>
|
||||
*/
|
||||
private $prefixLengthsPsr4 = array();
|
||||
/**
|
||||
* @var array<string, list<string>>
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<int, string>>
|
||||
*/
|
||||
private $prefixDirsPsr4 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $fallbackDirsPsr4 = array();
|
||||
|
||||
// PSR-0
|
||||
/**
|
||||
* List of PSR-0 prefixes
|
||||
*
|
||||
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
|
||||
*
|
||||
* @var array<string, array<string, list<string>>>
|
||||
* @var array[]
|
||||
* @psalm-var array<string, array<string, string[]>>
|
||||
*/
|
||||
private $prefixesPsr0 = array();
|
||||
/**
|
||||
* @var list<string>
|
||||
* @var array[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $fallbackDirsPsr0 = array();
|
||||
|
||||
@ -80,7 +81,8 @@ class ClassLoader
|
||||
private $useIncludePath = false;
|
||||
|
||||
/**
|
||||
* @var array<string, string>
|
||||
* @var string[]
|
||||
* @psalm-var array<string, string>
|
||||
*/
|
||||
private $classMap = array();
|
||||
|
||||
@ -88,20 +90,21 @@ class ClassLoader
|
||||
private $classMapAuthoritative = false;
|
||||
|
||||
/**
|
||||
* @var array<string, bool>
|
||||
* @var bool[]
|
||||
* @psalm-var array<string, bool>
|
||||
*/
|
||||
private $missingClasses = array();
|
||||
|
||||
/** @var string|null */
|
||||
/** @var ?string */
|
||||
private $apcuPrefix;
|
||||
|
||||
/**
|
||||
* @var array<string, self>
|
||||
* @var self[]
|
||||
*/
|
||||
private static $registeredLoaders = array();
|
||||
|
||||
/**
|
||||
* @param string|null $vendorDir
|
||||
* @param ?string $vendorDir
|
||||
*/
|
||||
public function __construct($vendorDir = null)
|
||||
{
|
||||
@ -110,7 +113,7 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
* @return string[]
|
||||
*/
|
||||
public function getPrefixes()
|
||||
{
|
||||
@ -122,7 +125,8 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, list<string>>
|
||||
* @return array[]
|
||||
* @psalm-return array<string, array<int, string>>
|
||||
*/
|
||||
public function getPrefixesPsr4()
|
||||
{
|
||||
@ -130,7 +134,8 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getFallbackDirs()
|
||||
{
|
||||
@ -138,7 +143,8 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @return list<string>
|
||||
* @return array[]
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getFallbackDirsPsr4()
|
||||
{
|
||||
@ -146,7 +152,8 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, string> Array of classname => path
|
||||
* @return string[] Array of classname => path
|
||||
* @psalm-return array<string, string>
|
||||
*/
|
||||
public function getClassMap()
|
||||
{
|
||||
@ -154,7 +161,8 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, string> $classMap Class to filename map
|
||||
* @param string[] $classMap Class to filename map
|
||||
* @psalm-param array<string, string> $classMap
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -171,25 +179,24 @@ class ClassLoader
|
||||
* Registers a set of PSR-0 directories for a given prefix, either
|
||||
* appending or prepending to the ones previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix
|
||||
* @param string[]|string $paths The PSR-0 root directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function add($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$paths,
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr0
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr0 = array_merge(
|
||||
$this->fallbackDirsPsr0,
|
||||
$paths
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
|
||||
@ -198,19 +205,19 @@ class ClassLoader
|
||||
|
||||
$first = $prefix[0];
|
||||
if (!isset($this->prefixesPsr0[$first][$prefix])) {
|
||||
$this->prefixesPsr0[$first][$prefix] = $paths;
|
||||
$this->prefixesPsr0[$first][$prefix] = (array) $paths;
|
||||
|
||||
return;
|
||||
}
|
||||
if ($prepend) {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$paths,
|
||||
(array) $paths,
|
||||
$this->prefixesPsr0[$first][$prefix]
|
||||
);
|
||||
} else {
|
||||
$this->prefixesPsr0[$first][$prefix] = array_merge(
|
||||
$this->prefixesPsr0[$first][$prefix],
|
||||
$paths
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -219,9 +226,9 @@ class ClassLoader
|
||||
* Registers a set of PSR-4 directories for a given namespace, either
|
||||
* appending or prepending to the ones previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param string[]|string $paths The PSR-4 base directories
|
||||
* @param bool $prepend Whether to prepend the directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
@ -229,18 +236,17 @@ class ClassLoader
|
||||
*/
|
||||
public function addPsr4($prefix, $paths, $prepend = false)
|
||||
{
|
||||
$paths = (array) $paths;
|
||||
if (!$prefix) {
|
||||
// Register directories for the root namespace.
|
||||
if ($prepend) {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$paths,
|
||||
(array) $paths,
|
||||
$this->fallbackDirsPsr4
|
||||
);
|
||||
} else {
|
||||
$this->fallbackDirsPsr4 = array_merge(
|
||||
$this->fallbackDirsPsr4,
|
||||
$paths
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
} elseif (!isset($this->prefixDirsPsr4[$prefix])) {
|
||||
@ -250,18 +256,18 @@ class ClassLoader
|
||||
throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator.");
|
||||
}
|
||||
$this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length;
|
||||
$this->prefixDirsPsr4[$prefix] = $paths;
|
||||
$this->prefixDirsPsr4[$prefix] = (array) $paths;
|
||||
} elseif ($prepend) {
|
||||
// Prepend directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$paths,
|
||||
(array) $paths,
|
||||
$this->prefixDirsPsr4[$prefix]
|
||||
);
|
||||
} else {
|
||||
// Append directories for an already registered namespace.
|
||||
$this->prefixDirsPsr4[$prefix] = array_merge(
|
||||
$this->prefixDirsPsr4[$prefix],
|
||||
$paths
|
||||
(array) $paths
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -270,8 +276,8 @@ class ClassLoader
|
||||
* Registers a set of PSR-0 directories for a given prefix,
|
||||
* replacing any others previously set for this prefix.
|
||||
*
|
||||
* @param string $prefix The prefix
|
||||
* @param list<string>|string $paths The PSR-0 base directories
|
||||
* @param string $prefix The prefix
|
||||
* @param string[]|string $paths The PSR-0 base directories
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
@ -288,8 +294,8 @@ class ClassLoader
|
||||
* Registers a set of PSR-4 directories for a given namespace,
|
||||
* replacing any others previously set for this namespace.
|
||||
*
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param list<string>|string $paths The PSR-4 base directories
|
||||
* @param string $prefix The prefix/namespace, with trailing '\\'
|
||||
* @param string[]|string $paths The PSR-4 base directories
|
||||
*
|
||||
* @throws \InvalidArgumentException
|
||||
*
|
||||
@ -423,8 +429,7 @@ class ClassLoader
|
||||
public function loadClass($class)
|
||||
{
|
||||
if ($file = $this->findFile($class)) {
|
||||
$includeFile = self::$includeFile;
|
||||
$includeFile($file);
|
||||
(self::$includeFile)($file);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -475,9 +480,9 @@ class ClassLoader
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the currently registered loaders keyed by their corresponding vendor directories.
|
||||
* Returns the currently registered loaders indexed by their corresponding vendor directories.
|
||||
*
|
||||
* @return array<string, self>
|
||||
* @return self[]
|
||||
*/
|
||||
public static function getRegisteredLoaders()
|
||||
{
|
||||
@ -555,10 +560,7 @@ class ClassLoader
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
private static function initializeIncludeClosure()
|
||||
private static function initializeIncludeClosure(): void
|
||||
{
|
||||
if (self::$includeFile !== null) {
|
||||
return;
|
||||
@ -572,8 +574,8 @@ class ClassLoader
|
||||
* @param string $file
|
||||
* @return void
|
||||
*/
|
||||
self::$includeFile = \Closure::bind(static function($file) {
|
||||
self::$includeFile = static function($file) {
|
||||
include $file;
|
||||
}, null, null);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
17
vendor/composer/InstalledVersions.php
vendored
17
vendor/composer/InstalledVersions.php
vendored
@ -98,7 +98,7 @@ class InstalledVersions
|
||||
{
|
||||
foreach (self::getInstalled() as $installed) {
|
||||
if (isset($installed['versions'][$packageName])) {
|
||||
return $includeDevRequirements || !isset($installed['versions'][$packageName]['dev_requirement']) || $installed['versions'][$packageName]['dev_requirement'] === false;
|
||||
return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ class InstalledVersions
|
||||
*/
|
||||
public static function satisfies(VersionParser $parser, $packageName, $constraint)
|
||||
{
|
||||
$constraint = $parser->parseConstraints((string) $constraint);
|
||||
$constraint = $parser->parseConstraints($constraint);
|
||||
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
|
||||
|
||||
return $provided->matches($constraint);
|
||||
@ -328,9 +328,7 @@ class InstalledVersions
|
||||
if (isset(self::$installedByVendor[$vendorDir])) {
|
||||
$installed[] = self::$installedByVendor[$vendorDir];
|
||||
} elseif (is_file($vendorDir.'/composer/installed.php')) {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require $vendorDir.'/composer/installed.php';
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = $required;
|
||||
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
|
||||
if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
|
||||
self::$installed = $installed[count($installed) - 1];
|
||||
}
|
||||
@ -342,17 +340,12 @@ class InstalledVersions
|
||||
// only require the installed.php file if this file is loaded from its dumped location,
|
||||
// and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
|
||||
if (substr(__DIR__, -8, 1) !== 'C') {
|
||||
/** @var array{root: array{name: string, pretty_version: string, version: string, reference: string|null, type: string, install_path: string, aliases: string[], dev: bool}, versions: array<string, array{pretty_version?: string, version?: string, reference?: string|null, type?: string, install_path?: string, aliases?: string[], dev_requirement: bool, replaced?: string[], provided?: string[]}>} $required */
|
||||
$required = require __DIR__ . '/installed.php';
|
||||
self::$installed = $required;
|
||||
self::$installed = require __DIR__ . '/installed.php';
|
||||
} else {
|
||||
self::$installed = array();
|
||||
}
|
||||
}
|
||||
|
||||
if (self::$installed !== array()) {
|
||||
$installed[] = self::$installed;
|
||||
}
|
||||
$installed[] = self::$installed;
|
||||
|
||||
return $installed;
|
||||
}
|
||||
|
||||
11
vendor/composer/autoload_classmap.php
vendored
11
vendor/composer/autoload_classmap.php
vendored
@ -1706,12 +1706,11 @@ return array(
|
||||
'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/MethodNameMatch.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/ParametersMatch.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/Stub.php',
|
||||
'PHPUnit\\Framework\\MockObject\\CannotUseAddMethodsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\CannotUseOnlyMethodsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php',
|
||||
'PHPUnit\\Framework\\MockObject\\DoubledCloneMethod' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/DoubledCloneMethod.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Exception' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\ClassAlreadyExistsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassAlreadyExistsException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\CannotUseAddMethodsException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/CannotUseAddMethodsException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsEnumerationException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsEnumerationException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsFinalException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsFinalException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsReadonlyException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsReadonlyException.php',
|
||||
@ -1724,6 +1723,7 @@ return array(
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\MockMethodSet' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockMethodSet.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\MockTrait' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockTrait.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\MockType' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockType.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\NameAlreadyInUseException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/NameAlreadyInUseException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\OriginalConstructorInvocationRequiredException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/OriginalConstructorInvocationRequiredException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\ReflectionException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ReflectionException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\RuntimeException' => $vendorDir . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/RuntimeException.php',
|
||||
@ -1950,7 +1950,7 @@ return array(
|
||||
'PHPUnit\\Runner\\ClassDoesNotExtendTestCaseException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExtendTestCaseException.php',
|
||||
'PHPUnit\\Runner\\ClassIsAbstractException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ClassIsAbstractException.php',
|
||||
'PHPUnit\\Runner\\CodeCoverage' => $vendorDir . '/phpunit/phpunit/src/Runner/CodeCoverage.php',
|
||||
'PHPUnit\\Runner\\DirectoryCannotBeCreatedException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/DirectoryCannotBeCreatedException.php',
|
||||
'PHPUnit\\Runner\\DirectoryDoesNotExistException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/DirectoryDoesNotExistException.php',
|
||||
'PHPUnit\\Runner\\ErrorException' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/ErrorException.php',
|
||||
'PHPUnit\\Runner\\ErrorHandler' => $vendorDir . '/phpunit/phpunit/src/Runner/ErrorHandler.php',
|
||||
'PHPUnit\\Runner\\Exception' => $vendorDir . '/phpunit/phpunit/src/Runner/Exception/Exception.php',
|
||||
@ -2027,6 +2027,7 @@ return array(
|
||||
'PHPUnit\\TestRunner\\TestResult\\TestTriggeredPhpunitWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php',
|
||||
'PHPUnit\\TestRunner\\TestResult\\TestTriggeredWarningSubscriber' => $vendorDir . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredWarningSubscriber.php',
|
||||
'PHPUnit\\TextUI\\Application' => $vendorDir . '/phpunit/phpunit/src/TextUI/Application.php',
|
||||
'PHPUnit\\TextUI\\CannotOpenSocketException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/CannotOpenSocketException.php',
|
||||
'PHPUnit\\TextUI\\CliArguments\\Builder' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Builder.php',
|
||||
'PHPUnit\\TextUI\\CliArguments\\Configuration' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Configuration.php',
|
||||
'PHPUnit\\TextUI\\CliArguments\\Exception' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Exception.php',
|
||||
@ -2103,7 +2104,6 @@ return array(
|
||||
'PHPUnit\\TextUI\\Configuration\\Variable' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/Variable.php',
|
||||
'PHPUnit\\TextUI\\Configuration\\VariableCollection' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/VariableCollection.php',
|
||||
'PHPUnit\\TextUI\\Configuration\\VariableCollectionIterator' => $vendorDir . '/phpunit/phpunit/src/TextUI/Configuration/Value/VariableCollectionIterator.php',
|
||||
'PHPUnit\\TextUI\\DirectoryDoesNotExistException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/DirectoryDoesNotExistException.php',
|
||||
'PHPUnit\\TextUI\\Exception' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/Exception.php',
|
||||
'PHPUnit\\TextUI\\ExtensionsNotConfiguredException' => $vendorDir . '/phpunit/phpunit/src/TextUI/Exception/ExtensionsNotConfiguredException.php',
|
||||
'PHPUnit\\TextUI\\Help' => $vendorDir . '/phpunit/phpunit/src/TextUI/Help.php',
|
||||
@ -2506,6 +2506,7 @@ return array(
|
||||
'PhpCsFixer\\Fixer\\Comment\\SingleLineCommentSpacingFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentSpacingFixer.php',
|
||||
'PhpCsFixer\\Fixer\\Comment\\SingleLineCommentStyleFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php',
|
||||
'PhpCsFixer\\Fixer\\ConfigurableFixerInterface' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerInterface.php',
|
||||
'PhpCsFixer\\Fixer\\ConfigurableFixerTrait' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerTrait.php',
|
||||
'PhpCsFixer\\Fixer\\ConstantNotation\\NativeConstantInvocationFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php',
|
||||
'PhpCsFixer\\Fixer\\ControlStructure\\ControlStructureBracesFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureBracesFixer.php',
|
||||
'PhpCsFixer\\Fixer\\ControlStructure\\ControlStructureContinuationPositionFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureContinuationPositionFixer.php',
|
||||
@ -2568,6 +2569,7 @@ return array(
|
||||
'PhpCsFixer\\Fixer\\Import\\SingleImportPerStatementFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php',
|
||||
'PhpCsFixer\\Fixer\\Import\\SingleLineAfterImportsFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php',
|
||||
'PhpCsFixer\\Fixer\\Indentation' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php',
|
||||
'PhpCsFixer\\Fixer\\InternalFixerInterface' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/InternalFixerInterface.php',
|
||||
'PhpCsFixer\\Fixer\\LanguageConstruct\\ClassKeywordFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php',
|
||||
'PhpCsFixer\\Fixer\\LanguageConstruct\\ClassKeywordRemoveFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php',
|
||||
'PhpCsFixer\\Fixer\\LanguageConstruct\\CombineConsecutiveIssetsFixer' => $vendorDir . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php',
|
||||
@ -4646,7 +4648,6 @@ return array(
|
||||
'Symfony\\Component\\Process\\Exception\\LogicException' => $vendorDir . '/symfony/process/Exception/LogicException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\ProcessFailedException' => $vendorDir . '/symfony/process/Exception/ProcessFailedException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\ProcessSignaledException' => $vendorDir . '/symfony/process/Exception/ProcessSignaledException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\ProcessStartFailedException' => $vendorDir . '/symfony/process/Exception/ProcessStartFailedException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => $vendorDir . '/symfony/process/Exception/ProcessTimedOutException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\RunProcessFailedException' => $vendorDir . '/symfony/process/Exception/RunProcessFailedException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\RuntimeException' => $vendorDir . '/symfony/process/Exception/RuntimeException.php',
|
||||
|
||||
2
vendor/composer/autoload_files.php
vendored
2
vendor/composer/autoload_files.php
vendored
@ -7,8 +7,8 @@ $baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
|
||||
6
vendor/composer/autoload_real.php
vendored
6
vendor/composer/autoload_real.php
vendored
@ -34,15 +34,15 @@ class ComposerAutoloaderInitc8496d4dbcc79fa0e3d8c5678a3ba3c2
|
||||
$loader->register(true);
|
||||
|
||||
$filesToLoad = \Composer\Autoload\ComposerStaticInitc8496d4dbcc79fa0e3d8c5678a3ba3c2::$files;
|
||||
$requireFile = \Closure::bind(static function ($fileIdentifier, $file) {
|
||||
$requireFile = static function ($fileIdentifier, $file) {
|
||||
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
|
||||
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
|
||||
|
||||
require $file;
|
||||
}
|
||||
}, null, null);
|
||||
};
|
||||
foreach ($filesToLoad as $fileIdentifier => $file) {
|
||||
$requireFile($fileIdentifier, $file);
|
||||
($requireFile)($fileIdentifier, $file);
|
||||
}
|
||||
|
||||
return $loader;
|
||||
|
||||
13
vendor/composer/autoload_static.php
vendored
13
vendor/composer/autoload_static.php
vendored
@ -8,8 +8,8 @@ class ComposerStaticInitc8496d4dbcc79fa0e3d8c5678a3ba3c2
|
||||
{
|
||||
public static $files = array (
|
||||
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
|
||||
'8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
|
||||
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
|
||||
@ -2044,12 +2044,11 @@ class ComposerStaticInitc8496d4dbcc79fa0e3d8c5678a3ba3c2
|
||||
'PHPUnit\\Framework\\MockObject\\Builder\\MethodNameMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/MethodNameMatch.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Builder\\ParametersMatch' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/ParametersMatch.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Builder\\Stub' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Builder/Stub.php',
|
||||
'PHPUnit\\Framework\\MockObject\\CannotUseAddMethodsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseAddMethodsException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\CannotUseOnlyMethodsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/CannotUseOnlyMethodsException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\ConfigurableMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/ConfigurableMethod.php',
|
||||
'PHPUnit\\Framework\\MockObject\\DoubledCloneMethod' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Runtime/Api/DoubledCloneMethod.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Exception/Exception.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\ClassAlreadyExistsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassAlreadyExistsException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\CannotUseAddMethodsException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/CannotUseAddMethodsException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsEnumerationException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsEnumerationException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsFinalException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsFinalException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\ClassIsReadonlyException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ClassIsReadonlyException.php',
|
||||
@ -2062,6 +2061,7 @@ class ComposerStaticInitc8496d4dbcc79fa0e3d8c5678a3ba3c2
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\MockMethodSet' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockMethodSet.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\MockTrait' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockTrait.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\MockType' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/MockType.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\NameAlreadyInUseException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/NameAlreadyInUseException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\OriginalConstructorInvocationRequiredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/OriginalConstructorInvocationRequiredException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\ReflectionException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/ReflectionException.php',
|
||||
'PHPUnit\\Framework\\MockObject\\Generator\\RuntimeException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Framework/MockObject/Generator/Exception/RuntimeException.php',
|
||||
@ -2288,7 +2288,7 @@ class ComposerStaticInitc8496d4dbcc79fa0e3d8c5678a3ba3c2
|
||||
'PHPUnit\\Runner\\ClassDoesNotExtendTestCaseException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ClassDoesNotExtendTestCaseException.php',
|
||||
'PHPUnit\\Runner\\ClassIsAbstractException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ClassIsAbstractException.php',
|
||||
'PHPUnit\\Runner\\CodeCoverage' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/CodeCoverage.php',
|
||||
'PHPUnit\\Runner\\DirectoryCannotBeCreatedException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/DirectoryCannotBeCreatedException.php',
|
||||
'PHPUnit\\Runner\\DirectoryDoesNotExistException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/DirectoryDoesNotExistException.php',
|
||||
'PHPUnit\\Runner\\ErrorException' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/ErrorException.php',
|
||||
'PHPUnit\\Runner\\ErrorHandler' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/ErrorHandler.php',
|
||||
'PHPUnit\\Runner\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/Exception/Exception.php',
|
||||
@ -2365,6 +2365,7 @@ class ComposerStaticInitc8496d4dbcc79fa0e3d8c5678a3ba3c2
|
||||
'PHPUnit\\TestRunner\\TestResult\\TestTriggeredPhpunitWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredPhpunitWarningSubscriber.php',
|
||||
'PHPUnit\\TestRunner\\TestResult\\TestTriggeredWarningSubscriber' => __DIR__ . '/..' . '/phpunit/phpunit/src/Runner/TestResult/Subscriber/TestTriggeredWarningSubscriber.php',
|
||||
'PHPUnit\\TextUI\\Application' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Application.php',
|
||||
'PHPUnit\\TextUI\\CannotOpenSocketException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/CannotOpenSocketException.php',
|
||||
'PHPUnit\\TextUI\\CliArguments\\Builder' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Builder.php',
|
||||
'PHPUnit\\TextUI\\CliArguments\\Configuration' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Configuration.php',
|
||||
'PHPUnit\\TextUI\\CliArguments\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Cli/Exception.php',
|
||||
@ -2441,7 +2442,6 @@ class ComposerStaticInitc8496d4dbcc79fa0e3d8c5678a3ba3c2
|
||||
'PHPUnit\\TextUI\\Configuration\\Variable' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/Variable.php',
|
||||
'PHPUnit\\TextUI\\Configuration\\VariableCollection' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/VariableCollection.php',
|
||||
'PHPUnit\\TextUI\\Configuration\\VariableCollectionIterator' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Configuration/Value/VariableCollectionIterator.php',
|
||||
'PHPUnit\\TextUI\\DirectoryDoesNotExistException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/DirectoryDoesNotExistException.php',
|
||||
'PHPUnit\\TextUI\\Exception' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/Exception.php',
|
||||
'PHPUnit\\TextUI\\ExtensionsNotConfiguredException' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Exception/ExtensionsNotConfiguredException.php',
|
||||
'PHPUnit\\TextUI\\Help' => __DIR__ . '/..' . '/phpunit/phpunit/src/TextUI/Help.php',
|
||||
@ -2844,6 +2844,7 @@ class ComposerStaticInitc8496d4dbcc79fa0e3d8c5678a3ba3c2
|
||||
'PhpCsFixer\\Fixer\\Comment\\SingleLineCommentSpacingFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentSpacingFixer.php',
|
||||
'PhpCsFixer\\Fixer\\Comment\\SingleLineCommentStyleFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Comment/SingleLineCommentStyleFixer.php',
|
||||
'PhpCsFixer\\Fixer\\ConfigurableFixerInterface' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerInterface.php',
|
||||
'PhpCsFixer\\Fixer\\ConfigurableFixerTrait' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ConfigurableFixerTrait.php',
|
||||
'PhpCsFixer\\Fixer\\ConstantNotation\\NativeConstantInvocationFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php',
|
||||
'PhpCsFixer\\Fixer\\ControlStructure\\ControlStructureBracesFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureBracesFixer.php',
|
||||
'PhpCsFixer\\Fixer\\ControlStructure\\ControlStructureContinuationPositionFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/ControlStructure/ControlStructureContinuationPositionFixer.php',
|
||||
@ -2906,6 +2907,7 @@ class ComposerStaticInitc8496d4dbcc79fa0e3d8c5678a3ba3c2
|
||||
'PhpCsFixer\\Fixer\\Import\\SingleImportPerStatementFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleImportPerStatementFixer.php',
|
||||
'PhpCsFixer\\Fixer\\Import\\SingleLineAfterImportsFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Import/SingleLineAfterImportsFixer.php',
|
||||
'PhpCsFixer\\Fixer\\Indentation' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/Indentation.php',
|
||||
'PhpCsFixer\\Fixer\\InternalFixerInterface' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/InternalFixerInterface.php',
|
||||
'PhpCsFixer\\Fixer\\LanguageConstruct\\ClassKeywordFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordFixer.php',
|
||||
'PhpCsFixer\\Fixer\\LanguageConstruct\\ClassKeywordRemoveFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/ClassKeywordRemoveFixer.php',
|
||||
'PhpCsFixer\\Fixer\\LanguageConstruct\\CombineConsecutiveIssetsFixer' => __DIR__ . '/..' . '/friendsofphp/php-cs-fixer/src/Fixer/LanguageConstruct/CombineConsecutiveIssetsFixer.php',
|
||||
@ -4984,7 +4986,6 @@ class ComposerStaticInitc8496d4dbcc79fa0e3d8c5678a3ba3c2
|
||||
'Symfony\\Component\\Process\\Exception\\LogicException' => __DIR__ . '/..' . '/symfony/process/Exception/LogicException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\ProcessFailedException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessFailedException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\ProcessSignaledException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessSignaledException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\ProcessStartFailedException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessStartFailedException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => __DIR__ . '/..' . '/symfony/process/Exception/ProcessTimedOutException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\RunProcessFailedException' => __DIR__ . '/..' . '/symfony/process/Exception/RunProcessFailedException.php',
|
||||
'Symfony\\Component\\Process\\Exception\\RuntimeException' => __DIR__ . '/..' . '/symfony/process/Exception/RuntimeException.php',
|
||||
|
||||
528
vendor/composer/installed.json
vendored
528
vendor/composer/installed.json
vendored
File diff suppressed because it is too large
Load Diff
160
vendor/composer/installed.php
vendored
160
vendor/composer/installed.php
vendored
@ -3,7 +3,7 @@
|
||||
'name' => 'codeigniter4/framework',
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '098af23078d3ab437ca2e8e7967b31274e185653',
|
||||
'reference' => 'bbb89d27e6e055d07faa359bddec81032352d85e',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
@ -20,9 +20,9 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'codeigniter/coding-standard' => array(
|
||||
'pretty_version' => 'v1.7.16',
|
||||
'version' => '1.7.16.0',
|
||||
'reference' => '8b2c0de625e4b5c9d7cd3c0b34bc30fba61a86ea',
|
||||
'pretty_version' => 'v1.8.0',
|
||||
'version' => '1.8.0.0',
|
||||
'reference' => 'a523fd030be6360123a88655f39f0eb1650ee4bf',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../codeigniter/coding-standard',
|
||||
'aliases' => array(),
|
||||
@ -31,7 +31,7 @@
|
||||
'codeigniter4/framework' => array(
|
||||
'pretty_version' => 'dev-master',
|
||||
'version' => 'dev-master',
|
||||
'reference' => '098af23078d3ab437ca2e8e7967b31274e185653',
|
||||
'reference' => 'bbb89d27e6e055d07faa359bddec81032352d85e',
|
||||
'type' => 'project',
|
||||
'install_path' => __DIR__ . '/../../',
|
||||
'aliases' => array(),
|
||||
@ -47,9 +47,9 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'composer/semver' => array(
|
||||
'pretty_version' => '3.4.0',
|
||||
'version' => '3.4.0.0',
|
||||
'reference' => '35e8d0af4486141bc745f23a29cc2091eb624a32',
|
||||
'pretty_version' => '3.4.2',
|
||||
'version' => '3.4.2.0',
|
||||
'reference' => 'c51258e759afdb17f1fd1fe83bc12baaef6309d6',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/./semver',
|
||||
'aliases' => array(),
|
||||
@ -92,9 +92,9 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'friendsofphp/php-cs-fixer' => array(
|
||||
'pretty_version' => 'v3.58.1',
|
||||
'version' => '3.58.1.0',
|
||||
'reference' => '04e9424025677a86914b9a4944dbbf4060bb0aff',
|
||||
'pretty_version' => 'v3.59.3',
|
||||
'version' => '3.59.3.0',
|
||||
'reference' => '30ba9ecc2b0e5205e578fe29973c15653d9bfd29',
|
||||
'type' => 'application',
|
||||
'install_path' => __DIR__ . '/../friendsofphp/php-cs-fixer',
|
||||
'aliases' => array(),
|
||||
@ -155,9 +155,9 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'mpdf/mpdf' => array(
|
||||
'pretty_version' => 'v8.2.3',
|
||||
'version' => '8.2.3.0',
|
||||
'reference' => '6f723a96becf989a831e38caf758d28364a69939',
|
||||
'pretty_version' => 'v8.2.4',
|
||||
'version' => '8.2.4.0',
|
||||
'reference' => '9e3ff91606fed11cd58a130eabaaf60e56fdda88',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../mpdf/mpdf',
|
||||
'aliases' => array(),
|
||||
@ -182,27 +182,27 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'myclabs/deep-copy' => array(
|
||||
'pretty_version' => '1.11.1',
|
||||
'version' => '1.11.1.0',
|
||||
'reference' => '7284c22080590fb39f2ffa3e9057f10a4ddd0e0c',
|
||||
'pretty_version' => '1.12.0',
|
||||
'version' => '1.12.0.0',
|
||||
'reference' => '3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../myclabs/deep-copy',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'nexusphp/cs-config' => array(
|
||||
'pretty_version' => 'v3.18.0',
|
||||
'version' => '3.18.0.0',
|
||||
'reference' => '8187fab52c7c4822579e3bbcb3c8bee0c0058b05',
|
||||
'pretty_version' => 'v3.23.1',
|
||||
'version' => '3.23.1.0',
|
||||
'reference' => '323c8ca9c86a85d8cf9990e95079a7734bfbf4e6',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../nexusphp/cs-config',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'nikic/php-parser' => array(
|
||||
'pretty_version' => 'v5.0.2',
|
||||
'version' => '5.0.2.0',
|
||||
'reference' => '139676794dc1e9231bf7bcd123cfc0c99182cb13',
|
||||
'pretty_version' => 'v5.1.0',
|
||||
'version' => '5.1.0.0',
|
||||
'reference' => '683130c2ff8c2739f4822ff7ac5c873ec529abd1',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../nikic/php-parser',
|
||||
'aliases' => array(),
|
||||
@ -236,18 +236,18 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'phpoffice/phpspreadsheet' => array(
|
||||
'pretty_version' => '2.1.0',
|
||||
'version' => '2.1.0.0',
|
||||
'reference' => 'dbed77bd3a0f68f96c0dd68ad4499d5674fecc3e',
|
||||
'pretty_version' => '2.2.0',
|
||||
'version' => '2.2.0.0',
|
||||
'reference' => 'b0993b7e4d9c860133365d115b176bc6e0f57022',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../phpoffice/phpspreadsheet',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'phpunit/php-code-coverage' => array(
|
||||
'pretty_version' => '10.1.14',
|
||||
'version' => '10.1.14.0',
|
||||
'reference' => 'e3f51450ebffe8e0efdf7346ae966a656f7d5e5b',
|
||||
'pretty_version' => '10.1.15',
|
||||
'version' => '10.1.15.0',
|
||||
'reference' => '5da8b1728acd1e6ffdf2ff32ffbdfd04307f26ae',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../phpunit/php-code-coverage',
|
||||
'aliases' => array(),
|
||||
@ -290,9 +290,9 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'phpunit/phpunit' => array(
|
||||
'pretty_version' => '10.5.20',
|
||||
'version' => '10.5.20.0',
|
||||
'reference' => '547d314dc24ec1e177720d45c6263fb226cc2ae3',
|
||||
'pretty_version' => '10.5.28',
|
||||
'version' => '10.5.28.0',
|
||||
'reference' => 'ff7fb85cdf88131b83e721fb2a327b664dbed275',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../phpunit/phpunit',
|
||||
'aliases' => array(),
|
||||
@ -401,9 +401,9 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'react/dns' => array(
|
||||
'pretty_version' => 'v1.12.0',
|
||||
'version' => '1.12.0.0',
|
||||
'reference' => 'c134600642fa615b46b41237ef243daa65bb64ec',
|
||||
'pretty_version' => 'v1.13.0',
|
||||
'version' => '1.13.0.0',
|
||||
'reference' => 'eb8ae001b5a455665c89c1df97f6fb682f8fb0f5',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../react/dns',
|
||||
'aliases' => array(),
|
||||
@ -437,9 +437,9 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'react/stream' => array(
|
||||
'pretty_version' => 'v1.3.0',
|
||||
'version' => '1.3.0.0',
|
||||
'reference' => '6fbc9672905c7d5a885f2da2fc696f65840f4a66',
|
||||
'pretty_version' => 'v1.4.0',
|
||||
'version' => '1.4.0.0',
|
||||
'reference' => '1e5b0acb8fe55143b5b426817155190eb6f5b18d',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../react/stream',
|
||||
'aliases' => array(),
|
||||
@ -590,9 +590,9 @@
|
||||
'dev_requirement' => false,
|
||||
),
|
||||
'symfony/console' => array(
|
||||
'pretty_version' => 'v7.1.1',
|
||||
'version' => '7.1.1.0',
|
||||
'reference' => '9b008f2d7b21c74ef4d0c3de6077a642bc55ece3',
|
||||
'pretty_version' => 'v6.4.9',
|
||||
'version' => '6.4.9.0',
|
||||
'reference' => '6edb5363ec0c78ad4d48c5128ebf4d083d89d3a9',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/console',
|
||||
'aliases' => array(),
|
||||
@ -608,9 +608,9 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/event-dispatcher' => array(
|
||||
'pretty_version' => 'v7.1.1',
|
||||
'version' => '7.1.1.0',
|
||||
'reference' => '9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7',
|
||||
'pretty_version' => 'v6.4.8',
|
||||
'version' => '6.4.8.0',
|
||||
'reference' => '8d7507f02b06e06815e56bb39aa0128e3806208b',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/event-dispatcher',
|
||||
'aliases' => array(),
|
||||
@ -632,90 +632,90 @@
|
||||
),
|
||||
),
|
||||
'symfony/filesystem' => array(
|
||||
'pretty_version' => 'v7.1.1',
|
||||
'version' => '7.1.1.0',
|
||||
'reference' => '802e87002f919296c9f606457d9fa327a0b3d6b2',
|
||||
'pretty_version' => 'v6.4.9',
|
||||
'version' => '6.4.9.0',
|
||||
'reference' => 'b51ef8059159330b74a4d52f68e671033c0fe463',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/filesystem',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/finder' => array(
|
||||
'pretty_version' => 'v7.1.1',
|
||||
'version' => '7.1.1.0',
|
||||
'reference' => 'fbb0ba67688b780efbc886c1a0a0948dcf7205d6',
|
||||
'pretty_version' => 'v6.4.8',
|
||||
'version' => '6.4.8.0',
|
||||
'reference' => '3ef977a43883215d560a2cecb82ec8e62131471c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/finder',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/options-resolver' => array(
|
||||
'pretty_version' => 'v7.1.1',
|
||||
'version' => '7.1.1.0',
|
||||
'reference' => '47aa818121ed3950acd2b58d1d37d08a94f9bf55',
|
||||
'pretty_version' => 'v6.4.8',
|
||||
'version' => '6.4.8.0',
|
||||
'reference' => '22ab9e9101ab18de37839074f8a1197f55590c1b',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/options-resolver',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/polyfill-ctype' => array(
|
||||
'pretty_version' => 'v1.29.0',
|
||||
'version' => '1.29.0.0',
|
||||
'reference' => 'ef4d7e442ca910c4764bce785146269b30cb5fc4',
|
||||
'pretty_version' => 'v1.30.0',
|
||||
'version' => '1.30.0.0',
|
||||
'reference' => '0424dff1c58f028c451efff2045f5d92410bd540',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/polyfill-intl-grapheme' => array(
|
||||
'pretty_version' => 'v1.29.0',
|
||||
'version' => '1.29.0.0',
|
||||
'reference' => '32a9da87d7b3245e09ac426c83d334ae9f06f80f',
|
||||
'pretty_version' => 'v1.30.0',
|
||||
'version' => '1.30.0.0',
|
||||
'reference' => '64647a7c30b2283f5d49b874d84a18fc22054b7a',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/polyfill-intl-normalizer' => array(
|
||||
'pretty_version' => 'v1.29.0',
|
||||
'version' => '1.29.0.0',
|
||||
'reference' => 'bc45c394692b948b4d383a08d7753968bed9a83d',
|
||||
'pretty_version' => 'v1.30.0',
|
||||
'version' => '1.30.0.0',
|
||||
'reference' => 'a95281b0be0d9ab48050ebd988b967875cdb9fdb',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/polyfill-mbstring' => array(
|
||||
'pretty_version' => 'v1.29.0',
|
||||
'version' => '1.29.0.0',
|
||||
'reference' => '9773676c8a1bb1f8d4340a62efe641cf76eda7ec',
|
||||
'pretty_version' => 'v1.30.0',
|
||||
'version' => '1.30.0.0',
|
||||
'reference' => 'fd22ab50000ef01661e2a31d850ebaa297f8e03c',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/polyfill-php80' => array(
|
||||
'pretty_version' => 'v1.29.0',
|
||||
'version' => '1.29.0.0',
|
||||
'reference' => '87b68208d5c1188808dd7839ee1e6c8ec3b02f1b',
|
||||
'pretty_version' => 'v1.30.0',
|
||||
'version' => '1.30.0.0',
|
||||
'reference' => '77fa7995ac1b21ab60769b7323d600a991a90433',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-php80',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/polyfill-php81' => array(
|
||||
'pretty_version' => 'v1.29.0',
|
||||
'version' => '1.29.0.0',
|
||||
'reference' => 'c565ad1e63f30e7477fc40738343c62b40bc672d',
|
||||
'pretty_version' => 'v1.30.0',
|
||||
'version' => '1.30.0.0',
|
||||
'reference' => '3fb075789fb91f9ad9af537c4012d523085bd5af',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/polyfill-php81',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/process' => array(
|
||||
'pretty_version' => 'v7.1.1',
|
||||
'version' => '7.1.1.0',
|
||||
'reference' => 'febf90124323a093c7ee06fdb30e765ca3c20028',
|
||||
'pretty_version' => 'v6.4.8',
|
||||
'version' => '6.4.8.0',
|
||||
'reference' => '8d92dd79149f29e89ee0f480254db595f6a6a2c5',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/process',
|
||||
'aliases' => array(),
|
||||
@ -731,18 +731,18 @@
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/stopwatch' => array(
|
||||
'pretty_version' => 'v7.1.1',
|
||||
'version' => '7.1.1.0',
|
||||
'reference' => '5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d',
|
||||
'pretty_version' => 'v6.4.8',
|
||||
'version' => '6.4.8.0',
|
||||
'reference' => '63e069eb616049632cde9674c46957819454b8aa',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/stopwatch',
|
||||
'aliases' => array(),
|
||||
'dev_requirement' => true,
|
||||
),
|
||||
'symfony/string' => array(
|
||||
'pretty_version' => 'v7.1.1',
|
||||
'version' => '7.1.1.0',
|
||||
'reference' => '60bc311c74e0af215101235aa6f471bcbc032df2',
|
||||
'pretty_version' => 'v6.4.9',
|
||||
'version' => '6.4.9.0',
|
||||
'reference' => '76792dbd99690a5ebef8050d9206c60c59e681d7',
|
||||
'type' => 'library',
|
||||
'install_path' => __DIR__ . '/../symfony/string',
|
||||
'aliases' => array(),
|
||||
|
||||
4
vendor/composer/platform_check.php
vendored
4
vendor/composer/platform_check.php
vendored
@ -8,10 +8,6 @@ if (!(PHP_VERSION_ID >= 80100)) {
|
||||
$issues[] = 'Your Composer dependencies require a PHP version ">= 8.1.0". You are running ' . PHP_VERSION . '.';
|
||||
}
|
||||
|
||||
if (PHP_INT_SIZE !== 8) {
|
||||
$issues[] = 'Your Composer dependencies require a 64-bit build of PHP.';
|
||||
}
|
||||
|
||||
if ($issues) {
|
||||
if (!headers_sent()) {
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
|
||||
10
vendor/composer/semver/CHANGELOG.md
vendored
10
vendor/composer/semver/CHANGELOG.md
vendored
@ -3,6 +3,14 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
### [3.4.2] 2024-07-12
|
||||
|
||||
* Fixed PHP 5.3 syntax error
|
||||
|
||||
### [3.4.1] 2024-07-12
|
||||
|
||||
* Fixed normalizeStability's return type to enforce valid stabilities
|
||||
|
||||
### [3.4.0] 2023-08-31
|
||||
|
||||
* Support larger major version numbers (#149)
|
||||
@ -179,6 +187,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- Namespace: `Composer\Test\Package\LinkConstraint` -> `Composer\Test\Semver\Constraint`
|
||||
* Changed: code style using php-cs-fixer.
|
||||
|
||||
[3.4.2]: https://github.com/composer/semver/compare/3.4.1...3.4.2
|
||||
[3.4.1]: https://github.com/composer/semver/compare/3.4.0...3.4.1
|
||||
[3.4.0]: https://github.com/composer/semver/compare/3.3.2...3.4.0
|
||||
[3.3.2]: https://github.com/composer/semver/compare/3.3.1...3.3.2
|
||||
[3.3.1]: https://github.com/composer/semver/compare/3.3.0...3.3.1
|
||||
|
||||
5
vendor/composer/semver/src/VersionParser.php
vendored
5
vendor/composer/semver/src/VersionParser.php
vendored
@ -82,11 +82,16 @@ class VersionParser
|
||||
* @param string $stability
|
||||
*
|
||||
* @return string
|
||||
* @phpstan-return 'stable'|'RC'|'beta'|'alpha'|'dev'
|
||||
*/
|
||||
public static function normalizeStability($stability)
|
||||
{
|
||||
$stability = strtolower((string) $stability);
|
||||
|
||||
if (!in_array($stability, array('stable', 'rc', 'beta', 'alpha', 'dev'), true)) {
|
||||
throw new \InvalidArgumentException('Invalid stability string "'.$stability.'", expected one of stable, RC, beta, alpha or dev');
|
||||
}
|
||||
|
||||
return $stability === 'rc' ? 'RC' : $stability;
|
||||
}
|
||||
|
||||
|
||||
35
vendor/friendsofphp/php-cs-fixer/CHANGELOG.md
vendored
35
vendor/friendsofphp/php-cs-fixer/CHANGELOG.md
vendored
@ -3,6 +3,41 @@ CHANGELOG for PHP CS Fixer
|
||||
|
||||
This file contains changelogs for stable releases only.
|
||||
|
||||
Changelog for v3.59.3
|
||||
---------------------
|
||||
|
||||
* refactor: refactor to templated trait+interface (#7988)
|
||||
|
||||
Changelog for v3.59.2
|
||||
---------------------
|
||||
|
||||
* fix: "list" is reserved type (#8087)
|
||||
* chore: add missing type in method prototype (#8088)
|
||||
* CI: bump Ubuntu version (#8086)
|
||||
* deps: bump infection to unblock PHPUnit 11, and few more as chore (#8083)
|
||||
|
||||
Changelog for v3.59.1
|
||||
---------------------
|
||||
|
||||
* fix: Bump React's JSON decoder buffer size (#8068)
|
||||
* docs: options - handle enums in dicts (#8082)
|
||||
|
||||
Changelog for v3.59.0
|
||||
---------------------
|
||||
|
||||
* feat(Docker): Multi-arch build (support for `arm64`) (#8079)
|
||||
* feat: `@PhpCsFixer` ruleset - normalise implicit backslashes in single quoted strings (#7965)
|
||||
* feat: `SimpleToComplexStringVariableFixer` - support variable being an array (#8064)
|
||||
* fix: Look up for PHPDoc's variable name by only chars allowed in the variables (#8062)
|
||||
* fix: Update `PhpUnitTestCaseStaticMethodCallsFixer::STATIC_METHODS` (#8073)
|
||||
* fix: `native_constant_invocation` - array constants with native constant names (#8008)
|
||||
* chore: update PHPStan (#8060)
|
||||
* CI: Update PHPStan to 1.11.4 (#8074)
|
||||
* docs: don't expose list as config type for dicts (#8081)
|
||||
* docs: Make wording in `final_class` docs less dismissive (#8065)
|
||||
* docs: Update 1-bug_report.yml (#8067)
|
||||
* DX: Remove version from Docker Compose files (#8061)
|
||||
|
||||
Changelog for v3.58.1
|
||||
---------------------
|
||||
|
||||
|
||||
15
vendor/friendsofphp/php-cs-fixer/composer.json
vendored
15
vendor/friendsofphp/php-cs-fixer/composer.json
vendored
@ -46,16 +46,16 @@
|
||||
"symfony/stopwatch": "^5.4 || ^6.0 || ^7.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"facile-it/paraunit": "^1.3 || ^2.0",
|
||||
"infection/infection": "^0.27.11",
|
||||
"facile-it/paraunit": "^1.3 || ^2.3",
|
||||
"infection/infection": "^0.29.5",
|
||||
"justinrainbow/json-schema": "^5.2",
|
||||
"keradus/cli-executor": "^2.1",
|
||||
"mikey179/vfsstream": "^1.6.11",
|
||||
"php-coveralls/php-coveralls": "^2.7",
|
||||
"php-cs-fixer/accessible-object": "^1.1",
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.4",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.4",
|
||||
"phpunit/phpunit": "^9.6 || ^10.5.5 || ^11.0.2",
|
||||
"php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.5",
|
||||
"php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.5",
|
||||
"phpunit/phpunit": "^9.6.19 || ^10.5.21 || ^11.2",
|
||||
"symfony/var-dumper": "^5.4 || ^6.0 || ^7.0",
|
||||
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
|
||||
},
|
||||
@ -66,7 +66,10 @@
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"PhpCsFixer\\": "src/"
|
||||
}
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"src/Fixer/Internal/*"
|
||||
]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
|
||||
@ -26,6 +26,17 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* scalar_types?: bool,
|
||||
* union_types?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* scalar_types: bool,
|
||||
* union_types: bool
|
||||
* }
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*/
|
||||
abstract class AbstractDoctrineAnnotationFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
@ -53,7 +64,7 @@ abstract class AbstractDoctrineAnnotationFixer extends AbstractFixer implements
|
||||
|
||||
$doctrineAnnotationTokens = DoctrineAnnotationTokens::createFromDocComment(
|
||||
$docCommentToken,
|
||||
$this->configuration['ignored_tags']
|
||||
$this->configuration['ignored_tags'] // @phpstan-ignore-line
|
||||
);
|
||||
|
||||
$this->fixAnnotations($doctrineAnnotationTokens);
|
||||
@ -71,15 +82,6 @@ abstract class AbstractDoctrineAnnotationFixer extends AbstractFixer implements
|
||||
return new FixerConfigurationResolver([
|
||||
(new FixerOptionBuilder('ignored_tags', 'List of tags that must not be treated as Doctrine Annotations.'))
|
||||
->setAllowedTypes(['string[]'])
|
||||
->setAllowedValues([static function (array $values): bool {
|
||||
foreach ($values as $value) {
|
||||
if (!\is_string($value)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}])
|
||||
->setDefault([
|
||||
// PHPDocumentor 1
|
||||
'abstract',
|
||||
|
||||
@ -14,19 +14,11 @@ declare(strict_types=1);
|
||||
|
||||
namespace PhpCsFixer;
|
||||
|
||||
use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException;
|
||||
use PhpCsFixer\ConfigurationException\InvalidForEnvFixerConfigurationException;
|
||||
use PhpCsFixer\ConfigurationException\RequiredFixerConfigurationException;
|
||||
use PhpCsFixer\Console\Application;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\FixerInterface;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\DeprecatedFixerOption;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\InvalidOptionsForEnvException;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
use Symfony\Component\OptionsResolver\Exception\ExceptionInterface;
|
||||
use Symfony\Component\OptionsResolver\Exception\MissingOptionsException;
|
||||
|
||||
/**
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
@ -35,21 +27,11 @@ use Symfony\Component\OptionsResolver\Exception\MissingOptionsException;
|
||||
*/
|
||||
abstract class AbstractFixer implements FixerInterface
|
||||
{
|
||||
/**
|
||||
* @var null|array<string, mixed>
|
||||
*/
|
||||
protected $configuration;
|
||||
|
||||
/**
|
||||
* @var WhitespacesFixerConfig
|
||||
*/
|
||||
protected $whitespacesConfig;
|
||||
|
||||
/**
|
||||
* @var null|FixerConfigurationResolverInterface
|
||||
*/
|
||||
private $configurationDefinition;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
if ($this instanceof ConfigurableFixerInterface) {
|
||||
@ -67,7 +49,7 @@ abstract class AbstractFixer implements FixerInterface
|
||||
|
||||
final public function fix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
if ($this instanceof ConfigurableFixerInterface && null === $this->configuration) {
|
||||
if ($this instanceof ConfigurableFixerInterface && property_exists($this, 'configuration') && null === $this->configuration) {
|
||||
throw new RequiredFixerConfigurationException($this->getName(), 'Configuration is required.');
|
||||
}
|
||||
|
||||
@ -99,68 +81,6 @@ abstract class AbstractFixer implements FixerInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<string, mixed> $configuration
|
||||
*/
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
if (!$this instanceof ConfigurableFixerInterface) {
|
||||
throw new \LogicException('Cannot configure using Abstract parent, child not implementing "PhpCsFixer\Fixer\ConfigurableFixerInterface".');
|
||||
}
|
||||
|
||||
foreach ($this->getConfigurationDefinition()->getOptions() as $option) {
|
||||
if (!$option instanceof DeprecatedFixerOption) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$name = $option->getName();
|
||||
if (\array_key_exists($name, $configuration)) {
|
||||
Utils::triggerDeprecation(new \InvalidArgumentException(sprintf(
|
||||
'Option "%s" for rule "%s" is deprecated and will be removed in version %d.0. %s',
|
||||
$name,
|
||||
$this->getName(),
|
||||
Application::getMajorVersion() + 1,
|
||||
str_replace('`', '"', $option->getDeprecationMessage())
|
||||
)));
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
$this->configuration = $this->getConfigurationDefinition()->resolve($configuration);
|
||||
} catch (MissingOptionsException $exception) {
|
||||
throw new RequiredFixerConfigurationException(
|
||||
$this->getName(),
|
||||
sprintf('Missing required configuration: %s', $exception->getMessage()),
|
||||
$exception
|
||||
);
|
||||
} catch (InvalidOptionsForEnvException $exception) {
|
||||
throw new InvalidForEnvFixerConfigurationException(
|
||||
$this->getName(),
|
||||
sprintf('Invalid configuration for env: %s', $exception->getMessage()),
|
||||
$exception
|
||||
);
|
||||
} catch (ExceptionInterface $exception) {
|
||||
throw new InvalidFixerConfigurationException(
|
||||
$this->getName(),
|
||||
sprintf('Invalid configuration: %s', $exception->getMessage()),
|
||||
$exception
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function getConfigurationDefinition(): FixerConfigurationResolverInterface
|
||||
{
|
||||
if (!$this instanceof ConfigurableFixerInterface) {
|
||||
throw new \LogicException(sprintf('Cannot get configuration definition using Abstract parent, child "%s" not implementing "PhpCsFixer\Fixer\ConfigurableFixerInterface".', static::class));
|
||||
}
|
||||
|
||||
if (null === $this->configurationDefinition) {
|
||||
$this->configurationDefinition = $this->createConfigurationDefinition();
|
||||
}
|
||||
|
||||
return $this->configurationDefinition;
|
||||
}
|
||||
|
||||
public function setWhitespacesConfig(WhitespacesFixerConfig $config): void
|
||||
{
|
||||
if (!$this instanceof WhitespacesAwareFixerInterface) {
|
||||
@ -172,15 +92,6 @@ abstract class AbstractFixer implements FixerInterface
|
||||
|
||||
abstract protected function applyFix(\SplFileInfo $file, Tokens $tokens): void;
|
||||
|
||||
protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
|
||||
{
|
||||
if (!$this instanceof ConfigurableFixerInterface) {
|
||||
throw new \LogicException('Cannot create configuration definition using Abstract parent, child not implementing "PhpCsFixer\Fixer\ConfigurableFixerInterface".');
|
||||
}
|
||||
|
||||
throw new \LogicException('Not implemented.');
|
||||
}
|
||||
|
||||
private function getDefaultWhitespacesFixerConfig(): WhitespacesFixerConfig
|
||||
{
|
||||
static $defaultWhitespacesFixerConfig = null;
|
||||
|
||||
@ -18,6 +18,7 @@ use PhpCsFixer\DocBlock\Annotation;
|
||||
use PhpCsFixer\DocBlock\DocBlock;
|
||||
use PhpCsFixer\DocBlock\TypeExpression;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -31,9 +32,22 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
* @internal
|
||||
*
|
||||
* @phpstan-type _CommonTypeInfo array{commonType: string, isNullable: bool}
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* scalar_types?: bool,
|
||||
* union_types?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* scalar_types: bool,
|
||||
* union_types: bool
|
||||
* }
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*/
|
||||
abstract class AbstractPhpdocToTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER
|
||||
.'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)';
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ use Symfony\Component\Console\Output\OutputInterface;
|
||||
final class Application extends BaseApplication
|
||||
{
|
||||
public const NAME = 'PHP CS Fixer';
|
||||
public const VERSION = '3.58.1';
|
||||
public const VERSION = '3.59.3';
|
||||
public const VERSION_CODENAME = '7th Gear';
|
||||
|
||||
private ToolInfo $toolInfo;
|
||||
|
||||
@ -24,6 +24,7 @@ use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
|
||||
use PhpCsFixer\Fixer\ExperimentalFixerInterface;
|
||||
use PhpCsFixer\Fixer\FixerInterface;
|
||||
use PhpCsFixer\Fixer\InternalFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\AliasedFixerOption;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\DeprecatedFixerOption;
|
||||
@ -192,6 +193,13 @@ final class DescribeCommand extends Command
|
||||
$output->writeln('');
|
||||
}
|
||||
|
||||
if ($fixer instanceof InternalFixerInterface) {
|
||||
$output->writeln('<error>Fixer applying this rule is INTERNAL.</error>.');
|
||||
$output->writeln('It is expected to be used only on PHP CS Fixer project itself.');
|
||||
|
||||
$output->writeln('');
|
||||
}
|
||||
|
||||
if ($fixer->isRisky()) {
|
||||
$output->writeln('<error>Fixer applying this rule is RISKY.</error>');
|
||||
|
||||
|
||||
@ -171,14 +171,17 @@ final class Annotation
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
public function getVariableName()
|
||||
public function getVariableName(): ?string
|
||||
{
|
||||
$type = preg_quote($this->getTypesContent() ?? '', '/');
|
||||
$regex = "/@{$this->tag->getName()}\\s+({$type}\\s*)?(&\\s*)?(\\.{3}\\s*)?(?<variable>\\$.+?)(?:[\\s*]|$)/";
|
||||
$regex = sprintf(
|
||||
'/@%s\s+(%s\s*)?(&\s*)?(\.{3}\s*)?(?<variable>\$%s)(?:.*|$)/',
|
||||
$this->tag->getName(),
|
||||
$type,
|
||||
TypeExpression::REGEX_IDENTIFIER
|
||||
);
|
||||
|
||||
if (Preg::match($regex, $this->lines[0]->getContent(), $matches)) {
|
||||
return $matches['variable'];
|
||||
|
||||
@ -167,7 +167,7 @@ final class FixerDocumentGenerator
|
||||
if (null === $allowed) {
|
||||
$allowedKind = 'Allowed types';
|
||||
$allowed = array_map(
|
||||
static fn (string $value): string => '``'.(str_ends_with($value, '[]') ? sprintf('list<%s>', substr($value, 0, -2)) : $value).'``',
|
||||
static fn (string $value): string => '``'.Utils::convertArrayTypeToList($value).'``',
|
||||
$option->getAllowedTypes(),
|
||||
);
|
||||
} else {
|
||||
|
||||
@ -138,6 +138,7 @@ abstract class AbstractPhpUnitFixer extends AbstractFixer
|
||||
}
|
||||
}
|
||||
$doc = $this->makeDocBlockMultiLineIfNeeded($doc, $tokens, $docBlockIndex, $annotation);
|
||||
|
||||
$lines = $this->addInternalAnnotation($doc, $tokens, $docBlockIndex, $annotation);
|
||||
$lines = implode('', $lines);
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Alias;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -31,9 +32,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
/**
|
||||
* @author Vladimir Reznichenko <kalessil@gmail.com>
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* sets?: list<'@all'|'@exif'|'@ftp'|'@IMAP'|'@internal'|'@ldap'|'@mbreg'|'@mysqli'|'@oci'|'@odbc'|'@openssl'|'@pcntl'|'@pg'|'@posix'|'@snmp'|'@sodium'|'@time'>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* sets: list<'@all'|'@exif'|'@ftp'|'@IMAP'|'@internal'|'@ldap'|'@mbreg'|'@mysqli'|'@oci'|'@odbc'|'@openssl'|'@pcntl'|'@pg'|'@posix'|'@snmp'|'@sodium'|'@time'>
|
||||
* }
|
||||
*/
|
||||
final class NoAliasFunctionsFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
private const SETS = [
|
||||
'@internal' => [
|
||||
'diskfreespace' => 'disk_free_space',
|
||||
@ -160,23 +173,6 @@ final class NoAliasFunctionsFixer extends AbstractFixer implements ConfigurableF
|
||||
*/
|
||||
private array $aliases = [];
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->aliases = [];
|
||||
|
||||
foreach ($this->configuration['sets'] as $set) {
|
||||
if ('@all' === $set) {
|
||||
$this->aliases = array_merge(...array_values(self::SETS));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$this->aliases = array_merge($this->aliases, self::SETS[$set]);
|
||||
}
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -240,6 +236,21 @@ mbereg_search_getregs();
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->aliases = [];
|
||||
|
||||
foreach ($this->configuration['sets'] as $set) {
|
||||
if ('@all' === $set) {
|
||||
$this->aliases = array_merge(...array_values(self::SETS));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
$this->aliases = array_merge($this->aliases, self::SETS[$set]);
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
$functionsAnalyzer = new FunctionsAnalyzer();
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Alias;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -28,21 +29,26 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Sullivan Senechal <soullivaneuh@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* use?: 'echo'|'print'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* use: 'echo'|'print'
|
||||
* }
|
||||
*/
|
||||
final class NoMixedEchoPrintFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var T_ECHO|T_PRINT
|
||||
*/
|
||||
private int $candidateTokenType;
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->candidateTokenType = 'echo' === $this->configuration['use'] ? T_PRINT : T_ECHO;
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -69,6 +75,11 @@ final class NoMixedEchoPrintFixer extends AbstractFixer implements ConfigurableF
|
||||
return $tokens->isTokenKindFound($this->candidateTokenType);
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->candidateTokenType = 'echo' === $this->configuration['use'] ? T_PRINT : T_ECHO;
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
foreach ($tokens as $index => $token) {
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Alias;
|
||||
|
||||
use PhpCsFixer\AbstractFunctionReferenceFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -29,9 +30,21 @@ use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
|
||||
|
||||
/**
|
||||
* @author Vladimir Reznichenko <kalessil@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* replacements?: array<string, string>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* replacements: array<string, string>
|
||||
* }
|
||||
*/
|
||||
final class RandomApiMigrationFixer extends AbstractFunctionReferenceFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var array<string, array<int, int>>
|
||||
*/
|
||||
@ -43,11 +56,6 @@ final class RandomApiMigrationFixer extends AbstractFunctionReferenceFixer imple
|
||||
'random_int' => [0, 2],
|
||||
];
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -119,7 +127,7 @@ final class RandomApiMigrationFixer extends AbstractFunctionReferenceFixer imple
|
||||
{
|
||||
return new FixerConfigurationResolver([
|
||||
(new FixerOptionBuilder('replacements', 'Mapping between replaced functions with the new ones.'))
|
||||
->setAllowedTypes(['array'])
|
||||
->setAllowedTypes(['array<string, string>'])
|
||||
->setAllowedValues([static function (array $value): bool {
|
||||
foreach ($value as $functionName => $replacement) {
|
||||
if (!\array_key_exists($functionName, self::$argumentCounts)) {
|
||||
@ -128,14 +136,6 @@ final class RandomApiMigrationFixer extends AbstractFunctionReferenceFixer imple
|
||||
$functionName
|
||||
));
|
||||
}
|
||||
|
||||
if (!\is_string($replacement)) {
|
||||
throw new InvalidOptionsException(sprintf(
|
||||
'Replacement for function "%s" must be a string, "%s" given.',
|
||||
$functionName,
|
||||
get_debug_type($replacement)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ArrayNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -30,21 +31,26 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
* @author Gregor Harlan <gharlan@web.de>
|
||||
* @author Sebastiaan Stok <s.stok@rollerscapes.net>
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* syntax?: 'long'|'short'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* syntax: 'long'|'short'
|
||||
* }
|
||||
*/
|
||||
final class ArraySyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var CT::T_ARRAY_SQUARE_BRACE_OPEN|T_ARRAY
|
||||
*/
|
||||
private $candidateTokenKind;
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->resolveCandidateTokenKind();
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -76,6 +82,11 @@ final class ArraySyntaxFixer extends AbstractFixer implements ConfigurableFixerI
|
||||
return $tokens->isTokenKindFound($this->candidateTokenKind);
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->resolveCandidateTokenKind();
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
for ($index = $tokens->count() - 1; 0 <= $index; --$index) {
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ArrayNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -27,9 +28,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Adam Marczuk <adam@marczuk.info>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* after_heredoc?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* after_heredoc: bool
|
||||
* }
|
||||
*/
|
||||
final class NoWhitespaceBeforeCommaInArrayFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ArrayNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -29,9 +30,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Adam Marczuk <adam@marczuk.info>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* ensure_single_space?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* ensure_single_space: bool
|
||||
* }
|
||||
*/
|
||||
final class WhitespaceAfterCommaInArrayFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\AttributeNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -28,9 +29,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author HypeMC <hypemc@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* use_parentheses?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* use_parentheses: bool
|
||||
* }
|
||||
*/
|
||||
final class AttributeEmptyParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Basic;
|
||||
|
||||
use PhpCsFixer\AbstractProxyFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\ControlStructure\ControlStructureBracesFixer;
|
||||
use PhpCsFixer\Fixer\ControlStructure\ControlStructureContinuationPositionFixer;
|
||||
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
|
||||
@ -37,9 +38,29 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* allow_single_line_anonymous_class_with_empty_body?: bool,
|
||||
* allow_single_line_closure?: bool,
|
||||
* position_after_anonymous_constructs?: 'next'|'same',
|
||||
* position_after_control_structures?: 'next'|'same',
|
||||
* position_after_functions_and_oop_constructs?: 'next'|'same'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* allow_single_line_anonymous_class_with_empty_body: bool,
|
||||
* allow_single_line_closure: bool,
|
||||
* position_after_anonymous_constructs: 'next'|'same',
|
||||
* position_after_control_structures: 'next'|'same',
|
||||
* position_after_functions_and_oop_constructs: 'next'|'same'
|
||||
* }
|
||||
*/
|
||||
final class BracesFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface, DeprecatedFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@ -152,10 +173,8 @@ class Foo
|
||||
return array_keys($this->proxyFixers);
|
||||
}
|
||||
|
||||
public function configure(array $configuration): void
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->getBracesPositionFixer()->configure([
|
||||
'control_structures_opening_brace' => $this->translatePositionOption($this->configuration['position_after_control_structures']),
|
||||
'functions_opening_brace' => $this->translatePositionOption($this->configuration['position_after_functions_and_oop_constructs']),
|
||||
@ -243,6 +262,9 @@ class Foo
|
||||
return $this->controlStructureContinuationPositionFixer;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BracesPositionFixer::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END|BracesPositionFixer::SAME_LINE
|
||||
*/
|
||||
private function translatePositionOption(string $option): string
|
||||
{
|
||||
return self::LINE_NEXT === $option
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Basic;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\Indentation;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
@ -30,8 +31,33 @@ use PhpCsFixer\Tokenizer\Token;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* allow_single_line_anonymous_functions?: bool,
|
||||
* allow_single_line_empty_anonymous_classes?: bool,
|
||||
* anonymous_classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* anonymous_functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* control_structures_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* allow_single_line_anonymous_functions: bool,
|
||||
* allow_single_line_empty_anonymous_classes: bool,
|
||||
* anonymous_classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* anonymous_functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* control_structures_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line'
|
||||
* }
|
||||
*/
|
||||
final class BracesPositionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
use Indentation;
|
||||
|
||||
/**
|
||||
@ -144,6 +170,41 @@ $bar = function () { $result = true;
|
||||
return -2;
|
||||
}
|
||||
|
||||
/** @protected */
|
||||
public function createConfigurationDefinition(): FixerConfigurationResolverInterface
|
||||
{
|
||||
return new FixerConfigurationResolver([
|
||||
(new FixerOptionBuilder('control_structures_opening_brace', 'The position of the opening brace of control structures‘ body.'))
|
||||
->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE])
|
||||
->setDefault(self::SAME_LINE)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('functions_opening_brace', 'The position of the opening brace of functions‘ body.'))
|
||||
->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE])
|
||||
->setDefault(self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('anonymous_functions_opening_brace', 'The position of the opening brace of anonymous functions‘ body.'))
|
||||
->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE])
|
||||
->setDefault(self::SAME_LINE)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('classes_opening_brace', 'The position of the opening brace of classes‘ body.'))
|
||||
->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE])
|
||||
->setDefault(self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('anonymous_classes_opening_brace', 'The position of the opening brace of anonymous classes‘ body.'))
|
||||
->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE])
|
||||
->setDefault(self::SAME_LINE)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('allow_single_line_empty_anonymous_classes', 'Allow anonymous classes to have opening and closing braces on the same line.'))
|
||||
->setAllowedTypes(['bool'])
|
||||
->setDefault(true)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('allow_single_line_anonymous_functions', 'Allow anonymous functions to have opening and closing braces on the same line.'))
|
||||
->setAllowedTypes(['bool'])
|
||||
->setDefault(true)
|
||||
->getOption(),
|
||||
]);
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
$classyTokens = Token::getClassyTokenKinds();
|
||||
@ -338,40 +399,6 @@ $bar = function () { $result = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
|
||||
{
|
||||
return new FixerConfigurationResolver([
|
||||
(new FixerOptionBuilder('control_structures_opening_brace', 'The position of the opening brace of control structures‘ body.'))
|
||||
->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE])
|
||||
->setDefault(self::SAME_LINE)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('functions_opening_brace', 'The position of the opening brace of functions‘ body.'))
|
||||
->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE])
|
||||
->setDefault(self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('anonymous_functions_opening_brace', 'The position of the opening brace of anonymous functions‘ body.'))
|
||||
->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE])
|
||||
->setDefault(self::SAME_LINE)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('classes_opening_brace', 'The position of the opening brace of classes‘ body.'))
|
||||
->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE])
|
||||
->setDefault(self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('anonymous_classes_opening_brace', 'The position of the opening brace of anonymous classes‘ body.'))
|
||||
->setAllowedValues([self::NEXT_LINE_UNLESS_NEWLINE_AT_SIGNATURE_END, self::SAME_LINE])
|
||||
->setDefault(self::SAME_LINE)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('allow_single_line_empty_anonymous_classes', 'Allow anonymous classes to have opening and closing braces on the same line.'))
|
||||
->setAllowedTypes(['bool'])
|
||||
->setDefault(true)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('allow_single_line_anonymous_functions', 'Allow anonymous functions to have opening and closing braces on the same line.'))
|
||||
->setAllowedTypes(['bool'])
|
||||
->setDefault(true)
|
||||
->getOption(),
|
||||
]);
|
||||
}
|
||||
|
||||
private function findParenthesisEnd(Tokens $tokens, int $structureTokenIndex): int
|
||||
{
|
||||
$nextIndex = $tokens->getNextMeaningfulToken($structureTokenIndex);
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Basic;
|
||||
|
||||
use PhpCsFixer\AbstractProxyFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
|
||||
use PhpCsFixer\Fixer\Indentation;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
@ -25,9 +26,33 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* allow_single_line_anonymous_functions?: bool,
|
||||
* allow_single_line_empty_anonymous_classes?: bool,
|
||||
* anonymous_classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* anonymous_functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* classes_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* control_structures_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* functions_opening_brace?: 'next_line_unless_newline_at_signature_end'|'same_line'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* allow_single_line_anonymous_functions: bool,
|
||||
* allow_single_line_empty_anonymous_classes: bool,
|
||||
* anonymous_classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* anonymous_functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* classes_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* control_structures_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line',
|
||||
* functions_opening_brace: 'next_line_unless_newline_at_signature_end'|'same_line'
|
||||
* }
|
||||
*/
|
||||
final class CurlyBracesPositionFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
use Indentation;
|
||||
|
||||
/**
|
||||
@ -61,13 +86,6 @@ final class CurlyBracesPositionFixer extends AbstractProxyFixer implements Confi
|
||||
);
|
||||
}
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
$this->bracesPositionFixer->configure($configuration);
|
||||
|
||||
parent::configure($configuration);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
@ -86,6 +104,14 @@ final class CurlyBracesPositionFixer extends AbstractProxyFixer implements Confi
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param _AutogeneratedInputConfiguration $configuration
|
||||
*/
|
||||
protected function configurePreNormalisation(array $configuration): void
|
||||
{
|
||||
$this->bracesPositionFixer->configure($configuration);
|
||||
}
|
||||
|
||||
protected function createProxyFixers(): array
|
||||
{
|
||||
return [
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Basic;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -27,8 +28,21 @@ use PhpCsFixer\Tokenizer\Analyzer\AttributeAnalyzer;
|
||||
use PhpCsFixer\Tokenizer\CT;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* elements?: list<'arguments'|'array'|'array_destructuring'|'group_import'>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* elements: list<'arguments'|'array'|'array_destructuring'|'group_import'>
|
||||
* }
|
||||
*/
|
||||
final class NoTrailingCommaInSinglelineFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -95,7 +109,6 @@ final class NoTrailingCommaInSinglelineFixer extends AbstractFixer implements Co
|
||||
|
||||
private function shouldBeCleared(Tokens $tokens, int $openIndex): bool
|
||||
{
|
||||
/** @var list<string> $elements */
|
||||
$elements = $this->configuration['elements'];
|
||||
|
||||
if ($tokens[$openIndex]->isGivenKind(CT::T_ARRAY_SQUARE_BRACE_OPEN)) {
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Basic;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -30,9 +31,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
* Removes Zero-width space (ZWSP), Non-breaking space (NBSP) and other invisible unicode symbols.
|
||||
*
|
||||
* @author Ivan Boprzenkov <ivan.borzenkov@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* use_escape_sequences_in_strings?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* use_escape_sequences_in_strings: bool
|
||||
* }
|
||||
*/
|
||||
final class NonPrintableCharacterFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var array<string, array{string, string}>
|
||||
*/
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Basic;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -35,9 +36,23 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
*
|
||||
* @author Marvin Heilemann <marvin.heilemann+github@googlemail.com>
|
||||
* @author Greg Korba <greg@codito.dev>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* override_existing?: bool,
|
||||
* strategy?: 'no_separator'|'use_separator'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* override_existing: bool,
|
||||
* strategy: 'no_separator'|'use_separator'
|
||||
* }
|
||||
*/
|
||||
final class NumericLiteralSeparatorFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public const STRATEGY_USE_SEPARATOR = 'use_separator';
|
||||
public const STRATEGY_NO_SEPARATOR = 'no_separator';
|
||||
|
||||
|
||||
@ -17,6 +17,7 @@ namespace PhpCsFixer\Fixer\Basic;
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\DocBlock\TypeExpression;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -35,9 +36,21 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
* @author Bram Gotink <bram@gotink.me>
|
||||
* @author Graham Campbell <hello@gjcampbell.co.uk>
|
||||
* @author Kuba Werłos <werlos@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* dir?: null|string
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* dir: null|string
|
||||
* }
|
||||
*/
|
||||
final class PsrAutoloadingFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -64,21 +77,6 @@ class InvalidName {}
|
||||
);
|
||||
}
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
if (null !== $this->configuration['dir']) {
|
||||
$realpath = realpath($this->configuration['dir']);
|
||||
|
||||
if (false === $realpath) {
|
||||
throw new \InvalidArgumentException(sprintf('Failed to resolve configured directory "%s".', $this->configuration['dir']));
|
||||
}
|
||||
|
||||
$this->configuration['dir'] = $realpath;
|
||||
}
|
||||
}
|
||||
|
||||
public function isCandidate(Tokens $tokens): bool
|
||||
{
|
||||
return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds());
|
||||
@ -130,6 +128,19 @@ class InvalidName {}
|
||||
return !Preg::match('{[/\\\](stub|fixture)s?[/\\\]}i', $file->getRealPath());
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
if (null !== $this->configuration['dir']) {
|
||||
$realpath = realpath($this->configuration['dir']);
|
||||
|
||||
if (false === $realpath) {
|
||||
throw new \InvalidArgumentException(sprintf('Failed to resolve configured directory "%s".', $this->configuration['dir']));
|
||||
}
|
||||
|
||||
$this->configuration['dir'] = $realpath;
|
||||
}
|
||||
}
|
||||
|
||||
protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
|
||||
{
|
||||
return new FixerConfigurationResolver([
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Casing;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -29,9 +30,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
* Fixer for constants case.
|
||||
*
|
||||
* @author Pol Dellaiera <pol.dellaiera@protonmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* case?: 'lower'|'upper'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* case: 'lower'|'upper'
|
||||
* }
|
||||
*/
|
||||
final class ConstantCaseFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* Hold the function that will be used to convert the constants.
|
||||
*
|
||||
@ -39,19 +52,6 @@ final class ConstantCaseFixer extends AbstractFixer implements ConfigurableFixer
|
||||
*/
|
||||
private $fixFunction;
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
if ('lower' === $this->configuration['case']) {
|
||||
$this->fixFunction = static fn (string $content): string => strtolower($content);
|
||||
}
|
||||
|
||||
if ('upper' === $this->configuration['case']) {
|
||||
$this->fixFunction = static fn (string $content): string => strtoupper($content);
|
||||
}
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -68,6 +68,17 @@ final class ConstantCaseFixer extends AbstractFixer implements ConfigurableFixer
|
||||
return $tokens->isTokenKindFound(T_STRING);
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
if ('lower' === $this->configuration['case']) {
|
||||
$this->fixFunction = static fn (string $content): string => strtolower($content);
|
||||
}
|
||||
|
||||
if ('upper' === $this->configuration['case']) {
|
||||
$this->fixFunction = static fn (string $content): string => strtoupper($content);
|
||||
}
|
||||
}
|
||||
|
||||
protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
|
||||
{
|
||||
return new FixerConfigurationResolver([
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\CastNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -27,9 +28,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* space?: 'none'|'single'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* space: 'none'|'single'
|
||||
* }
|
||||
*/
|
||||
final class CastSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
private const INSIDE_CAST_SPACE_REPLACE_MAP = [
|
||||
' ' => '',
|
||||
"\t" => '',
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ClassNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -45,9 +46,21 @@ use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
|
||||
* elements: non-empty-list<_Element>
|
||||
* }
|
||||
* @phpstan-type _Element array{token: Token, type: string, index: int, start?: int, end?: int}
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* elements?: array<string, string>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* elements: array<string, string>
|
||||
* }
|
||||
*/
|
||||
final class ClassAttributesSeparationFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@ -65,17 +78,6 @@ final class ClassAttributesSeparationFixer extends AbstractFixer implements Conf
|
||||
*/
|
||||
private array $classElementTypes = [];
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->classElementTypes = []; // reset previous configuration
|
||||
|
||||
foreach ($this->configuration['elements'] as $elementType => $spacing) {
|
||||
$this->classElementTypes[$elementType] = $spacing;
|
||||
}
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -172,6 +174,15 @@ class Sample
|
||||
return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds());
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->classElementTypes = []; // reset previous configuration
|
||||
|
||||
foreach ($this->configuration['elements'] as $elementType => $spacing) {
|
||||
$this->classElementTypes[$elementType] = $spacing;
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
foreach ($this->getElementsByClass($tokens) as $class) {
|
||||
@ -199,7 +210,7 @@ class Sample
|
||||
{
|
||||
return new FixerConfigurationResolver([
|
||||
(new FixerOptionBuilder('elements', 'Dictionary of `const|method|property|trait_import|case` => `none|one|only_if_meta` values.'))
|
||||
->setAllowedTypes(['string[]'])
|
||||
->setAllowedTypes(['array<string, string>'])
|
||||
->setAllowedValues([static function (array $option): bool {
|
||||
foreach ($option as $type => $spacing) {
|
||||
$supportedTypes = ['const', 'method', 'property', 'trait_import', 'case'];
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ClassNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -33,9 +34,29 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
*
|
||||
* @phpstan-type _ClassExtendsInfo array{start: int, numberOfExtends: int, multiLine: bool}
|
||||
* @phpstan-type _ClassImplementsInfo array{start: int, numberOfImplements: int, multiLine: bool}
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* inline_constructor_arguments?: bool,
|
||||
* multi_line_extends_each_single_line?: bool,
|
||||
* single_item_single_line?: bool,
|
||||
* single_line?: bool,
|
||||
* space_before_parenthesis?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* inline_constructor_arguments: bool,
|
||||
* multi_line_extends_each_single_line: bool,
|
||||
* single_item_single_line: bool,
|
||||
* single_line: bool,
|
||||
* space_before_parenthesis: bool
|
||||
* }
|
||||
*/
|
||||
final class ClassDefinitionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -39,7 +39,7 @@ class MyApp {}
|
||||
.'If you want to subclass a class, mark the parent class as abstract and create two child classes, one empty if necessary: you\'ll gain much more fine grained type-hinting. '
|
||||
.'If you need to mock a standalone class, create an interface, or maybe it\'s a value-object that shouldn\'t be mocked at all. '
|
||||
.'If you need to extend a standalone class, create an interface and use the Composite pattern. '
|
||||
.'If you aren\'t ready yet for serious OOP, go with FinalInternalClassFixer, it\'s fine.',
|
||||
.'If these rules are too strict for you, you can use `FinalInternalClassFixer` instead.',
|
||||
'Risky when subclassing non-abstract classes.'
|
||||
);
|
||||
}
|
||||
|
||||
@ -18,6 +18,7 @@ use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException;
|
||||
use PhpCsFixer\DocBlock\DocBlock;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -34,9 +35,29 @@ use Symfony\Component\OptionsResolver\Options;
|
||||
|
||||
/**
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* annotation_exclude?: list<string>,
|
||||
* annotation_include?: list<string>,
|
||||
* consider_absent_docblock_as_internal_class?: bool,
|
||||
* exclude?: list<string>,
|
||||
* include?: list<string>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* annotation_exclude: array<string, string>,
|
||||
* annotation_include: array<string, string>,
|
||||
* consider_absent_docblock_as_internal_class: bool,
|
||||
* exclude: array<string, string>,
|
||||
* include: array<string, string>
|
||||
* }
|
||||
*/
|
||||
final class FinalInternalClassFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
private const DEFAULTS = [
|
||||
'include' => [
|
||||
'internal',
|
||||
@ -61,13 +82,6 @@ final class FinalInternalClassFixer extends AbstractFixer implements Configurabl
|
||||
$this->checkAttributes = \PHP_VERSION_ID >= 8_00_00;
|
||||
}
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->assertConfigHasNoConflicts();
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -108,6 +122,11 @@ final class FinalInternalClassFixer extends AbstractFixer implements Configurabl
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->assertConfigHasNoConflicts();
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
$tokensAnalyzer = new TokensAnalyzer($tokens);
|
||||
@ -131,7 +150,7 @@ final class FinalInternalClassFixer extends AbstractFixer implements Configurabl
|
||||
{
|
||||
$annotationsAsserts = [static function (array $values): bool {
|
||||
foreach ($values as $value) {
|
||||
if (!\is_string($value) || '' === $value) {
|
||||
if ('' === $value) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -321,8 +340,7 @@ final class FinalInternalClassFixer extends AbstractFixer implements Configurabl
|
||||
|
||||
private function assertConfigHasNoConflicts(): void
|
||||
{
|
||||
foreach (['include', 'exclude'] as $newConfigKey) {
|
||||
$oldConfigKey = 'annotation_'.$newConfigKey;
|
||||
foreach (['include' => 'annotation_include', 'exclude' => 'annotation_exclude'] as $newConfigKey => $oldConfigKey) {
|
||||
$defaults = [];
|
||||
|
||||
foreach (self::DEFAULTS[$newConfigKey] as $foo) {
|
||||
@ -337,14 +355,14 @@ final class FinalInternalClassFixer extends AbstractFixer implements Configurabl
|
||||
}
|
||||
|
||||
if ($oldConfigIsSet) {
|
||||
$this->configuration[$newConfigKey] = $this->configuration[$oldConfigKey];
|
||||
$this->configuration[$newConfigKey] = $this->configuration[$oldConfigKey]; // @phpstan-ignore-line crazy mapping, to be removed while cleaning up deprecated options
|
||||
$this->checkAttributes = false; // run in old mode
|
||||
}
|
||||
|
||||
// if ($newConfigIsSet) - only new config is set, all good
|
||||
// if (!$newConfigIsSet && !$oldConfigIsSet) - both are set as to default values, all good
|
||||
|
||||
unset($this->configuration[$oldConfigKey]);
|
||||
unset($this->configuration[$oldConfigKey]); // @phpstan-ignore-line crazy mapping, to be removed while cleaning up deprecated options
|
||||
}
|
||||
|
||||
$intersect = array_intersect_assoc($this->configuration['include'], $this->configuration['exclude']);
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ClassNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -28,9 +29,21 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
|
||||
/**
|
||||
* @author Filippo Tessarotto <zoeslam@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* private_methods?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* private_methods: bool
|
||||
* }
|
||||
*/
|
||||
final class NoUnneededFinalMethodFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ClassNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -40,9 +41,25 @@ use PhpCsFixer\Utils;
|
||||
* name: string,
|
||||
* end: int,
|
||||
* }
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* case_sensitive?: bool,
|
||||
* order?: list<string>,
|
||||
* sort_algorithm?: 'alpha'|'none'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* case_sensitive: bool,
|
||||
* order: list<string>,
|
||||
* sort_algorithm: 'alpha'|'none'
|
||||
* }
|
||||
*/
|
||||
final class OrderedClassElementsFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/** @internal */
|
||||
public const SORT_ALPHA = 'alpha';
|
||||
|
||||
@ -110,50 +127,6 @@ final class OrderedClassElementsFixer extends AbstractFixer implements Configura
|
||||
*/
|
||||
private array $typePosition;
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->typePosition = [];
|
||||
$position = 0;
|
||||
|
||||
foreach ($this->configuration['order'] as $type) {
|
||||
$this->typePosition[$type] = $position++;
|
||||
}
|
||||
|
||||
foreach (self::$typeHierarchy as $type => $parents) {
|
||||
if (isset($this->typePosition[$type])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (null === $parents) {
|
||||
$this->typePosition[$type] = null;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($parents as $parent) {
|
||||
if (isset($this->typePosition[$parent])) {
|
||||
$this->typePosition[$type] = $this->typePosition[$parent];
|
||||
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
$this->typePosition[$type] = null;
|
||||
}
|
||||
|
||||
$lastPosition = \count($this->configuration['order']);
|
||||
|
||||
foreach ($this->typePosition as &$pos) {
|
||||
if (null === $pos) {
|
||||
$pos = $lastPosition;
|
||||
}
|
||||
|
||||
$pos *= 10; // last digit is used by phpunit method ordering
|
||||
}
|
||||
}
|
||||
|
||||
public function isCandidate(Tokens $tokens): bool
|
||||
{
|
||||
return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds());
|
||||
@ -255,6 +228,48 @@ Custom values:
|
||||
return 65;
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->typePosition = [];
|
||||
$position = 0;
|
||||
|
||||
foreach ($this->configuration['order'] as $type) {
|
||||
$this->typePosition[$type] = $position++;
|
||||
}
|
||||
|
||||
foreach (self::$typeHierarchy as $type => $parents) {
|
||||
if (isset($this->typePosition[$type])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (null === $parents) {
|
||||
$this->typePosition[$type] = null;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
foreach ($parents as $parent) {
|
||||
if (isset($this->typePosition[$parent])) {
|
||||
$this->typePosition[$type] = $this->typePosition[$parent];
|
||||
|
||||
continue 2;
|
||||
}
|
||||
}
|
||||
|
||||
$this->typePosition[$type] = null;
|
||||
}
|
||||
|
||||
$lastPosition = \count($this->configuration['order']);
|
||||
|
||||
foreach ($this->typePosition as &$pos) {
|
||||
if (null === $pos) {
|
||||
$pos = $lastPosition;
|
||||
}
|
||||
|
||||
$pos *= 10; // last digit is used by phpunit method ordering
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
for ($i = 1, $count = $tokens->count(); $i < $count; ++$i) {
|
||||
@ -294,7 +309,7 @@ Custom values:
|
||||
return true;
|
||||
}
|
||||
|
||||
if (\is_string($value) && 'method:' === substr($value, 0, 7)) {
|
||||
if ('method:' === substr($value, 0, 7)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ClassNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -27,9 +28,25 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Dave van der Brugge <dmvdbrugge@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* case_sensitive?: bool,
|
||||
* direction?: 'ascend'|'descend',
|
||||
* order?: 'alpha'|'length'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* case_sensitive: bool,
|
||||
* direction: 'ascend'|'descend',
|
||||
* order: 'alpha'|'length'
|
||||
* }
|
||||
*/
|
||||
final class OrderedInterfacesFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/** @internal */
|
||||
public const OPTION_DIRECTION = 'direction';
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ClassNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -25,8 +26,21 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
use PhpCsFixer\Tokenizer\CT;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* case_sensitive?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* case_sensitive: bool
|
||||
* }
|
||||
*/
|
||||
final class OrderedTraitsFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ClassNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -34,9 +35,25 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
|
||||
/**
|
||||
* @author John Paul E. Balandan, CPA <paulbalandan@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* case_sensitive?: bool,
|
||||
* null_adjustment?: 'always_first'|'always_last'|'none',
|
||||
* sort_algorithm?: 'alpha'|'none'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* case_sensitive: bool,
|
||||
* null_adjustment: 'always_first'|'always_last'|'none',
|
||||
* sort_algorithm: 'alpha'|'none'
|
||||
* }
|
||||
*/
|
||||
final class OrderedTypesFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ClassNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
@ -35,9 +36,21 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
*
|
||||
* @author Javier Spagnoletti <phansys@gmail.com>
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* elements?: list<'const'|'property'>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* elements: list<'const'|'property'>
|
||||
* }
|
||||
*/
|
||||
final class SingleClassElementPerStatementFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function isCandidate(Tokens $tokens): bool
|
||||
{
|
||||
return $tokens->isAnyTokenKindsFound(Token::getClassyTokenKinds());
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ClassNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -32,9 +33,21 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
* Fixer for rules defined in PSR2 ¶4.3, ¶4.5.
|
||||
*
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* elements?: list<'const'|'method'|'property'>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* elements: list<'const'|'method'|'property'>
|
||||
* }
|
||||
*/
|
||||
final class VisibilityRequiredFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Comment;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -31,9 +32,21 @@ use PhpCsFixer\Utils;
|
||||
|
||||
/**
|
||||
* @author Kuba Werłos <werlos@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* ignored_tags?: list<string>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* ignored_tags: list<string>
|
||||
* }
|
||||
*/
|
||||
final class CommentToPhpdocFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var list<string>
|
||||
*/
|
||||
@ -74,10 +87,8 @@ final class CommentToPhpdocFixer extends AbstractFixer implements ConfigurableFi
|
||||
);
|
||||
}
|
||||
|
||||
public function configure(array $configuration): void
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->ignoredTags = array_map(
|
||||
static fn (string $tag): string => strtolower($tag),
|
||||
$this->configuration['ignored_tags']
|
||||
|
||||
@ -17,6 +17,7 @@ namespace PhpCsFixer\Fixer\Comment;
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -31,9 +32,27 @@ use Symfony\Component\OptionsResolver\Options;
|
||||
|
||||
/**
|
||||
* @author Antonio J. García Lagar <aj@garcialagar.es>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* comment_type?: 'PHPDoc'|'comment',
|
||||
* header: string,
|
||||
* location?: 'after_declare_strict'|'after_open',
|
||||
* separate?: 'both'|'bottom'|'none'|'top'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* comment_type: 'PHPDoc'|'comment',
|
||||
* header: string,
|
||||
* location: 'after_declare_strict'|'after_open',
|
||||
* separate: 'both'|'bottom'|'none'|'top'
|
||||
* }
|
||||
*/
|
||||
final class HeaderCommentFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Comment;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -29,9 +30,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Filippo Tessarotto <zoeslam@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* comment_types?: list<'asterisk'|'hash'>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* comment_types: list<'asterisk'|'hash'>
|
||||
* }
|
||||
*/
|
||||
final class SingleLineCommentStyleFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
@ -42,14 +55,6 @@ final class SingleLineCommentStyleFixer extends AbstractFixer implements Configu
|
||||
*/
|
||||
private $hashEnabled;
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->asteriskEnabled = \in_array('asterisk', $this->configuration['comment_types'], true);
|
||||
$this->hashEnabled = \in_array('hash', $this->configuration['comment_types'], true);
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -111,6 +116,12 @@ $c = 3;
|
||||
return $tokens->isTokenKindFound(T_COMMENT);
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->asteriskEnabled = \in_array('asterisk', $this->configuration['comment_types'], true);
|
||||
$this->hashEnabled = \in_array('hash', $this->configuration['comment_types'], true);
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
foreach ($tokens as $index => $token) {
|
||||
|
||||
@ -19,6 +19,9 @@ use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
|
||||
/**
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @template TFixerInputConfig of array<string, mixed>
|
||||
* @template TFixerComputedConfig of array<string, mixed>
|
||||
*/
|
||||
interface ConfigurableFixerInterface extends FixerInterface
|
||||
{
|
||||
@ -34,7 +37,7 @@ interface ConfigurableFixerInterface extends FixerInterface
|
||||
* eg `php_unit_strict` fixer allows to configure which methods should be fixed.
|
||||
* Finally, some fixers need configuration to work, eg `header_comment`.
|
||||
*
|
||||
* @param array<string, mixed> $configuration configuration depends on Fixer
|
||||
* @param TFixerInputConfig $configuration configuration depends on Fixer
|
||||
*
|
||||
* @throws InvalidFixerConfigurationException
|
||||
*/
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ConstantNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -31,9 +32,29 @@ use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
|
||||
|
||||
/**
|
||||
* @author Filippo Tessarotto <zoeslam@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* exclude?: list<string>,
|
||||
* fix_built_in?: bool,
|
||||
* include?: list<string>,
|
||||
* scope?: 'all'|'namespaced',
|
||||
* strict?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* exclude: list<string>,
|
||||
* fix_built_in: bool,
|
||||
* include: list<string>,
|
||||
* scope: 'all'|'namespaced',
|
||||
* strict: bool
|
||||
* }
|
||||
*/
|
||||
final class NativeConstantInvocationFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var array<string, true>
|
||||
*/
|
||||
@ -113,10 +134,8 @@ namespace {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function configure(array $configuration): void
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$uniqueConfiguredExclude = array_unique($this->configuration['exclude']);
|
||||
|
||||
// Case-sensitive constants handling
|
||||
@ -130,6 +149,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
/** @var list<string> */
|
||||
$constantsToEscape = array_diff(
|
||||
array_unique($constantsToEscape),
|
||||
$uniqueConfiguredExclude
|
||||
@ -188,7 +208,7 @@ namespace {
|
||||
{
|
||||
$constantChecker = static function (array $value): bool {
|
||||
foreach ($value as $constantName) {
|
||||
if (!\is_string($constantName) || '' === trim($constantName) || trim($constantName) !== $constantName) {
|
||||
if (trim($constantName) !== $constantName) {
|
||||
throw new InvalidOptionsException(sprintf(
|
||||
'Each element must be a non-empty, trimmed string, got "%s" instead.',
|
||||
get_debug_type($constantName)
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ControlStructure;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -26,8 +27,21 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
use PhpCsFixer\Tokenizer\Analyzer\WhitespacesAnalyzer;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* position?: 'next_line'|'same_line'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* position: 'next_line'|'same_line'
|
||||
* }
|
||||
*/
|
||||
final class ControlStructureContinuationPositionFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ControlStructure;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -26,8 +27,21 @@ use PhpCsFixer\Tokenizer\Token;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* style?: 'braces'|'semicolon'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* style: 'braces'|'semicolon'
|
||||
* }
|
||||
*/
|
||||
final class EmptyLoopBodyFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
private const STYLE_BRACES = 'braces';
|
||||
|
||||
private const STYLE_SEMICOLON = 'semicolon';
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ControlStructure;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -25,8 +26,21 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
use PhpCsFixer\Tokenizer\Token;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* style?: 'for'|'while'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* style: 'for'|'while'
|
||||
* }
|
||||
*/
|
||||
final class EmptyLoopConditionFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
private const STYLE_FOR = 'for';
|
||||
|
||||
private const STYLE_WHILE = 'while';
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ControlStructure;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -27,9 +28,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Eddilbert Macharia <edd.cowan@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* fix_non_monolithic_code?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* fix_non_monolithic_code: bool
|
||||
* }
|
||||
*/
|
||||
final class NoAlternativeSyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ControlStructure;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -32,9 +33,21 @@ use Symfony\Component\OptionsResolver\Options;
|
||||
|
||||
/**
|
||||
* Fixer for rule defined in PSR2 ¶5.2.
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* comment_text?: string
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* comment_text: string
|
||||
* }
|
||||
*/
|
||||
final class NoBreakCommentFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ControlStructure;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -25,8 +26,21 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
use PhpCsFixer\Tokenizer\Token;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* namespaces?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* namespaces: bool
|
||||
* }
|
||||
*/
|
||||
final class NoUnneededBracesFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ControlStructure;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -32,9 +33,21 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
* @author Sullivan Senechal <soullivaneuh@gmail.com>
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
* @author Gregor Harlan <gharlan@web.de>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* statements?: list<'break'|'clone'|'continue'|'echo_print'|'negative_instanceof'|'others'|'return'|'switch_case'|'yield'|'yield_from'>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* statements: list<'break'|'clone'|'continue'|'echo_print'|'negative_instanceof'|'others'|'return'|'switch_case'|'yield'|'yield_from'>
|
||||
* }
|
||||
*/
|
||||
final class NoUnneededControlParenthesesFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var list<int>
|
||||
*/
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ControlStructure;
|
||||
|
||||
use PhpCsFixer\AbstractProxyFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -25,9 +26,21 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* namespaces?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* namespaces: bool
|
||||
* }
|
||||
*/
|
||||
final class NoUnneededCurlyBracesFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
private NoUnneededBracesFixer $noUnneededBracesFixer;
|
||||
|
||||
public function __construct()
|
||||
@ -49,13 +62,6 @@ final class NoUnneededCurlyBracesFixer extends AbstractProxyFixer implements Con
|
||||
);
|
||||
}
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
$this->noUnneededBracesFixer->configure($configuration);
|
||||
|
||||
parent::configure($configuration);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*
|
||||
@ -73,6 +79,14 @@ final class NoUnneededCurlyBracesFixer extends AbstractProxyFixer implements Con
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param _AutogeneratedInputConfiguration $configuration
|
||||
*/
|
||||
protected function configurePreNormalisation(array $configuration): void
|
||||
{
|
||||
$this->noUnneededBracesFixer->configure($configuration);
|
||||
}
|
||||
|
||||
protected function createConfigurationDefinition(): FixerConfigurationResolverInterface
|
||||
{
|
||||
return new FixerConfigurationResolver([
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ControlStructure;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -36,9 +37,23 @@ use Symfony\Component\OptionsResolver\Options;
|
||||
* @author Sebastiaan Stok <s.stok@rollerscapes.net>
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
* @author Kuba Werłos <werlos@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* after_heredoc?: bool,
|
||||
* elements?: list<'arguments'|'arrays'|'match'|'parameters'>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* after_heredoc: bool,
|
||||
* elements: list<'arguments'|'arrays'|'match'|'parameters'>
|
||||
* }
|
||||
*/
|
||||
final class TrailingCommaInMultilineFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\ControlStructure;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -30,9 +31,27 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
/**
|
||||
* @author Bram Gotink <bram@gotink.me>
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* always_move_variable?: bool,
|
||||
* equal?: bool|null,
|
||||
* identical?: bool|null,
|
||||
* less_and_greater?: bool|null
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* always_move_variable: bool,
|
||||
* equal: bool|null,
|
||||
* identical: bool|null,
|
||||
* less_and_greater: bool|null
|
||||
* }
|
||||
*/
|
||||
final class YodaStyleFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var array<int|string, Token>
|
||||
*/
|
||||
@ -48,13 +67,6 @@ final class YodaStyleFixer extends AbstractFixer implements ConfigurableFixerInt
|
||||
*/
|
||||
private $candidateTypes;
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->resolveConfiguration();
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -119,6 +131,11 @@ return $foo === count($bar);
|
||||
return $tokens->isAnyTokenKindsFound($this->candidateTypes);
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->resolveConfiguration();
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
$this->fixTokens($tokens);
|
||||
|
||||
@ -17,6 +17,8 @@ namespace PhpCsFixer\Fixer\DoctrineAnnotation;
|
||||
use PhpCsFixer\AbstractDoctrineAnnotationFixer;
|
||||
use PhpCsFixer\Doctrine\Annotation\DocLexer;
|
||||
use PhpCsFixer\Doctrine\Annotation\Tokens;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -26,9 +28,23 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
|
||||
/**
|
||||
* Forces the configured operator for assignment in arrays in Doctrine Annotations.
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* ignored_tags?: list<string>,
|
||||
* operator?: ':'|'='
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* ignored_tags: list<string>,
|
||||
* operator: ':'|'='
|
||||
* }
|
||||
*/
|
||||
final class DoctrineAnnotationArrayAssignmentFixer extends AbstractDoctrineAnnotationFixer
|
||||
final class DoctrineAnnotationArrayAssignmentFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -59,8 +75,7 @@ final class DoctrineAnnotationArrayAssignmentFixer extends AbstractDoctrineAnnot
|
||||
{
|
||||
$options = parent::createConfigurationDefinition()->getOptions();
|
||||
|
||||
$operator = new FixerOptionBuilder('operator', 'The operator to use.');
|
||||
$options[] = $operator
|
||||
$options[] = (new FixerOptionBuilder('operator', 'The operator to use.'))
|
||||
->setAllowedValues(['=', ':'])
|
||||
->setDefault('=')
|
||||
->getOption()
|
||||
|
||||
@ -18,6 +18,8 @@ use PhpCsFixer\AbstractDoctrineAnnotationFixer;
|
||||
use PhpCsFixer\Doctrine\Annotation\DocLexer;
|
||||
use PhpCsFixer\Doctrine\Annotation\Token;
|
||||
use PhpCsFixer\Doctrine\Annotation\Tokens;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -27,9 +29,23 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
|
||||
/**
|
||||
* Adds braces to Doctrine annotations when missing.
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* ignored_tags?: list<string>,
|
||||
* syntax?: 'with_braces'|'without_braces'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* ignored_tags: list<string>,
|
||||
* syntax: 'with_braces'|'without_braces'
|
||||
* }
|
||||
*/
|
||||
final class DoctrineAnnotationBracesFixer extends AbstractDoctrineAnnotationFixer
|
||||
final class DoctrineAnnotationBracesFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -17,6 +17,8 @@ namespace PhpCsFixer\Fixer\DoctrineAnnotation;
|
||||
use PhpCsFixer\AbstractDoctrineAnnotationFixer;
|
||||
use PhpCsFixer\Doctrine\Annotation\DocLexer;
|
||||
use PhpCsFixer\Doctrine\Annotation\Tokens;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -25,8 +27,23 @@ use PhpCsFixer\FixerDefinition\FixerDefinition;
|
||||
use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
use PhpCsFixer\Preg;
|
||||
|
||||
final class DoctrineAnnotationIndentationFixer extends AbstractDoctrineAnnotationFixer
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* ignored_tags?: list<string>,
|
||||
* indent_mixed_lines?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* ignored_tags: list<string>,
|
||||
* indent_mixed_lines: bool
|
||||
* }
|
||||
*/
|
||||
final class DoctrineAnnotationIndentationFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -18,6 +18,8 @@ use PhpCsFixer\AbstractDoctrineAnnotationFixer;
|
||||
use PhpCsFixer\Doctrine\Annotation\DocLexer;
|
||||
use PhpCsFixer\Doctrine\Annotation\Token;
|
||||
use PhpCsFixer\Doctrine\Annotation\Tokens;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -28,9 +30,37 @@ use PhpCsFixer\Preg;
|
||||
|
||||
/**
|
||||
* Fixes spaces around commas and assignment operators in Doctrine annotations.
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* after_argument_assignments?: bool|null,
|
||||
* after_array_assignments_colon?: bool|null,
|
||||
* after_array_assignments_equals?: bool|null,
|
||||
* around_commas?: bool,
|
||||
* around_parentheses?: bool,
|
||||
* before_argument_assignments?: bool|null,
|
||||
* before_array_assignments_colon?: bool|null,
|
||||
* before_array_assignments_equals?: bool|null,
|
||||
* ignored_tags?: list<string>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* after_argument_assignments: bool|null,
|
||||
* after_array_assignments_colon: bool|null,
|
||||
* after_array_assignments_equals: bool|null,
|
||||
* around_commas: bool,
|
||||
* around_parentheses: bool,
|
||||
* before_argument_assignments: bool|null,
|
||||
* before_array_assignments_colon: bool|null,
|
||||
* before_array_assignments_equals: bool|null,
|
||||
* ignored_tags: list<string>
|
||||
* }
|
||||
*/
|
||||
final class DoctrineAnnotationSpacesFixer extends AbstractDoctrineAnnotationFixer
|
||||
final class DoctrineAnnotationSpacesFixer extends AbstractDoctrineAnnotationFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\FunctionNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFopenFlagFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -25,8 +26,21 @@ use PhpCsFixer\FixerDefinition\FixerDefinitionInterface;
|
||||
use PhpCsFixer\Tokenizer\Token;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* b_mode?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* b_mode: bool
|
||||
* }
|
||||
*/
|
||||
final class FopenFlagsFixer extends AbstractFopenFlagFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\FunctionNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -30,9 +31,25 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
* Fixer for rules defined in PSR2 generally (¶1 and ¶6).
|
||||
*
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* closure_fn_spacing?: 'none'|'one',
|
||||
* closure_function_spacing?: 'none'|'one',
|
||||
* trailing_comma_single_line?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* closure_fn_spacing: 'none'|'one',
|
||||
* closure_function_spacing: 'none'|'one',
|
||||
* trailing_comma_single_line: bool
|
||||
* }
|
||||
*/
|
||||
final class FunctionDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\FunctionNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -30,9 +31,27 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Kuanhung Chen <ericj.tw@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* after_heredoc?: bool,
|
||||
* attribute_placement?: 'ignore'|'same_line'|'standalone',
|
||||
* keep_multiple_spaces_after_comma?: bool,
|
||||
* on_multiline?: 'ensure_fully_multiline'|'ensure_single_line'|'ignore'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* after_heredoc: bool,
|
||||
* attribute_placement: 'ignore'|'same_line'|'standalone',
|
||||
* keep_multiple_spaces_after_comma: bool,
|
||||
* on_multiline: 'ensure_fully_multiline'|'ensure_single_line'|'ignore'
|
||||
* }
|
||||
*/
|
||||
final class MethodArgumentSpaceFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\FunctionNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -31,9 +32,27 @@ use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
|
||||
|
||||
/**
|
||||
* @author Andreas Möller <am@localheinz.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* exclude?: list<string>,
|
||||
* include?: list<string>,
|
||||
* scope?: 'all'|'namespaced',
|
||||
* strict?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* exclude: list<string>,
|
||||
* include: list<string>,
|
||||
* scope: 'all'|'namespaced',
|
||||
* strict: bool
|
||||
* }
|
||||
*/
|
||||
final class NativeFunctionInvocationFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@ -61,13 +80,6 @@ final class NativeFunctionInvocationFixer extends AbstractFixer implements Confi
|
||||
*/
|
||||
private $functionFilter;
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->functionFilter = $this->getFunctionFilter();
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -181,6 +193,11 @@ $c = get_class($d);
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->functionFilter = $this->getFunctionFilter();
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
if ('all' === $this->configuration['scope']) {
|
||||
@ -205,7 +222,7 @@ $c = get_class($d);
|
||||
->setAllowedTypes(['string[]'])
|
||||
->setAllowedValues([static function (array $value): bool {
|
||||
foreach ($value as $functionName) {
|
||||
if (!\is_string($functionName) || '' === trim($functionName) || trim($functionName) !== $functionName) {
|
||||
if ('' === trim($functionName) || trim($functionName) !== $functionName) {
|
||||
throw new InvalidOptionsException(sprintf(
|
||||
'Each element must be a non-empty, trimmed string, got "%s" instead.',
|
||||
get_debug_type($functionName)
|
||||
@ -221,7 +238,7 @@ $c = get_class($d);
|
||||
->setAllowedTypes(['string[]'])
|
||||
->setAllowedValues([static function (array $value): bool {
|
||||
foreach ($value as $functionName) {
|
||||
if (!\is_string($functionName) || '' === trim($functionName) || trim($functionName) !== $functionName) {
|
||||
if ('' === trim($functionName) || trim($functionName) !== $functionName) {
|
||||
throw new InvalidOptionsException(sprintf(
|
||||
'Each element must be a non-empty, trimmed string, got "%s" instead.',
|
||||
get_debug_type($functionName)
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\FunctionNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -33,9 +34,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author HypeMC <hypemc@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* use_nullable_type_declaration?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* use_nullable_type_declaration: bool
|
||||
* }
|
||||
*/
|
||||
final class NullableTypeDeclarationForDefaultNullValueFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\FunctionNotation;
|
||||
|
||||
use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer;
|
||||
use PhpCsFixer\DocBlock\Annotation;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ExperimentalFixerInterface;
|
||||
use PhpCsFixer\FixerDefinition\CodeSample;
|
||||
use PhpCsFixer\FixerDefinition\FixerDefinition;
|
||||
@ -25,8 +26,19 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Jan Gantzert <jan@familie-gantzert.de>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* scalar_types?: bool,
|
||||
* union_types?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* scalar_types: bool,
|
||||
* union_types: bool
|
||||
* }
|
||||
*/
|
||||
final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ExperimentalFixerInterface
|
||||
final class PhpdocToParamTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ConfigurableFixerInterface, ExperimentalFixerInterface
|
||||
{
|
||||
private const TYPE_CHECK_TEMPLATE = '<?php function f(%s $x) {}';
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\FunctionNotation;
|
||||
|
||||
use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer;
|
||||
use PhpCsFixer\DocBlock\Annotation;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ExperimentalFixerInterface;
|
||||
use PhpCsFixer\FixerDefinition\CodeSample;
|
||||
use PhpCsFixer\FixerDefinition\FixerDefinition;
|
||||
@ -25,8 +26,19 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @phpstan-import-type _CommonTypeInfo from AbstractPhpdocToTypeDeclarationFixer
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* scalar_types?: bool,
|
||||
* union_types?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* scalar_types: bool,
|
||||
* union_types: bool
|
||||
* }
|
||||
*/
|
||||
final class PhpdocToPropertyTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ExperimentalFixerInterface
|
||||
final class PhpdocToPropertyTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ConfigurableFixerInterface, ExperimentalFixerInterface
|
||||
{
|
||||
private const TYPE_CHECK_TEMPLATE = '<?php class A { private %s $b; }';
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ declare(strict_types=1);
|
||||
namespace PhpCsFixer\Fixer\FunctionNotation;
|
||||
|
||||
use PhpCsFixer\AbstractPhpdocToTypeDeclarationFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ExperimentalFixerInterface;
|
||||
use PhpCsFixer\FixerDefinition\CodeSample;
|
||||
use PhpCsFixer\FixerDefinition\FixerDefinition;
|
||||
@ -27,8 +28,19 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Filippo Tessarotto <zoeslam@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* scalar_types?: bool,
|
||||
* union_types?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* scalar_types: bool,
|
||||
* union_types: bool
|
||||
* }
|
||||
*/
|
||||
final class PhpdocToReturnTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ExperimentalFixerInterface
|
||||
final class PhpdocToReturnTypeFixer extends AbstractPhpdocToTypeDeclarationFixer implements ConfigurableFixerInterface, ExperimentalFixerInterface
|
||||
{
|
||||
private const TYPE_CHECK_TEMPLATE = '<?php function f(): %s {}';
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\FunctionNotation;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -28,9 +29,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* space_before?: 'none'|'one'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* space_before: 'none'|'one'
|
||||
* }
|
||||
*/
|
||||
final class ReturnTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -17,6 +17,7 @@ namespace PhpCsFixer\Fixer\Import;
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\DocBlock\TypeExpression;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -40,9 +41,25 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
* @author Greg Korba <greg@codito.dev>
|
||||
* @author SpacePossum <possumfromspace@gmail.com>
|
||||
* @author Michael Vorisek <https://github.com/mvorisek>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* import_symbols?: bool,
|
||||
* leading_backslash_in_global_namespace?: bool,
|
||||
* phpdoc_tags?: list<string>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* import_symbols: bool,
|
||||
* leading_backslash_in_global_namespace: bool,
|
||||
* phpdoc_tags: list<string>
|
||||
* }
|
||||
*/
|
||||
final class FullyQualifiedStrictTypesFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
private const REGEX_CLASS = '(?:\\\?+'.TypeExpression::REGEX_IDENTIFIER
|
||||
.'(\\\\'.TypeExpression::REGEX_IDENTIFIER.')*+)';
|
||||
|
||||
|
||||
@ -18,6 +18,7 @@ use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\DocBlock\Annotation;
|
||||
use PhpCsFixer\DocBlock\DocBlock;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -38,9 +39,25 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
|
||||
/**
|
||||
* @author Gregor Harlan <gharlan@web.de>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* import_classes?: bool|null,
|
||||
* import_constants?: bool|null,
|
||||
* import_functions?: bool|null
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* import_classes: bool|null,
|
||||
* import_constants: bool|null,
|
||||
* import_functions: bool|null
|
||||
* }
|
||||
*/
|
||||
final class GlobalNamespaceImportFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
private ImportProcessor $importProcessor;
|
||||
|
||||
public function __construct()
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Import;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -33,9 +34,21 @@ use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
|
||||
/**
|
||||
* @author Volodymyr Kupriienko <vldmr.kuprienko@gmail.com>
|
||||
* @author Greg Korba <greg@codito.dev>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* group_types?: list<string>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* group_types: list<string>
|
||||
* }
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*/
|
||||
final class GroupImportFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/** @internal */
|
||||
public const GROUP_CLASSY = 'classy';
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Import;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -44,9 +45,25 @@ use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
|
||||
* importType: self::IMPORT_TYPE_*,
|
||||
* group: bool,
|
||||
* }
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* case_sensitive?: bool,
|
||||
* imports_order?: list<string>|null,
|
||||
* sort_algorithm?: 'alpha'|'length'|'none'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* case_sensitive: bool,
|
||||
* imports_order: list<string>|null,
|
||||
* sort_algorithm: 'alpha'|'length'|'none'
|
||||
* }
|
||||
*/
|
||||
final class OrderedImportsFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Import;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -33,9 +34,21 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
* Fixer for rules defined in PSR2 ¶3.
|
||||
*
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* group_to_single_imports?: bool
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* group_to_single_imports: bool
|
||||
* }
|
||||
*/
|
||||
final class SingleImportPerStatementFixer extends AbstractFixer implements ConfigurableFixerInterface, WhitespacesAwareFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\LanguageConstruct;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -27,9 +28,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* space?: 'none'|'single'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* space: 'none'|'single'
|
||||
* }
|
||||
*/
|
||||
final class DeclareEqualNormalizeFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\LanguageConstruct;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -29,9 +30,25 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
/**
|
||||
* @author Jules Pietri <jules@heahprod.com>
|
||||
* @author Kuba Werłos <werlos@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* mute_deprecation_error?: bool,
|
||||
* noise_remaining_usages?: bool,
|
||||
* noise_remaining_usages_exclude?: list<string>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* mute_deprecation_error: bool,
|
||||
* noise_remaining_usages: bool,
|
||||
* noise_remaining_usages_exclude: list<string>
|
||||
* }
|
||||
*/
|
||||
final class ErrorSuppressionFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\LanguageConstruct;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -28,8 +29,21 @@ use PhpCsFixer\Tokenizer\CT;
|
||||
use PhpCsFixer\Tokenizer\Token;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* functions?: list<'get_called_class'|'get_class'|'get_class_this'|'php_sapi_name'|'phpversion'|'pi'>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* functions: list<'get_called_class'|'get_class'|'get_class_this'|'php_sapi_name'|'phpversion'|'pi'>
|
||||
* }
|
||||
*/
|
||||
final class FunctionToConstantFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var array<string, list<Token>>
|
||||
*/
|
||||
@ -68,17 +82,6 @@ final class FunctionToConstantFixer extends AbstractFixer implements Configurabl
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->functionsFixMap = [];
|
||||
|
||||
foreach ($this->configuration['functions'] as $key) {
|
||||
$this->functionsFixMap[$key] = self::$availableFunctions[$key];
|
||||
}
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -118,6 +121,15 @@ final class FunctionToConstantFixer extends AbstractFixer implements Configurabl
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->functionsFixMap = [];
|
||||
|
||||
foreach ($this->configuration['functions'] as $key) {
|
||||
$this->functionsFixMap[$key] = self::$availableFunctions[$key];
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
$functionAnalyzer = new FunctionsAnalyzer();
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\LanguageConstruct;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -33,9 +34,21 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
|
||||
/**
|
||||
* @author John Paul E. Balandan, CPA <paulbalandan@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* syntax?: 'question_mark'|'union'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* syntax: 'question_mark'|'union'
|
||||
* }
|
||||
*/
|
||||
final class NullableTypeDeclarationFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
private const OPTION_SYNTAX_UNION = 'union';
|
||||
private const OPTION_SYNTAX_QUESTION_MARK = 'question_mark';
|
||||
|
||||
@ -88,10 +101,8 @@ class ValueObject
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function configure(array $configuration): void
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->candidateTokenKind = self::OPTION_SYNTAX_QUESTION_MARK === $this->configuration['syntax']
|
||||
? CT::T_TYPE_ALTERNATION // `|` -> `?`
|
||||
: CT::T_NULLABLE_TYPE; // `?` -> `|`
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\LanguageConstruct;
|
||||
|
||||
use PhpCsFixer\AbstractProxyFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\DeprecatedFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
@ -30,9 +31,21 @@ use PhpCsFixer\Tokenizer\CT;
|
||||
* @author Andreas Möller <am@localheinz.com>
|
||||
*
|
||||
* @deprecated
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* constructs?: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* constructs: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'>
|
||||
* }
|
||||
*/
|
||||
final class SingleSpaceAfterConstructFixer extends AbstractProxyFixer implements ConfigurableFixerInterface, DeprecatedFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var array<string, null|int>
|
||||
*/
|
||||
@ -114,19 +127,6 @@ final class SingleSpaceAfterConstructFixer extends AbstractProxyFixer implements
|
||||
return array_keys($this->proxyFixers);
|
||||
}
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->singleSpaceAroundConstructFixer->configure([
|
||||
'constructs_contain_a_single_space' => [
|
||||
'yield_from',
|
||||
],
|
||||
'constructs_preceded_by_a_single_space' => [],
|
||||
'constructs_followed_by_a_single_space' => $this->configuration['constructs'],
|
||||
]);
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -175,6 +175,17 @@ yield from baz();
|
||||
return parent::getPriority();
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->singleSpaceAroundConstructFixer->configure([
|
||||
'constructs_contain_a_single_space' => [
|
||||
'yield_from',
|
||||
],
|
||||
'constructs_preceded_by_a_single_space' => [],
|
||||
'constructs_followed_by_a_single_space' => $this->configuration['constructs'],
|
||||
]);
|
||||
}
|
||||
|
||||
protected function createProxyFixers(): array
|
||||
{
|
||||
return [$this->singleSpaceAroundConstructFixer];
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\LanguageConstruct;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\AllowedValueSubset;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -31,9 +32,25 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
/**
|
||||
* @author Andreas Möller <am@localheinz.com>
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* constructs_contain_a_single_space?: list<'yield_from'>,
|
||||
* constructs_followed_by_a_single_space?: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'>,
|
||||
* constructs_preceded_by_a_single_space?: list<'as'|'use_lambda'>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* constructs_contain_a_single_space: list<'yield_from'>,
|
||||
* constructs_followed_by_a_single_space: list<'abstract'|'as'|'attribute'|'break'|'case'|'catch'|'class'|'clone'|'comment'|'const'|'const_import'|'continue'|'do'|'echo'|'else'|'elseif'|'enum'|'extends'|'final'|'finally'|'for'|'foreach'|'function'|'function_import'|'global'|'goto'|'if'|'implements'|'include'|'include_once'|'instanceof'|'insteadof'|'interface'|'match'|'named_argument'|'namespace'|'new'|'open_tag_with_echo'|'php_doc'|'php_open'|'print'|'private'|'protected'|'public'|'readonly'|'require'|'require_once'|'return'|'static'|'switch'|'throw'|'trait'|'try'|'type_colon'|'use'|'use_lambda'|'use_trait'|'var'|'while'|'yield'|'yield_from'>,
|
||||
* constructs_preceded_by_a_single_space: list<'as'|'use_lambda'>
|
||||
* }
|
||||
*/
|
||||
final class SingleSpaceAroundConstructFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var array<string, null|int>
|
||||
*/
|
||||
@ -132,59 +149,6 @@ final class SingleSpaceAroundConstructFixer extends AbstractFixer implements Con
|
||||
*/
|
||||
private array $fixTokenMapPrecededByASingleSpace = [];
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
if (\defined('T_MATCH')) { // @TODO: drop condition when PHP 8.0+ is required
|
||||
self::$tokenMapFollowedByASingleSpace['match'] = T_MATCH;
|
||||
}
|
||||
|
||||
if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required
|
||||
self::$tokenMapFollowedByASingleSpace['readonly'] = T_READONLY;
|
||||
}
|
||||
|
||||
if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required
|
||||
self::$tokenMapFollowedByASingleSpace['enum'] = T_ENUM;
|
||||
}
|
||||
|
||||
$this->fixTokenMapContainASingleSpace = [];
|
||||
|
||||
foreach ($this->configuration['constructs_contain_a_single_space'] as $key) {
|
||||
if (null !== self::$tokenMapContainASingleSpace[$key]) {
|
||||
$this->fixTokenMapContainASingleSpace[$key] = self::$tokenMapContainASingleSpace[$key];
|
||||
}
|
||||
}
|
||||
|
||||
$this->fixTokenMapPrecededByASingleSpace = [];
|
||||
|
||||
foreach ($this->configuration['constructs_preceded_by_a_single_space'] as $key) {
|
||||
if (null !== self::$tokenMapPrecededByASingleSpace[$key]) {
|
||||
$this->fixTokenMapPrecededByASingleSpace[$key] = self::$tokenMapPrecededByASingleSpace[$key];
|
||||
}
|
||||
}
|
||||
|
||||
$this->fixTokenMapFollowedByASingleSpace = [];
|
||||
|
||||
foreach ($this->configuration['constructs_followed_by_a_single_space'] as $key) {
|
||||
if (null !== self::$tokenMapFollowedByASingleSpace[$key]) {
|
||||
$this->fixTokenMapFollowedByASingleSpace[$key] = self::$tokenMapFollowedByASingleSpace[$key];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->fixTokenMapFollowedByASingleSpace['public'])) {
|
||||
$this->fixTokenMapFollowedByASingleSpace['constructor_public'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC;
|
||||
}
|
||||
|
||||
if (isset($this->fixTokenMapFollowedByASingleSpace['protected'])) {
|
||||
$this->fixTokenMapFollowedByASingleSpace['constructor_protected'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED;
|
||||
}
|
||||
|
||||
if (isset($this->fixTokenMapFollowedByASingleSpace['private'])) {
|
||||
$this->fixTokenMapFollowedByASingleSpace['constructor_private'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE;
|
||||
}
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -274,6 +238,57 @@ yield from baz();
|
||||
return $tokens->isAnyTokenKindsFound($tokenKinds) && !$tokens->hasAlternativeSyntax();
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
if (\defined('T_MATCH')) { // @TODO: drop condition when PHP 8.0+ is required
|
||||
self::$tokenMapFollowedByASingleSpace['match'] = T_MATCH;
|
||||
}
|
||||
|
||||
if (\defined('T_READONLY')) { // @TODO: drop condition when PHP 8.1+ is required
|
||||
self::$tokenMapFollowedByASingleSpace['readonly'] = T_READONLY;
|
||||
}
|
||||
|
||||
if (\defined('T_ENUM')) { // @TODO: drop condition when PHP 8.1+ is required
|
||||
self::$tokenMapFollowedByASingleSpace['enum'] = T_ENUM;
|
||||
}
|
||||
|
||||
$this->fixTokenMapContainASingleSpace = [];
|
||||
|
||||
foreach ($this->configuration['constructs_contain_a_single_space'] as $key) {
|
||||
if (null !== self::$tokenMapContainASingleSpace[$key]) {
|
||||
$this->fixTokenMapContainASingleSpace[$key] = self::$tokenMapContainASingleSpace[$key];
|
||||
}
|
||||
}
|
||||
|
||||
$this->fixTokenMapPrecededByASingleSpace = [];
|
||||
|
||||
foreach ($this->configuration['constructs_preceded_by_a_single_space'] as $key) {
|
||||
if (null !== self::$tokenMapPrecededByASingleSpace[$key]) {
|
||||
$this->fixTokenMapPrecededByASingleSpace[$key] = self::$tokenMapPrecededByASingleSpace[$key];
|
||||
}
|
||||
}
|
||||
|
||||
$this->fixTokenMapFollowedByASingleSpace = [];
|
||||
|
||||
foreach ($this->configuration['constructs_followed_by_a_single_space'] as $key) {
|
||||
if (null !== self::$tokenMapFollowedByASingleSpace[$key]) {
|
||||
$this->fixTokenMapFollowedByASingleSpace[$key] = self::$tokenMapFollowedByASingleSpace[$key];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($this->fixTokenMapFollowedByASingleSpace['public'])) {
|
||||
$this->fixTokenMapFollowedByASingleSpace['constructor_public'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PUBLIC;
|
||||
}
|
||||
|
||||
if (isset($this->fixTokenMapFollowedByASingleSpace['protected'])) {
|
||||
$this->fixTokenMapFollowedByASingleSpace['constructor_protected'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PROTECTED;
|
||||
}
|
||||
|
||||
if (isset($this->fixTokenMapFollowedByASingleSpace['private'])) {
|
||||
$this->fixTokenMapFollowedByASingleSpace['constructor_private'] = CT::T_CONSTRUCTOR_PROPERTY_PROMOTION_PRIVATE;
|
||||
}
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
$tokenKindsContainASingleSpace = array_values($this->fixTokenMapContainASingleSpace);
|
||||
|
||||
@ -17,6 +17,7 @@ namespace PhpCsFixer\Fixer\ListNotation;
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -27,25 +28,26 @@ use PhpCsFixer\Tokenizer\CT;
|
||||
use PhpCsFixer\Tokenizer\Token;
|
||||
use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* syntax?: 'long'|'short'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* syntax: 'long'|'short'
|
||||
* }
|
||||
*/
|
||||
final class ListSyntaxFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @var null|int
|
||||
*/
|
||||
private $candidateTokenKind;
|
||||
|
||||
/**
|
||||
* @param array{syntax: 'long'|'short'} $configuration
|
||||
*
|
||||
* @throws InvalidFixerConfigurationException
|
||||
*/
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->candidateTokenKind = 'long' === $this->configuration['syntax'] ? CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN : T_LIST;
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -77,6 +79,14 @@ final class ListSyntaxFixer extends AbstractFixer implements ConfigurableFixerIn
|
||||
return $tokens->isTokenKindFound($this->candidateTokenKind);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidFixerConfigurationException
|
||||
*/
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->candidateTokenKind = 'long' === $this->configuration['syntax'] ? CT::T_DESTRUCTURING_SQUARE_BRACE_OPEN : T_LIST;
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
for ($index = $tokens->count() - 1; 0 <= $index; --$index) {
|
||||
|
||||
@ -17,6 +17,7 @@ namespace PhpCsFixer\Fixer\NamespaceNotation;
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\ConfigurationException\InvalidFixerConfigurationException;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\Fixer\WhitespacesAwareFixerInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
@ -31,9 +32,23 @@ use Symfony\Component\OptionsResolver\Options;
|
||||
/**
|
||||
* @author Graham Campbell <hello@gjcampbell.co.uk>
|
||||
* @author Greg Korba <greg@codito.dev>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* max_line_breaks?: int,
|
||||
* min_line_breaks?: int
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* max_line_breaks: int,
|
||||
* min_line_breaks: int
|
||||
* }
|
||||
*/
|
||||
final class BlankLinesBeforeNamespaceFixer extends AbstractFixer implements WhitespacesAwareFixerInterface, ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Operator;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -32,9 +33,23 @@ use Symfony\Component\OptionsResolver\Exception\InvalidOptionsException;
|
||||
|
||||
/**
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* default?: 'align'|'align_by_scope'|'align_single_space'|'align_single_space_by_scope'|'align_single_space_minimal'|'align_single_space_minimal_by_scope'|'at_least_single_space'|'no_space'|'single_space'|null,
|
||||
* operators?: array<string, ?string>
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* default: 'align'|'align_by_scope'|'align_single_space'|'align_single_space_by_scope'|'align_single_space_minimal'|'align_single_space_minimal_by_scope'|'at_least_single_space'|'no_space'|'single_space'|null,
|
||||
* operators: array<string, ?string>
|
||||
* }
|
||||
*/
|
||||
final class BinaryOperatorSpacesFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@ -177,13 +192,6 @@ final class BinaryOperatorSpacesFixer extends AbstractFixer implements Configura
|
||||
*/
|
||||
private array $operators = [];
|
||||
|
||||
public function configure(array $configuration): void
|
||||
{
|
||||
parent::configure($configuration);
|
||||
|
||||
$this->operators = $this->resolveOperatorsFromConfig();
|
||||
}
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
@ -320,6 +328,11 @@ $array = [
|
||||
return true;
|
||||
}
|
||||
|
||||
protected function configurePostNormalisation(): void
|
||||
{
|
||||
$this->operators = $this->resolveOperatorsFromConfig();
|
||||
}
|
||||
|
||||
protected function applyFix(\SplFileInfo $file, Tokens $tokens): void
|
||||
{
|
||||
$this->tokensAnalyzer = new TokensAnalyzer($tokens);
|
||||
@ -358,7 +371,7 @@ $array = [
|
||||
->setAllowedValues(self::$allowedValues)
|
||||
->getOption(),
|
||||
(new FixerOptionBuilder('operators', 'Dictionary of `binary operator` => `fix strategy` values that differ from the default strategy. Supported are: '.Utils::naturalLanguageJoinWithBackticks(self::SUPPORTED_OPERATORS).'.'))
|
||||
->setAllowedTypes(['array'])
|
||||
->setAllowedTypes(['array<string, ?string>'])
|
||||
->setAllowedValues([static function (array $option): bool {
|
||||
foreach ($option as $operator => $value) {
|
||||
if (!\in_array($operator, self::SUPPORTED_OPERATORS, true)) {
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Operator;
|
||||
|
||||
use PhpCsFixer\AbstractFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -27,9 +28,21 @@ use PhpCsFixer\Tokenizer\Tokens;
|
||||
|
||||
/**
|
||||
* @author Dariusz Rumiński <dariusz.ruminski@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* spacing?: 'none'|'one'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* spacing: 'none'|'one'
|
||||
* }
|
||||
*/
|
||||
final class ConcatSpaceFixer extends AbstractFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
public function getDefinition(): FixerDefinitionInterface
|
||||
{
|
||||
return new FixerDefinition(
|
||||
|
||||
@ -16,6 +16,7 @@ namespace PhpCsFixer\Fixer\Operator;
|
||||
|
||||
use PhpCsFixer\Fixer\AbstractIncrementOperatorFixer;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerInterface;
|
||||
use PhpCsFixer\Fixer\ConfigurableFixerTrait;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolver;
|
||||
use PhpCsFixer\FixerConfiguration\FixerConfigurationResolverInterface;
|
||||
use PhpCsFixer\FixerConfiguration\FixerOptionBuilder;
|
||||
@ -29,9 +30,21 @@ use PhpCsFixer\Tokenizer\TokensAnalyzer;
|
||||
/**
|
||||
* @author Gregor Harlan <gharlan@web.de>
|
||||
* @author Kuba Werłos <werlos@gmail.com>
|
||||
*
|
||||
* @implements ConfigurableFixerInterface<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration>
|
||||
*
|
||||
* @phpstan-type _AutogeneratedInputConfiguration array{
|
||||
* style?: 'post'|'pre'
|
||||
* }
|
||||
* @phpstan-type _AutogeneratedComputedConfiguration array{
|
||||
* style: 'post'|'pre'
|
||||
* }
|
||||
*/
|
||||
final class IncrementStyleFixer extends AbstractIncrementOperatorFixer implements ConfigurableFixerInterface
|
||||
{
|
||||
/** @use ConfigurableFixerTrait<_AutogeneratedInputConfiguration, _AutogeneratedComputedConfiguration> */
|
||||
use ConfigurableFixerTrait;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user